Search is not available for this dataset
repo_name string | path string | license string | full_code string | full_size int64 | uncommented_code string | uncommented_size int64 | function_only_code string | function_only_size int64 | is_commented bool | is_signatured bool | n_ast_errors int64 | ast_max_depth int64 | n_whitespaces int64 | n_ast_nodes int64 | n_ast_terminals int64 | n_ast_nonterminals int64 | loc int64 | cycloplexity int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rjohnsondev/haskellshop | src/ShopData/Category.hs | bsd-2-clause | delCategory :: PS.HasPostgres m => Int -> Int -> m ()
delCategory cid ncid = PS.withTransaction $ do
-- if we have products that are on an existing category as well,
-- just remove this category from their list.
PS.execute "DELETE FROM product_categories WHERE\
\ category_id = ? AND\
\ product_id IN \
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id != ? AND\
\ product_id IN\
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id = ?))"
(cid, cid, cid)
-- move the remaining products to the new category
PS.execute "UPDATE product_categories SET category_id = ? WHERE category_id = ?"
(ncid, cid)
-- move any child categories to the new category as well
PS.execute "UPDATE categories SET parent_category_id = ? WHERE parent_category_id = ?"
(ncid, cid)
-- kill off the category!
PS.execute "DELETE FROM categories WHERE category_id = ?" (Only cid)
return () | 1,445 | delCategory :: PS.HasPostgres m => Int -> Int -> m ()
delCategory cid ncid = PS.withTransaction $ do
-- if we have products that are on an existing category as well,
-- just remove this category from their list.
PS.execute "DELETE FROM product_categories WHERE\
\ category_id = ? AND\
\ product_id IN \
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id != ? AND\
\ product_id IN\
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id = ?))"
(cid, cid, cid)
-- move the remaining products to the new category
PS.execute "UPDATE product_categories SET category_id = ? WHERE category_id = ?"
(ncid, cid)
-- move any child categories to the new category as well
PS.execute "UPDATE categories SET parent_category_id = ? WHERE parent_category_id = ?"
(ncid, cid)
-- kill off the category!
PS.execute "DELETE FROM categories WHERE category_id = ?" (Only cid)
return () | 1,445 | delCategory cid ncid = PS.withTransaction $ do
-- if we have products that are on an existing category as well,
-- just remove this category from their list.
PS.execute "DELETE FROM product_categories WHERE\
\ category_id = ? AND\
\ product_id IN \
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id != ? AND\
\ product_id IN\
\ (SELECT\
\ product_id\
\ FROM\
\ product_categories\
\ WHERE\
\ category_id = ?))"
(cid, cid, cid)
-- move the remaining products to the new category
PS.execute "UPDATE product_categories SET category_id = ? WHERE category_id = ?"
(ncid, cid)
-- move any child categories to the new category as well
PS.execute "UPDATE categories SET parent_category_id = ? WHERE parent_category_id = ?"
(ncid, cid)
-- kill off the category!
PS.execute "DELETE FROM categories WHERE category_id = ?" (Only cid)
return () | 1,391 | false | true | 0 | 11 | 682 | 129 | 63 | 66 | null | null |
utky/lycopene | src/Lycopene/Application.hs | apache-2.0 | defaultEngine :: IO AppEngine
defaultEngine = do
dpath <- dataPath
ds <- connect dpath
return $ appEngine ds | 114 | defaultEngine :: IO AppEngine
defaultEngine = do
dpath <- dataPath
ds <- connect dpath
return $ appEngine ds | 114 | defaultEngine = do
dpath <- dataPath
ds <- connect dpath
return $ appEngine ds | 84 | false | true | 0 | 9 | 23 | 47 | 19 | 28 | null | null |
JeffHeard/Hieroglyph | Graphics/Rendering/Hieroglyph/OpenGL/Render.hs | bsd-2-clause | renderObjects isSelection (z:zs) (o:os) !r = renderObj isSelection ((-2) + z/(z+1)) o r >>= renderObjects isSelection zs os | 123 | renderObjects isSelection (z:zs) (o:os) !r = renderObj isSelection ((-2) + z/(z+1)) o r >>= renderObjects isSelection zs os | 123 | renderObjects isSelection (z:zs) (o:os) !r = renderObj isSelection ((-2) + z/(z+1)) o r >>= renderObjects isSelection zs os | 123 | false | false | 0 | 11 | 17 | 73 | 37 | 36 | null | null |
gnn/Hets | Static/GTheory.hs | gpl-2.0 | homogeniseSink :: Logic lid sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree
=> lid -- ^ the target logic to which morphisms will be coerced
-> [(Node, GMorphism)] -- ^ the list of edges to be homogenised
-> Result [(Node, morphism)]
homogeniseSink targetLid dEdges =
-- See homogeniseDiagram for comments on implementation.
let convertMorphism (n, GMorphism cid _ _ mor _) =
if isIdComorphism (Comorphism cid) then
do mor' <- coerceMorphism (targetLogic cid) targetLid "" mor
return (n, mor')
else fail $
"Trying to coerce a morphism between different logics.\n" ++
"Heterogeneous specifications are not fully supported yet."
convEdges [] = return []
convEdges (e : es) = do
ce <- convertMorphism e
ces <- convEdges es
return (ce : ces)
in convEdges dEdges | 1,085 | homogeniseSink :: Logic lid sublogics
basic_spec sentence symb_items symb_map_items
sign morphism symbol raw_symbol proof_tree
=> lid -- ^ the target logic to which morphisms will be coerced
-> [(Node, GMorphism)] -- ^ the list of edges to be homogenised
-> Result [(Node, morphism)]
homogeniseSink targetLid dEdges =
-- See homogeniseDiagram for comments on implementation.
let convertMorphism (n, GMorphism cid _ _ mor _) =
if isIdComorphism (Comorphism cid) then
do mor' <- coerceMorphism (targetLogic cid) targetLid "" mor
return (n, mor')
else fail $
"Trying to coerce a morphism between different logics.\n" ++
"Heterogeneous specifications are not fully supported yet."
convEdges [] = return []
convEdges (e : es) = do
ce <- convertMorphism e
ces <- convEdges es
return (ce : ces)
in convEdges dEdges | 1,085 | homogeniseSink targetLid dEdges =
-- See homogeniseDiagram for comments on implementation.
let convertMorphism (n, GMorphism cid _ _ mor _) =
if isIdComorphism (Comorphism cid) then
do mor' <- coerceMorphism (targetLogic cid) targetLid "" mor
return (n, mor')
else fail $
"Trying to coerce a morphism between different logics.\n" ++
"Heterogeneous specifications are not fully supported yet."
convEdges [] = return []
convEdges (e : es) = do
ce <- convertMorphism e
ces <- convEdges es
return (ce : ces)
in convEdges dEdges | 703 | false | true | 0 | 15 | 403 | 231 | 115 | 116 | null | null |
siddhanathan/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isFFIImportResultTy :: DynFlags -> Type -> Validity
isFFIImportResultTy dflags ty
= checkRepTyCon (legalFIResultTyCon dflags) ty | 130 | isFFIImportResultTy :: DynFlags -> Type -> Validity
isFFIImportResultTy dflags ty
= checkRepTyCon (legalFIResultTyCon dflags) ty | 130 | isFFIImportResultTy dflags ty
= checkRepTyCon (legalFIResultTyCon dflags) ty | 78 | false | true | 0 | 7 | 16 | 40 | 18 | 22 | null | null |
kapilash/dc | src/ccs2c/ccs2cs-lib/src/Language/CCS/Printer.hs | bsd-3-clause | epilogToDoc nm vals = hcat $ map (csValToDoc nm) vals | 53 | epilogToDoc nm vals = hcat $ map (csValToDoc nm) vals | 53 | epilogToDoc nm vals = hcat $ map (csValToDoc nm) vals | 53 | false | false | 1 | 8 | 9 | 30 | 12 | 18 | null | null |
fmapfmapfmap/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/UpdateStack.hs | mpl-2.0 | -- | The default AWS OpsWorks agent version. You have the following options:
--
-- - Auto-update - Set this parameter to 'LATEST'. AWS OpsWorks
-- automatically installs new agent versions on the stack\'s instances
-- as soon as they are available.
-- - Fixed version - Set this parameter to your preferred agent version.
-- To update the agent version, you must edit the stack configuration
-- and specify a new version. AWS OpsWorks then automatically installs
-- that version on the stack\'s instances.
--
-- The default setting is 'LATEST'. To specify an agent version, you must
-- use the complete version number, not the abbreviated number shown on the
-- console. For a list of available agent version numbers, call
-- DescribeAgentVersions.
--
-- You can also specify an agent version when you create or update an
-- instance, which overrides the stack\'s default setting.
usAgentVersion :: Lens' UpdateStack (Maybe Text)
usAgentVersion = lens _usAgentVersion (\ s a -> s{_usAgentVersion = a}) | 1,025 | usAgentVersion :: Lens' UpdateStack (Maybe Text)
usAgentVersion = lens _usAgentVersion (\ s a -> s{_usAgentVersion = a}) | 120 | usAgentVersion = lens _usAgentVersion (\ s a -> s{_usAgentVersion = a}) | 71 | true | true | 0 | 9 | 188 | 62 | 41 | 21 | null | null |
Peaker/lamdu | src/Lamdu/GUI/EvalView.hs | gpl-3.0 | advanceDepth :: _ => M env m (WithTextPos View) -> M env m (WithTextPos View)
advanceDepth action =
do
depth <- Lens.view depthLeft
if depth <= 0
then Label.make "..."
else local (depthLeft -~ 1) action | 246 | advanceDepth :: _ => M env m (WithTextPos View) -> M env m (WithTextPos View)
advanceDepth action =
do
depth <- Lens.view depthLeft
if depth <= 0
then Label.make "..."
else local (depthLeft -~ 1) action | 246 | advanceDepth action =
do
depth <- Lens.view depthLeft
if depth <= 0
then Label.make "..."
else local (depthLeft -~ 1) action | 168 | false | true | 0 | 10 | 79 | 93 | 44 | 49 | null | null |
m4lvin/robbed | src/Data/ROBDD.hs | bsd-3-clause | -- | Construct a new BDD by applying the provided binary operator
-- to the two input BDDs.
--
-- O(|v_1||v_2|)
apply :: (Bool -> Bool -> Bool) -> ROBDD -> ROBDD -> ROBDD
apply op (ROBDD _ _ bdd1) (ROBDD _ _ bdd2) =
let (bdd, s) = runBDDContext (applyInner op stdCtxt bdd1 bdd2) emptyBDDState
-- FIXME: Remove unused bindings in the revmap to allow the
-- runtime to GC unused nodes
in ROBDD (bddRevMap s) (bddIdSource s) bdd | 441 | apply :: (Bool -> Bool -> Bool) -> ROBDD -> ROBDD -> ROBDD
apply op (ROBDD _ _ bdd1) (ROBDD _ _ bdd2) =
let (bdd, s) = runBDDContext (applyInner op stdCtxt bdd1 bdd2) emptyBDDState
-- FIXME: Remove unused bindings in the revmap to allow the
-- runtime to GC unused nodes
in ROBDD (bddRevMap s) (bddIdSource s) bdd | 329 | apply op (ROBDD _ _ bdd1) (ROBDD _ _ bdd2) =
let (bdd, s) = runBDDContext (applyInner op stdCtxt bdd1 bdd2) emptyBDDState
-- FIXME: Remove unused bindings in the revmap to allow the
-- runtime to GC unused nodes
in ROBDD (bddRevMap s) (bddIdSource s) bdd | 270 | true | true | 0 | 11 | 95 | 121 | 63 | 58 | null | null |
thalerjonathan/phd | coding/prototyping/haskell/declarativeABM/haskell/MinABS/src/SIRS/SIRSModel.hs | gpl-3.0 | ------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
-- MODEL-PARAMETERS
infectedDuration :: Double
infectedDuration = 7.0 | 312 | infectedDuration :: Double
infectedDuration = 7.0 | 49 | infectedDuration = 7.0 | 22 | true | true | 0 | 6 | 10 | 21 | 10 | 11 | null | null |
GaloisInc/ivory | ivory-examples/examples/PID.hs | bsd-3-clause | cmodule :: Module
cmodule = package "PID" $ do
incl foobar
-- defStruct (Proxy :: Proxy "PID")
-- incl pidUpdate
-- incl alloc_test | 139 | cmodule :: Module
cmodule = package "PID" $ do
incl foobar
-- defStruct (Proxy :: Proxy "PID")
-- incl pidUpdate
-- incl alloc_test | 139 | cmodule = package "PID" $ do
incl foobar
-- defStruct (Proxy :: Proxy "PID")
-- incl pidUpdate
-- incl alloc_test | 121 | false | true | 0 | 8 | 30 | 27 | 14 | 13 | null | null |
fugyk/cabal | Cabal/Distribution/Simple/Haddock.hs | bsd-3-clause | renderArgs :: Verbosity
-> TempFileOptions
-> Version
-> Compiler
-> HaddockArgs
-> (([String], FilePath) -> IO a)
-> IO a
renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True outputDir
withTempFileEx tmpFileOpts outputDir "haddock-prologue.txt" $
\prologueFileName h -> do
do
when (version >= Version [2,14,4] []) (hSetEncoding h utf8)
hPutStrLn h $ fromFlag $ argPrologue args
hClose h
let pflag = "--prologue=" ++ prologueFileName
k (pflag : renderPureArgs version comp args, result)
where
outputDir = (unDir $ argOutputDir args)
result = intercalate ", "
. map (\o -> outputDir </>
case o of
Html -> "index.html"
Hoogle -> pkgstr <.> "txt")
$ arg argOutput
where
pkgstr = display $ packageName pkgid
pkgid = arg argPackageName
arg f = fromFlag $ f args | 1,151 | renderArgs :: Verbosity
-> TempFileOptions
-> Version
-> Compiler
-> HaddockArgs
-> (([String], FilePath) -> IO a)
-> IO a
renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True outputDir
withTempFileEx tmpFileOpts outputDir "haddock-prologue.txt" $
\prologueFileName h -> do
do
when (version >= Version [2,14,4] []) (hSetEncoding h utf8)
hPutStrLn h $ fromFlag $ argPrologue args
hClose h
let pflag = "--prologue=" ++ prologueFileName
k (pflag : renderPureArgs version comp args, result)
where
outputDir = (unDir $ argOutputDir args)
result = intercalate ", "
. map (\o -> outputDir </>
case o of
Html -> "index.html"
Hoogle -> pkgstr <.> "txt")
$ arg argOutput
where
pkgstr = display $ packageName pkgid
pkgid = arg argPackageName
arg f = fromFlag $ f args | 1,151 | renderArgs verbosity tmpFileOpts version comp args k = do
createDirectoryIfMissingVerbose verbosity True outputDir
withTempFileEx tmpFileOpts outputDir "haddock-prologue.txt" $
\prologueFileName h -> do
do
when (version >= Version [2,14,4] []) (hSetEncoding h utf8)
hPutStrLn h $ fromFlag $ argPrologue args
hClose h
let pflag = "--prologue=" ++ prologueFileName
k (pflag : renderPureArgs version comp args, result)
where
outputDir = (unDir $ argOutputDir args)
result = intercalate ", "
. map (\o -> outputDir </>
case o of
Html -> "index.html"
Hoogle -> pkgstr <.> "txt")
$ arg argOutput
where
pkgstr = display $ packageName pkgid
pkgid = arg argPackageName
arg f = fromFlag $ f args | 944 | false | true | 3 | 17 | 467 | 300 | 146 | 154 | null | null |
BrandKarma/http-multiplexer | src/Network/HTTPMultiplexer/Tee.hs | bsd-3-clause | teeProxy :: [String] -> LOG.LoggerSet -> Wai.Application
teeProxy backend_hosts logger_set wai_req respond = do
logRequest logger_set wai_req
http_reqs <- mapM (mkBackendRequest wai_req) backend_hosts
responses <- Async.mapConcurrently replayHttp http_reqs
let lbs_resp = head responses
respond $ Wai.responseLBS HTTP.status200 [] lbs_resp | 350 | teeProxy :: [String] -> LOG.LoggerSet -> Wai.Application
teeProxy backend_hosts logger_set wai_req respond = do
logRequest logger_set wai_req
http_reqs <- mapM (mkBackendRequest wai_req) backend_hosts
responses <- Async.mapConcurrently replayHttp http_reqs
let lbs_resp = head responses
respond $ Wai.responseLBS HTTP.status200 [] lbs_resp | 350 | teeProxy backend_hosts logger_set wai_req respond = do
logRequest logger_set wai_req
http_reqs <- mapM (mkBackendRequest wai_req) backend_hosts
responses <- Async.mapConcurrently replayHttp http_reqs
let lbs_resp = head responses
respond $ Wai.responseLBS HTTP.status200 [] lbs_resp | 293 | false | true | 0 | 10 | 49 | 107 | 49 | 58 | null | null |
vincenthz/hs-crypto-pubkey-types | Crypto/Types/PubKey/RSA.hs | bsd-3-clause | toPositive :: Integer -> Integer
toPositive int
| int < 0 = uintOfBytes $ bytesOfInt int
| otherwise = int
where uintOfBytes = foldl (\acc n -> (acc `shiftL` 8) + fromIntegral n) 0
bytesOfInt :: Integer -> [Word8]
bytesOfInt n = if testBit (head nints) 7 then nints else 0xff : nints
where nints = reverse $ plusOne $ reverse $ map complement $ bytesOfUInt (abs n)
plusOne [] = [1]
plusOne (x:xs) = if x == 0xff then 0 : plusOne xs else (x+1) : xs
bytesOfUInt x = reverse (list x)
where list i = if i <= 0xff then [fromIntegral i] else (fromIntegral i .&. 0xff) : list (i `shiftR` 8) | 691 | toPositive :: Integer -> Integer
toPositive int
| int < 0 = uintOfBytes $ bytesOfInt int
| otherwise = int
where uintOfBytes = foldl (\acc n -> (acc `shiftL` 8) + fromIntegral n) 0
bytesOfInt :: Integer -> [Word8]
bytesOfInt n = if testBit (head nints) 7 then nints else 0xff : nints
where nints = reverse $ plusOne $ reverse $ map complement $ bytesOfUInt (abs n)
plusOne [] = [1]
plusOne (x:xs) = if x == 0xff then 0 : plusOne xs else (x+1) : xs
bytesOfUInt x = reverse (list x)
where list i = if i <= 0xff then [fromIntegral i] else (fromIntegral i .&. 0xff) : list (i `shiftR` 8) | 691 | toPositive int
| int < 0 = uintOfBytes $ bytesOfInt int
| otherwise = int
where uintOfBytes = foldl (\acc n -> (acc `shiftL` 8) + fromIntegral n) 0
bytesOfInt :: Integer -> [Word8]
bytesOfInt n = if testBit (head nints) 7 then nints else 0xff : nints
where nints = reverse $ plusOne $ reverse $ map complement $ bytesOfUInt (abs n)
plusOne [] = [1]
plusOne (x:xs) = if x == 0xff then 0 : plusOne xs else (x+1) : xs
bytesOfUInt x = reverse (list x)
where list i = if i <= 0xff then [fromIntegral i] else (fromIntegral i .&. 0xff) : list (i `shiftR` 8) | 658 | false | true | 1 | 13 | 222 | 291 | 149 | 142 | null | null |
cocreature/rss2diaspora-hs | RSS.hs | mit | strip :: String -> String
strip = dropWhile isSpace | 51 | strip :: String -> String
strip = dropWhile isSpace | 51 | strip = dropWhile isSpace | 25 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
leroux/packages-haskeline | tests/Unit.hs | bsd-2-clause | rmkx = utf8 "\ESC[?1l\ESC>" | 27 | rmkx = utf8 "\ESC[?1l\ESC>" | 27 | rmkx = utf8 "\ESC[?1l\ESC>" | 27 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
skedgeme/libsystemd | src/Systemd/Wrapper/Journal.hs | bsd-3-clause | journalNextSkip :: Journal -> Word64 -> IO JournalSeekResult
journalNextSkip j skip = do
n <- throwIfNeg (journalError "journalNextSkip") $ withJournalPtr j $ \p -> I.journalNextSkip p skip
return $ JournalSeekResult skip n | 227 | journalNextSkip :: Journal -> Word64 -> IO JournalSeekResult
journalNextSkip j skip = do
n <- throwIfNeg (journalError "journalNextSkip") $ withJournalPtr j $ \p -> I.journalNextSkip p skip
return $ JournalSeekResult skip n | 227 | journalNextSkip j skip = do
n <- throwIfNeg (journalError "journalNextSkip") $ withJournalPtr j $ \p -> I.journalNextSkip p skip
return $ JournalSeekResult skip n | 166 | false | true | 0 | 12 | 35 | 78 | 36 | 42 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-code/Language/Drasil/Code/CodeQuantityDicts.hs | bsd-2-clause | consts :: CodeQuantityDict
consts = implCQD "consts" (nounPhrase
"structure holding the constant values"
"structures holding the constant values")
Nothing (Actor "Constants") (Label "consts") Nothing | 208 | consts :: CodeQuantityDict
consts = implCQD "consts" (nounPhrase
"structure holding the constant values"
"structures holding the constant values")
Nothing (Actor "Constants") (Label "consts") Nothing | 208 | consts = implCQD "consts" (nounPhrase
"structure holding the constant values"
"structures holding the constant values")
Nothing (Actor "Constants") (Label "consts") Nothing | 181 | false | true | 0 | 7 | 32 | 46 | 22 | 24 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLOptionsCollection.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection.length Mozilla HTMLOptionsCollection.length documentation>
getLength :: (MonadDOM m) => HTMLOptionsCollection -> m Word
getLength self
= liftDOM (round <$> ((self ^. js "length") >>= valToNumber)) | 276 | getLength :: (MonadDOM m) => HTMLOptionsCollection -> m Word
getLength self
= liftDOM (round <$> ((self ^. js "length") >>= valToNumber)) | 139 | getLength self
= liftDOM (round <$> ((self ^. js "length") >>= valToNumber)) | 78 | true | true | 0 | 12 | 29 | 58 | 30 | 28 | null | null |
choener/AlignmentAlgorithms | Data/Vector/Align/Global/Linear2.hs | gpl-3.0 | - | Produces the forward score, together with additional information.
nwScoreForward
∷ (Typeable z, VU.Unbox z, VG.Vector v a, VG.Vector v b, Semiring z)
⇒ (a → b → z)
-- ^ align a with b
→ (a → z)
-- ^ insert a, with no b
→ ( b → z)
-- ^ insert b, with no a
→ v a
-- ^ first input vector with input type @a@
→ v b
-- ^ second input with input type @b@
→ ( z
, Mutated (Z:.TwITbl 0 0 Id (Dense VU.Vector) (Z:.EmptyOk:.EmptyOk) (Z:.PointL I:.PointL I) z)
)
nwScoreForward fAlign fDelin fIndel i1 i2
= {-# SCC "nwScoreForward" #-} runST $ do
arr ← newWithPA (ZZ:..LtPointL n1:..LtPointL n2) zero
ret ← fillTables
$ gGlobal (sScore fAlign fDelin fIndel)
(ITbl @_ @_ @_ @_ @0 @0 (Z:.EmptyOk:.EmptyOk) arr)
(chr i1)
(chr i2)
let a = let (Z:.r) = mutatedTables ret in unId $ axiom r
return (a, ret)
where n1 = VG.length i1
n2 = VG.length i2
{ | 970 | nwScoreForward
∷ (Typeable z, VU.Unbox z, VG.Vector v a, VG.Vector v b, Semiring z)
⇒ (a → b → z)
-- ^ align a with b
→ (a → z)
-- ^ insert a, with no b
→ ( b → z)
-- ^ insert b, with no a
→ v a
-- ^ first input vector with input type @a@
→ v b
-- ^ second input with input type @b@
→ ( z
, Mutated (Z:.TwITbl 0 0 Id (Dense VU.Vector) (Z:.EmptyOk:.EmptyOk) (Z:.PointL I:.PointL I) z)
)
nwScoreForward fAlign fDelin fIndel i1 i2
= {-# SCC "nwScoreForward" #-} runST $ do
arr ← newWithPA (ZZ:..LtPointL n1:..LtPointL n2) zero
ret ← fillTables
$ gGlobal (sScore fAlign fDelin fIndel)
(ITbl @_ @_ @_ @_ @0 @0 (Z:.EmptyOk:.EmptyOk) arr)
(chr i1)
(chr i2)
let a = let (Z:.r) = mutatedTables ret in unId $ axiom r
return (a, ret)
where n1 = VG.length i1
n2 = VG.length i2
| 898 | nwScoreForward fAlign fDelin fIndel i1 i2
= {-# SCC "nwScoreForward" #-} runST $ do
arr ← newWithPA (ZZ:..LtPointL n1:..LtPointL n2) zero
ret ← fillTables
$ gGlobal (sScore fAlign fDelin fIndel)
(ITbl @_ @_ @_ @_ @0 @0 (Z:.EmptyOk:.EmptyOk) arr)
(chr i1)
(chr i2)
let a = let (Z:.r) = mutatedTables ret in unId $ axiom r
return (a, ret)
where n1 = VG.length i1
n2 = VG.length i2
| 473 | true | true | 4 | 16 | 301 | 409 | 207 | 202 | null | null |
thoughtpolice/binary-serialise-cbor | Data/Binary/Serialise/CBOR/ByteOrder.hs | bsd-3-clause | grabWord16 :: Ptr () -> Word
grabWord16 (Ptr ip#) =
W# (byteSwap16# (indexWord16OffAddr# ip# 0#)) | 101 | grabWord16 :: Ptr () -> Word
grabWord16 (Ptr ip#) =
W# (byteSwap16# (indexWord16OffAddr# ip# 0#)) | 101 | grabWord16 (Ptr ip#) =
W# (byteSwap16# (indexWord16OffAddr# ip# 0#)) | 72 | false | true | 0 | 9 | 18 | 51 | 23 | 28 | null | null |
Cahu/krpc-hs | src/KRPCHS/UI.hs | gpl-3.0 | getInputFieldRectTransformStream :: KRPCHS.UI.InputField -> RPCContext (KRPCStream (KRPCHS.UI.RectTransform))
getInputFieldRectTransformStream thisArg = requestStream $ getInputFieldRectTransformStreamReq thisArg | 212 | getInputFieldRectTransformStream :: KRPCHS.UI.InputField -> RPCContext (KRPCStream (KRPCHS.UI.RectTransform))
getInputFieldRectTransformStream thisArg = requestStream $ getInputFieldRectTransformStreamReq thisArg | 212 | getInputFieldRectTransformStream thisArg = requestStream $ getInputFieldRectTransformStreamReq thisArg | 102 | false | true | 0 | 10 | 13 | 46 | 23 | 23 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpHasSideEffects CasByteArrayOp_Int = True | 46 | primOpHasSideEffects CasByteArrayOp_Int = True | 46 | primOpHasSideEffects CasByteArrayOp_Int = True | 46 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/GTEQ_4.hs | mit | esEsOrdering GT LT = MyFalse | 28 | esEsOrdering GT LT = MyFalse | 28 | esEsOrdering GT LT = MyFalse | 28 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
olsner/ghc | compiler/nativeGen/RegAlloc/Liveness.hs | bsd-3-clause | mapGenBlockTopM f (CmmProc header label live (ListGraph blocks))
= do blocks' <- mapM f blocks
return $ CmmProc header label live (ListGraph blocks')
-- | Slurp out the list of register conflicts and reg-reg moves from this top level thing.
-- Slurping of conflicts and moves is wrapped up together so we don't have
-- to make two passes over the same code when we want to build the graph.
-- | 410 | mapGenBlockTopM f (CmmProc header label live (ListGraph blocks))
= do blocks' <- mapM f blocks
return $ CmmProc header label live (ListGraph blocks')
-- | Slurp out the list of register conflicts and reg-reg moves from this top level thing.
-- Slurping of conflicts and moves is wrapped up together so we don't have
-- to make two passes over the same code when we want to build the graph.
-- | 410 | mapGenBlockTopM f (CmmProc header label live (ListGraph blocks))
= do blocks' <- mapM f blocks
return $ CmmProc header label live (ListGraph blocks')
-- | Slurp out the list of register conflicts and reg-reg moves from this top level thing.
-- Slurping of conflicts and moves is wrapped up together so we don't have
-- to make two passes over the same code when we want to build the graph.
-- | 410 | false | false | 0 | 10 | 88 | 67 | 33 | 34 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Instances/GetSerialPortOutput.hs | mpl-2.0 | -- | Project ID for this request.
igspoProject :: Lens' InstancesGetSerialPortOutput Text
igspoProject
= lens _igspoProject (\ s a -> s{_igspoProject = a}) | 157 | igspoProject :: Lens' InstancesGetSerialPortOutput Text
igspoProject
= lens _igspoProject (\ s a -> s{_igspoProject = a}) | 123 | igspoProject
= lens _igspoProject (\ s a -> s{_igspoProject = a}) | 67 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
co-dan/NPNTool | tests/Main.hs | bsd-3-clause | (_,pn8',l8) = flip runL new $ do
p1 <- mkPlace
t <- mkTrans
(_,p3) <- circ
arc p1 t
arc t p3
return () | 114 | (_,pn8',l8) = flip runL new $ do
p1 <- mkPlace
t <- mkTrans
(_,p3) <- circ
arc p1 t
arc t p3
return () | 114 | (_,pn8',l8) = flip runL new $ do
p1 <- mkPlace
t <- mkTrans
(_,p3) <- circ
arc p1 t
arc t p3
return () | 114 | false | false | 0 | 9 | 35 | 76 | 35 | 41 | null | null |
abakst/liquidhaskell | benchmarks/bytestring-0.9.2.1/Data/ByteString.T.hs | bsd-3-clause | --TODO: use a better implementation
-- ---------------------------------------------------------------------
-- Searching for substrings
-- | /O(n)/ The 'isPrefixOf' function takes two ByteStrings and returns 'True'
-- iff the first is a prefix of the second.
{-@ isPrefixOf :: ByteString -> ByteString -> Bool @-}
isPrefixOf :: ByteString -> ByteString -> Bool
isPrefixOf (PS x1 s1 l1) (PS x2 s2 l2)
| l1 == 0 = True
| l2 < l1 = False
| otherwise = inlinePerformIO $ withForeignPtr x1 $ \p1 ->
withForeignPtr x2 $ \p2 -> do
i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2) (fromIntegral l1)
return $! i == 0
-- | /O(n)/ The 'isSuffixOf' function takes two ByteStrings and returns 'True'
-- iff the first is a suffix of the second.
--
-- The following holds:
--
-- > isSuffixOf x y == reverse x `isPrefixOf` reverse y
--
-- However, the real implemenation uses memcmp to compare the end of the
-- string only, with no reverse required..
{-@ isSuffixOf :: ByteString -> ByteString -> Bool @-} | 1,042 | isPrefixOf :: ByteString -> ByteString -> Bool
isPrefixOf (PS x1 s1 l1) (PS x2 s2 l2)
| l1 == 0 = True
| l2 < l1 = False
| otherwise = inlinePerformIO $ withForeignPtr x1 $ \p1 ->
withForeignPtr x2 $ \p2 -> do
i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2) (fromIntegral l1)
return $! i == 0
-- | /O(n)/ The 'isSuffixOf' function takes two ByteStrings and returns 'True'
-- iff the first is a suffix of the second.
--
-- The following holds:
--
-- > isSuffixOf x y == reverse x `isPrefixOf` reverse y
--
-- However, the real implemenation uses memcmp to compare the end of the
-- string only, with no reverse required..
{-@ isSuffixOf :: ByteString -> ByteString -> Bool @-} | 725 | isPrefixOf (PS x1 s1 l1) (PS x2 s2 l2)
| l1 == 0 = True
| l2 < l1 = False
| otherwise = inlinePerformIO $ withForeignPtr x1 $ \p1 ->
withForeignPtr x2 $ \p2 -> do
i <- memcmp (p1 `plusPtr` s1) (p2 `plusPtr` s2) (fromIntegral l1)
return $! i == 0
-- | /O(n)/ The 'isSuffixOf' function takes two ByteStrings and returns 'True'
-- iff the first is a suffix of the second.
--
-- The following holds:
--
-- > isSuffixOf x y == reverse x `isPrefixOf` reverse y
--
-- However, the real implemenation uses memcmp to compare the end of the
-- string only, with no reverse required..
{-@ isSuffixOf :: ByteString -> ByteString -> Bool @-} | 678 | true | true | 4 | 11 | 222 | 181 | 95 | 86 | null | null |
ambiata/mafia | test/Test/IO/Mafia/Chaos.hs | bsd-3-clause | dromedary :: Text -> Text
dromedary = mconcat . fmap upcase . T.splitOn "-"
where
upcase xs | T.null xs = xs
| otherwise = T.singleton (toUpper (T.head xs)) <> T.tail xs | 189 | dromedary :: Text -> Text
dromedary = mconcat . fmap upcase . T.splitOn "-"
where
upcase xs | T.null xs = xs
| otherwise = T.singleton (toUpper (T.head xs)) <> T.tail xs | 189 | dromedary = mconcat . fmap upcase . T.splitOn "-"
where
upcase xs | T.null xs = xs
| otherwise = T.singleton (toUpper (T.head xs)) <> T.tail xs | 163 | false | true | 0 | 12 | 51 | 89 | 41 | 48 | null | null |
mumuki/mulang | spec/PolymorphismSpec.hs | gpl-3.0 | java :: Text -> Expression
java = J.java . unpack | 49 | java :: Text -> Expression
java = J.java . unpack | 49 | java = J.java . unpack | 22 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
Fuuzetsu/stack | src/main/Main.hs | bsd-3-clause | evalCmd :: EvalOpts -> GlobalOpts -> IO ()
evalCmd EvalOpts {..} go@GlobalOpts {..} = execCmd execOpts go
where
execOpts =
ExecOpts { eoCmd = ExecGhc
, eoArgs = ["-e", evalArg]
, eoExtra = evalExtra
}
-- | Run GHCi in the context of a project. | 321 | evalCmd :: EvalOpts -> GlobalOpts -> IO ()
evalCmd EvalOpts {..} go@GlobalOpts {..} = execCmd execOpts go
where
execOpts =
ExecOpts { eoCmd = ExecGhc
, eoArgs = ["-e", evalArg]
, eoExtra = evalExtra
}
-- | Run GHCi in the context of a project. | 321 | evalCmd EvalOpts {..} go@GlobalOpts {..} = execCmd execOpts go
where
execOpts =
ExecOpts { eoCmd = ExecGhc
, eoArgs = ["-e", evalArg]
, eoExtra = evalExtra
}
-- | Run GHCi in the context of a project. | 278 | false | true | 0 | 8 | 122 | 84 | 46 | 38 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT46.hs | gpl-3.0 | even :: Nat -> Bool
even Z = True | 33 | even :: Nat -> Bool
even Z = True | 33 | even Z = True | 13 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
ony/Yampa-core | tests/AFRPTestsComp.hs | bsd-3-clause | -- Same result as above.
comp_t5 = testSF2 ((constant 2.0) >>> integral) | 72 | comp_t5 = testSF2 ((constant 2.0) >>> integral) | 47 | comp_t5 = testSF2 ((constant 2.0) >>> integral) | 47 | true | false | 1 | 9 | 11 | 27 | 12 | 15 | null | null |
energyflowanalysis/efa-2.1 | src/EFA/Flow/Sequence/AssignMap.hs | bsd-3-clause | difference ::
(Ord node) =>
AssignMap node a v ->
AssignMap node a v ->
AssignMap node a v
difference = lift2 Map.difference Map.difference | 151 | difference ::
(Ord node) =>
AssignMap node a v ->
AssignMap node a v ->
AssignMap node a v
difference = lift2 Map.difference Map.difference | 151 | difference = lift2 Map.difference Map.difference | 48 | false | true | 0 | 8 | 35 | 58 | 28 | 30 | null | null |
ezyang/ghc | compiler/cmm/PprC.hs | bsd-3-clause | -- if we print via pprAsPtrReg
isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 84 | isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 53 | isPtrReg (CmmGlobal (VanillaReg _ VNonGcPtr)) = False | 53 | true | false | 0 | 9 | 12 | 24 | 12 | 12 | null | null |
abstools/habs | src/ABS/Compiler/Codegen/Typ.hs | bsd-3-clause | -- TODO: Fut<A> should be covariant, but for implementation reasons (MVar a) it is invariant
buildInfo (ABS.TPoly _ ts1) (ABS.TPoly qu ts2) = let (l, buildArgs) = foldl (\ (i,acc) (t1,t2) -> maybe (i+1,acc) (\x -> (i+1,(i,x):acc)) (buildInfo t1 t2) ) (0,[]) (zip ts1 ts2)
in if null buildArgs
then Nothing
else Just $ Deep (showQU qu) l buildArgs | 442 | buildInfo (ABS.TPoly _ ts1) (ABS.TPoly qu ts2) = let (l, buildArgs) = foldl (\ (i,acc) (t1,t2) -> maybe (i+1,acc) (\x -> (i+1,(i,x):acc)) (buildInfo t1 t2) ) (0,[]) (zip ts1 ts2)
in if null buildArgs
then Nothing
else Just $ Deep (showQU qu) l buildArgs | 349 | buildInfo (ABS.TPoly _ ts1) (ABS.TPoly qu ts2) = let (l, buildArgs) = foldl (\ (i,acc) (t1,t2) -> maybe (i+1,acc) (\x -> (i+1,(i,x):acc)) (buildInfo t1 t2) ) (0,[]) (zip ts1 ts2)
in if null buildArgs
then Nothing
else Just $ Deep (showQU qu) l buildArgs | 349 | true | false | 0 | 17 | 154 | 176 | 95 | 81 | null | null |
noamz/linlam-gos | src/Lambek.hs | mit | goodFormula True (RImp a b) = False | 35 | goodFormula True (RImp a b) = False | 35 | goodFormula True (RImp a b) = False | 35 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
m4rw3r/warframe-dmg-hs | src/weapons/rifles.hs | mit | glaxion :: Weapon
glaxion = Weapon {
accuracy=0.125,
capacity=1500,
critChance=0.05,
critMultiplier=2.0,
damage=[Damage 12.5 Cold],
fireRate=20.0,
magazine=300,
multishot=0,
name="Glaxion",
reload=1.5,
status=0.04,
weaponType=Rifle
} | 285 | glaxion :: Weapon
glaxion = Weapon {
accuracy=0.125,
capacity=1500,
critChance=0.05,
critMultiplier=2.0,
damage=[Damage 12.5 Cold],
fireRate=20.0,
magazine=300,
multishot=0,
name="Glaxion",
reload=1.5,
status=0.04,
weaponType=Rifle
} | 285 | glaxion = Weapon {
accuracy=0.125,
capacity=1500,
critChance=0.05,
critMultiplier=2.0,
damage=[Damage 12.5 Cold],
fireRate=20.0,
magazine=300,
multishot=0,
name="Glaxion",
reload=1.5,
status=0.04,
weaponType=Rifle
} | 267 | false | true | 0 | 9 | 73 | 103 | 61 | 42 | null | null |
emmanueltouzery/cigale-timesheet | src/EventProviders/Ical.hs | mit | parseSingleValue :: GenParser st String
parseSingleValue = do
text <- many $ noneOf "\\,\r\n"
match <- Util.findM (isMatch . fst) singleValueParserMatches
case match of
Just matchInfo -> (text ++) <$> snd matchInfo
Nothing -> return text | 272 | parseSingleValue :: GenParser st String
parseSingleValue = do
text <- many $ noneOf "\\,\r\n"
match <- Util.findM (isMatch . fst) singleValueParserMatches
case match of
Just matchInfo -> (text ++) <$> snd matchInfo
Nothing -> return text | 272 | parseSingleValue = do
text <- many $ noneOf "\\,\r\n"
match <- Util.findM (isMatch . fst) singleValueParserMatches
case match of
Just matchInfo -> (text ++) <$> snd matchInfo
Nothing -> return text | 232 | false | true | 0 | 11 | 70 | 87 | 41 | 46 | null | null |
tpajenka/shift | src/ShiftGame/ScenarioParser.hs | bsd-3-clause | createScenarioArrayList _ _ [] = [] | 35 | createScenarioArrayList _ _ [] = [] | 35 | createScenarioArrayList _ _ [] = [] | 35 | false | false | 0 | 6 | 5 | 17 | 8 | 9 | null | null |
nomeata/ghc | compiler/utils/State.hs | bsd-3-clause | execState :: State s a -> s -> s
execState s i = case runState' s i of
(# _, s' #) -> s' | 104 | execState :: State s a -> s -> s
execState s i = case runState' s i of
(# _, s' #) -> s' | 104 | execState s i = case runState' s i of
(# _, s' #) -> s' | 71 | false | true | 0 | 8 | 39 | 55 | 25 | 30 | null | null |
juhp/gtk2hs | pango/Gtk2HsSetup.hs | lgpl-3.0 | signalGenProgram :: Program
signalGenProgram = simpleProgram "gtk2hsHookGenerator" | 82 | signalGenProgram :: Program
signalGenProgram = simpleProgram "gtk2hsHookGenerator" | 82 | signalGenProgram = simpleProgram "gtk2hsHookGenerator" | 54 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
ion1/swtor-ui | src/SWTOR/UIProfile/Layout.hs | mit | elementSize QuickBar5{..} = quickBarSize 5 elemScale elemNumVisible elemNumPerRow | 81 | elementSize QuickBar5{..} = quickBarSize 5 elemScale elemNumVisible elemNumPerRow | 81 | elementSize QuickBar5{..} = quickBarSize 5 elemScale elemNumVisible elemNumPerRow | 81 | false | false | 0 | 7 | 7 | 24 | 11 | 13 | null | null |
dpieroux/euler | 0/0052.hs | mit | --------------------------------------------------------------------------------
-- euler_52' order nd
--
-- Return the list of numbers n of nd digits whose products by 1, 2, up to order
-- are numbers with the same digits as n.
--------------------------------------------------------------------------------
euler_52' :: Int -> Int -> [Int]
euler_52' order nd = filter haveSameDigits candidates
where
upBound = floor ((10^nd-1) / 6)
first = 10^(nd-1) + 2
candidates = [first, first+3 .. upBound]
haveSameDigits n = all (==digits) multiples
where
digits = sort $ show n
multiples = map (sort . show . (*n)) [2..order]
-------------------------------------------------------------------------------- | 745 | euler_52' :: Int -> Int -> [Int]
euler_52' order nd = filter haveSameDigits candidates
where
upBound = floor ((10^nd-1) / 6)
first = 10^(nd-1) + 2
candidates = [first, first+3 .. upBound]
haveSameDigits n = all (==digits) multiples
where
digits = sort $ show n
multiples = map (sort . show . (*n)) [2..order]
-------------------------------------------------------------------------------- | 434 | euler_52' order nd = filter haveSameDigits candidates
where
upBound = floor ((10^nd-1) / 6)
first = 10^(nd-1) + 2
candidates = [first, first+3 .. upBound]
haveSameDigits n = all (==digits) multiples
where
digits = sort $ show n
multiples = map (sort . show . (*n)) [2..order]
-------------------------------------------------------------------------------- | 401 | true | true | 0 | 10 | 134 | 167 | 93 | 74 | null | null |
alanz/Blobs | lib/DData/Map.hs | lgpl-2.1 | glue l r
| size l > size r = let ((km,m),l') = deleteFindMax l in balance km m l' r
| otherwise = let ((km,m),r') = deleteFindMin r in balance km m l r' | 165 | glue l r
| size l > size r = let ((km,m),l') = deleteFindMax l in balance km m l' r
| otherwise = let ((km,m),r') = deleteFindMin r in balance km m l r' | 165 | glue l r
| size l > size r = let ((km,m),l') = deleteFindMax l in balance km m l' r
| otherwise = let ((km,m),r') = deleteFindMin r in balance km m l r' | 165 | false | false | 1 | 11 | 47 | 107 | 51 | 56 | null | null |
rahulmutt/ghcvm | tests/suite/basic/run/Echo.hs | bsd-3-clause | main :: IO ()
main = getContents >>= putStrLn | 45 | main :: IO ()
main = getContents >>= putStrLn | 45 | main = getContents >>= putStrLn | 31 | false | true | 1 | 6 | 8 | 24 | 10 | 14 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 5082 = 5304 | 31 | getValueFromProduct 5082 = 5304 | 31 | getValueFromProduct 5082 = 5304 | 31 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
hesiod/OpenGL | src/Graphics/Rendering/OpenGL/GL/Shaders/ShaderObjects.hs | bsd-3-clause | shaderPrecisionFormat :: ShaderType
-> PrecisionType
-> GettableStateVar ((GLint,GLint),GLint)
shaderPrecisionFormat st pt =
makeGettableStateVar $
allocaArray 2 $ \rangeBuf ->
alloca $ \precisionBuf -> do
glGetShaderPrecisionFormat (marshalShaderType st)
(marshalPrecisionType pt)
rangeBuf
precisionBuf
liftM2 (,) (peek2 (,) rangeBuf) (peek precisionBuf) | 558 | shaderPrecisionFormat :: ShaderType
-> PrecisionType
-> GettableStateVar ((GLint,GLint),GLint)
shaderPrecisionFormat st pt =
makeGettableStateVar $
allocaArray 2 $ \rangeBuf ->
alloca $ \precisionBuf -> do
glGetShaderPrecisionFormat (marshalShaderType st)
(marshalPrecisionType pt)
rangeBuf
precisionBuf
liftM2 (,) (peek2 (,) rangeBuf) (peek precisionBuf) | 558 | shaderPrecisionFormat st pt =
makeGettableStateVar $
allocaArray 2 $ \rangeBuf ->
alloca $ \precisionBuf -> do
glGetShaderPrecisionFormat (marshalShaderType st)
(marshalPrecisionType pt)
rangeBuf
precisionBuf
liftM2 (,) (peek2 (,) rangeBuf) (peek precisionBuf) | 419 | false | true | 0 | 14 | 240 | 118 | 60 | 58 | null | null |
fmthoma/ghc | compiler/main/HscTypes.hs | bsd-3-clause | lookupTypeEnv = lookupNameEnv | 29 | lookupTypeEnv = lookupNameEnv | 29 | lookupTypeEnv = lookupNameEnv | 29 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
adinapoli/api-tools | src/Data/API/JSON.hs | bsd-3-clause | prettyJSONError (IntRangeError s i r) = s ++ ": " ++ show i ++ " not in range " ++ show r | 89 | prettyJSONError (IntRangeError s i r) = s ++ ": " ++ show i ++ " not in range " ++ show r | 89 | prettyJSONError (IntRangeError s i r) = s ++ ": " ++ show i ++ " not in range " ++ show r | 89 | false | false | 0 | 8 | 21 | 41 | 19 | 22 | null | null |
jwiegley/ghc-release | libraries/Cabal/cabal-install/Distribution/Client/List.hs | gpl-3.0 | info :: Verbosity
-> PackageDBStack
-> [Repo]
-> Compiler
-> ProgramConfiguration
-> GlobalFlags
-> InfoFlags
-> [UserTarget]
-> IO ()
info verbosity _ _ _ _ _ _ [] =
notice verbosity "No packages requested. Nothing to do." | 267 | info :: Verbosity
-> PackageDBStack
-> [Repo]
-> Compiler
-> ProgramConfiguration
-> GlobalFlags
-> InfoFlags
-> [UserTarget]
-> IO ()
info verbosity _ _ _ _ _ _ [] =
notice verbosity "No packages requested. Nothing to do." | 267 | info verbosity _ _ _ _ _ _ [] =
notice verbosity "No packages requested. Nothing to do." | 92 | false | true | 0 | 15 | 81 | 82 | 40 | 42 | null | null |
simonmichael/hledger | hledger-ui/Hledger/UI/UIState.hs | gpl-3.0 | -- | Regenerate the content for the current and previous screens, from a new journal and current date.
regenerateScreens :: Journal -> Day -> UIState -> UIState
regenerateScreens j d ui@UIState{aScreen=s,aPrevScreens=ss} =
-- XXX clumsy due to entanglement of UIState and Screen.
-- sInit operates only on an appstate's current screen, so
-- remove all the screens from the appstate and then add them back
-- one at a time, regenerating as we go.
let
first:rest = reverse $ s:ss :: [Screen]
ui0 = ui{ajournal=j, aScreen=first, aPrevScreens=[]} :: UIState
ui1 = (sInit first) d False ui0 :: UIState
ui2 = foldl' (\ui s -> (sInit s) d False $ pushScreen s ui) ui1 rest :: UIState
in
ui2 | 717 | regenerateScreens :: Journal -> Day -> UIState -> UIState
regenerateScreens j d ui@UIState{aScreen=s,aPrevScreens=ss} =
-- XXX clumsy due to entanglement of UIState and Screen.
-- sInit operates only on an appstate's current screen, so
-- remove all the screens from the appstate and then add them back
-- one at a time, regenerating as we go.
let
first:rest = reverse $ s:ss :: [Screen]
ui0 = ui{ajournal=j, aScreen=first, aPrevScreens=[]} :: UIState
ui1 = (sInit first) d False ui0 :: UIState
ui2 = foldl' (\ui s -> (sInit s) d False $ pushScreen s ui) ui1 rest :: UIState
in
ui2 | 614 | regenerateScreens j d ui@UIState{aScreen=s,aPrevScreens=ss} =
-- XXX clumsy due to entanglement of UIState and Screen.
-- sInit operates only on an appstate's current screen, so
-- remove all the screens from the appstate and then add them back
-- one at a time, regenerating as we go.
let
first:rest = reverse $ s:ss :: [Screen]
ui0 = ui{ajournal=j, aScreen=first, aPrevScreens=[]} :: UIState
ui1 = (sInit first) d False ui0 :: UIState
ui2 = foldl' (\ui s -> (sInit s) d False $ pushScreen s ui) ui1 rest :: UIState
in
ui2 | 556 | true | true | 0 | 15 | 150 | 179 | 99 | 80 | null | null |
suhailshergill/extensible-effects | src/Control/Eff/State/Strict.hs | mit | -- | Transform the state with a function.
modify :: (Member (State s) r) => (s -> s) -> Eff r ()
modify f = get >>= put . f | 123 | modify :: (Member (State s) r) => (s -> s) -> Eff r ()
modify f = get >>= put . f | 81 | modify f = get >>= put . f | 26 | true | true | 0 | 8 | 29 | 58 | 30 | 28 | null | null |
c0deaddict/project-euler | src/Part1/Problem34.hs | bsd-3-clause | digitsFacSum :: Int -> Int
digitsFacSum = sum . map fac . digits | 64 | digitsFacSum :: Int -> Int
digitsFacSum = sum . map fac . digits | 64 | digitsFacSum = sum . map fac . digits | 37 | false | true | 2 | 7 | 12 | 35 | 14 | 21 | null | null |
elginer/Delve | src/VMASTCompiler.hs | gpl-3.0 | ast_var :: String -> Exp
ast_var n = Con $ UnQual $ name n | 58 | ast_var :: String -> Exp
ast_var n = Con $ UnQual $ name n | 58 | ast_var n = Con $ UnQual $ name n | 33 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
holdenlee/notebook | src/ParseUtilities.hs | mit | ioFiles:: [String] -> String -> (String -> String) -> IO ()
ioFiles inputFs outputF f =
do
handles <- sequence (fmap (\x -> openFile x ReadMode) inputFs)
contents <- sequence (fmap hGetContents handles)
let content = unlines contents
appendFile outputF (f content) | 290 | ioFiles:: [String] -> String -> (String -> String) -> IO ()
ioFiles inputFs outputF f =
do
handles <- sequence (fmap (\x -> openFile x ReadMode) inputFs)
contents <- sequence (fmap hGetContents handles)
let content = unlines contents
appendFile outputF (f content) | 289 | ioFiles inputFs outputF f =
do
handles <- sequence (fmap (\x -> openFile x ReadMode) inputFs)
contents <- sequence (fmap hGetContents handles)
let content = unlines contents
appendFile outputF (f content) | 229 | false | true | 0 | 14 | 67 | 126 | 58 | 68 | null | null |
devonhollowood/adventofcode | 2015/day9/day9.hs | mit | bestTripFrom :: World -> Location -> Distance
bestTripFrom w l = fromMaybe 0 (edgesFrom w l >>= bestOfEdges w l) | 112 | bestTripFrom :: World -> Location -> Distance
bestTripFrom w l = fromMaybe 0 (edgesFrom w l >>= bestOfEdges w l) | 112 | bestTripFrom w l = fromMaybe 0 (edgesFrom w l >>= bestOfEdges w l) | 66 | false | true | 0 | 8 | 19 | 51 | 23 | 28 | null | null |
DNoved1/distill | test/Distill/Expr/Tests.hs | mit | prop_exprsWellTyped :: WellTypedExpr -> Result
prop_exprsWellTyped (WellTypedExpr expr) =
let unique = nextAvailableUnique expr in
case runTCM (uniqueRenamer unique) (inferType expr) of
Right _ -> succeeded
Left err -> failed {reason = err}
-- | A simple test on parsing and type-checking a file of declarations. | 338 | prop_exprsWellTyped :: WellTypedExpr -> Result
prop_exprsWellTyped (WellTypedExpr expr) =
let unique = nextAvailableUnique expr in
case runTCM (uniqueRenamer unique) (inferType expr) of
Right _ -> succeeded
Left err -> failed {reason = err}
-- | A simple test on parsing and type-checking a file of declarations. | 338 | prop_exprsWellTyped (WellTypedExpr expr) =
let unique = nextAvailableUnique expr in
case runTCM (uniqueRenamer unique) (inferType expr) of
Right _ -> succeeded
Left err -> failed {reason = err}
-- | A simple test on parsing and type-checking a file of declarations. | 291 | false | true | 0 | 11 | 71 | 86 | 42 | 44 | null | null |
anttisalonen/starrover2 | src/Statistics.hs | mit | choose :: [a] -> Rnd a
choose l = do
let n = length l
i <- randomRM (0, n - 1)
return (l !! i) | 100 | choose :: [a] -> Rnd a
choose l = do
let n = length l
i <- randomRM (0, n - 1)
return (l !! i) | 100 | choose l = do
let n = length l
i <- randomRM (0, n - 1)
return (l !! i) | 77 | false | true | 0 | 11 | 31 | 74 | 34 | 40 | null | null |
TomMD/ghc | compiler/types/FamInstEnv.hs | bsd-3-clause | {-
************************************************************************
* *
Looking up a family instance
* *
************************************************************************
-}
topNormaliseType :: FamInstEnvs -> Type -> Type
topNormaliseType env ty = case topNormaliseType_maybe env ty of
Just (_co, ty') -> ty'
Nothing -> ty | 556 | topNormaliseType :: FamInstEnvs -> Type -> Type
topNormaliseType env ty = case topNormaliseType_maybe env ty of
Just (_co, ty') -> ty'
Nothing -> ty | 212 | topNormaliseType env ty = case topNormaliseType_maybe env ty of
Just (_co, ty') -> ty'
Nothing -> ty | 164 | true | true | 0 | 9 | 255 | 55 | 28 | 27 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Attoparsec.ByteString.Char8.hs | bsd-3-clause | -- | Skip over white space.
skipSpace :: Parser ()
skipSpace = I.skipWhile isSpace_w8 | 85 | skipSpace :: Parser ()
skipSpace = I.skipWhile isSpace_w8 | 57 | skipSpace = I.skipWhile isSpace_w8 | 34 | true | true | 1 | 6 | 13 | 25 | 11 | 14 | null | null |
s9gf4ult/yesod | yesod-form/Yesod/Form/I18n/Spanish.hs | mit | spanishFormMessage (MsgInvalidMinute t) = "Minuto inválido: " `mappend` t | 73 | spanishFormMessage (MsgInvalidMinute t) = "Minuto inválido: " `mappend` t | 73 | spanishFormMessage (MsgInvalidMinute t) = "Minuto inválido: " `mappend` t | 73 | false | false | 0 | 7 | 8 | 21 | 11 | 10 | null | null |
ekmett/tagged-transformer | src/Data/Functor/Trans/Tagged.hs | bsd-2-clause | -- | Lift an operation on underlying monad
mapTaggedT :: (m a -> n b) -> TaggedT s m a -> TaggedT s n b
mapTaggedT f = TagT . f . untagT | 136 | mapTaggedT :: (m a -> n b) -> TaggedT s m a -> TaggedT s n b
mapTaggedT f = TagT . f . untagT | 93 | mapTaggedT f = TagT . f . untagT | 32 | true | true | 0 | 8 | 32 | 58 | 28 | 30 | null | null |
olsner/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b | 87 | cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b | 87 | cmpEqTick (CaseOfCase a) (CaseOfCase b) = a `compare` b | 87 | false | false | 1 | 8 | 40 | 33 | 15 | 18 | null | null |
soumith/fbthrift | thrift/lib/hs/Thrift/Protocol/JSON.hs | apache-2.0 | parseJSONValue T_FLOAT = TFloat . realToFrac <$> double | 55 | parseJSONValue T_FLOAT = TFloat . realToFrac <$> double | 55 | parseJSONValue T_FLOAT = TFloat . realToFrac <$> double | 55 | false | false | 0 | 6 | 7 | 17 | 8 | 9 | null | null |
timorantalaiho/pong11 | src/GameLogic.hs | bsd-3-clause | ballAngle :: [Coordinates] -> Float
ballAngle (p1:p2:ps) = ballAngleFromVelocity v
where v = normalizedVector $ vectorTo p1 p2 | 128 | ballAngle :: [Coordinates] -> Float
ballAngle (p1:p2:ps) = ballAngleFromVelocity v
where v = normalizedVector $ vectorTo p1 p2 | 128 | ballAngle (p1:p2:ps) = ballAngleFromVelocity v
where v = normalizedVector $ vectorTo p1 p2 | 92 | false | true | 0 | 8 | 19 | 52 | 26 | 26 | null | null |
GaloisInc/saw-script | heapster-saw/src/Verifier/SAW/Heapster/Widening.hs | bsd-3-clause | -- | Find some LLVM frame variable type in a 'CruCtx'
findLLVMFrameType :: CruCtx ctx -> Maybe (SomeLLVMFrameMember ctx)
findLLVMFrameType CruCtxNil = Nothing | 158 | findLLVMFrameType :: CruCtx ctx -> Maybe (SomeLLVMFrameMember ctx)
findLLVMFrameType CruCtxNil = Nothing | 104 | findLLVMFrameType CruCtxNil = Nothing | 37 | true | true | 0 | 8 | 22 | 31 | 15 | 16 | null | null |
NickAger/LearningHaskell | HaskellProgrammingFromFirstPrinciples/Chapter7.hsproj/Chapter7.hs | mit | foldBool3 x y False = y | 23 | foldBool3 x y False = y | 23 | foldBool3 x y False = y | 23 | false | false | 1 | 5 | 5 | 19 | 6 | 13 | null | null |
comraq/scheme-interpreter | src/Core.hs | bsd-3-clause | evalDeep :: LispVal -> EnvEvaled LispVal
evalDeep (LAtom var) = liftIOEvaled (getVarDeep var) >>= \val ->
case val of
LSyntax _ -> liftThrowErr $ InvalidSyntax var
_ -> return val | 207 | evalDeep :: LispVal -> EnvEvaled LispVal
evalDeep (LAtom var) = liftIOEvaled (getVarDeep var) >>= \val ->
case val of
LSyntax _ -> liftThrowErr $ InvalidSyntax var
_ -> return val | 207 | evalDeep (LAtom var) = liftIOEvaled (getVarDeep var) >>= \val ->
case val of
LSyntax _ -> liftThrowErr $ InvalidSyntax var
_ -> return val | 166 | false | true | 0 | 11 | 57 | 74 | 35 | 39 | null | null |
kawu/tag-vanilla | src/NLP/TAG/Vanilla/SubtreeSharing/Tests.hs | bsd-2-clause | ---------------------------------------------------------------------
-- Tests
---------------------------------------------------------------------
tests :: TestTree
tests = testGroup "NLP.TAG.Vanilla.SubtreeSharing"
[ testCase "Subtree Sharing (Initial)" testShareInit
, testCase "Subtree Sharing (Auxiliary)" testShareAux ] | 336 | tests :: TestTree
tests = testGroup "NLP.TAG.Vanilla.SubtreeSharing"
[ testCase "Subtree Sharing (Initial)" testShareInit
, testCase "Subtree Sharing (Auxiliary)" testShareAux ] | 185 | tests = testGroup "NLP.TAG.Vanilla.SubtreeSharing"
[ testCase "Subtree Sharing (Initial)" testShareInit
, testCase "Subtree Sharing (Auxiliary)" testShareAux ] | 167 | true | true | 0 | 7 | 33 | 35 | 19 | 16 | null | null |
yesodweb/shakespeare | Text/Hamlet/Parse.hs | mit | compressDoc (DocContent x:rest) = DocContent x : compressDoc rest | 65 | compressDoc (DocContent x:rest) = DocContent x : compressDoc rest | 65 | compressDoc (DocContent x:rest) = DocContent x : compressDoc rest | 65 | false | false | 0 | 8 | 8 | 29 | 13 | 16 | null | null |
kapilash/dc | src/ccs2c/ccs2cs-lib/src/Language/CCS/Parser.hs | bsd-3-clause | options :: Parser [CompOpt]
options = do
keyword "options"
isEqualTo
between openBrace closeBrace (many compilerOption) | 125 | options :: Parser [CompOpt]
options = do
keyword "options"
isEqualTo
between openBrace closeBrace (many compilerOption) | 125 | options = do
keyword "options"
isEqualTo
between openBrace closeBrace (many compilerOption) | 97 | false | true | 0 | 9 | 20 | 42 | 19 | 23 | null | null |
phischu/fragnix | builtins/base/Control.Concurrent.Chan.hs | bsd-3-clause | writeChan :: Chan a -> a -> IO ()
writeChan (Chan _ writeVar) val = do
new_hole <- newEmptyMVar
mask_ $ do
old_hole <- takeMVar writeVar
putMVar old_hole (ChItem val new_hole)
putMVar writeVar new_hole
-- The reason we don't simply do this:
--
-- modifyMVar_ writeVar $ \old_hole -> do
-- putMVar old_hole (ChItem val new_hole)
-- return new_hole
--
-- is because if an asynchronous exception is received after the 'putMVar'
-- completes and before modifyMVar_ installs the new value, it will set the
-- Chan's write end to a filled hole.
-- |Read the next value from the 'Chan'. | 610 | writeChan :: Chan a -> a -> IO ()
writeChan (Chan _ writeVar) val = do
new_hole <- newEmptyMVar
mask_ $ do
old_hole <- takeMVar writeVar
putMVar old_hole (ChItem val new_hole)
putMVar writeVar new_hole
-- The reason we don't simply do this:
--
-- modifyMVar_ writeVar $ \old_hole -> do
-- putMVar old_hole (ChItem val new_hole)
-- return new_hole
--
-- is because if an asynchronous exception is received after the 'putMVar'
-- completes and before modifyMVar_ installs the new value, it will set the
-- Chan's write end to a filled hole.
-- |Read the next value from the 'Chan'. | 610 | writeChan (Chan _ writeVar) val = do
new_hole <- newEmptyMVar
mask_ $ do
old_hole <- takeMVar writeVar
putMVar old_hole (ChItem val new_hole)
putMVar writeVar new_hole
-- The reason we don't simply do this:
--
-- modifyMVar_ writeVar $ \old_hole -> do
-- putMVar old_hole (ChItem val new_hole)
-- return new_hole
--
-- is because if an asynchronous exception is received after the 'putMVar'
-- completes and before modifyMVar_ installs the new value, it will set the
-- Chan's write end to a filled hole.
-- |Read the next value from the 'Chan'. | 576 | false | true | 0 | 13 | 131 | 103 | 50 | 53 | null | null |
adarqui/Complexity | Test/Complexity/Misc.hs | bsd-3-clause | strictReplicateM_ :: NFData a => Int -> IO a -> IO ()
strictReplicateM_ n a = go n
where go 0 = return ()
go n = a >>| go (n - 1)
-- |Difference | 160 | strictReplicateM_ :: NFData a => Int -> IO a -> IO ()
strictReplicateM_ n a = go n
where go 0 = return ()
go n = a >>| go (n - 1)
-- |Difference | 160 | strictReplicateM_ n a = go n
where go 0 = return ()
go n = a >>| go (n - 1)
-- |Difference | 105 | false | true | 0 | 10 | 50 | 80 | 38 | 42 | null | null |
GaloisInc/halvm-ghc | compiler/stgSyn/StgLint.hs | bsd-3-clause | addErr :: Bag MsgDoc -> MsgDoc -> [LintLocInfo] -> Bag MsgDoc
addErr errs_so_far msg locs
= errs_so_far `snocBag` mk_msg locs
where
mk_msg (loc:_) = let (l,hdr) = dumpLoc loc
in mkLocMessage SevWarning l (hdr $$ msg)
mk_msg [] = msg | 271 | addErr :: Bag MsgDoc -> MsgDoc -> [LintLocInfo] -> Bag MsgDoc
addErr errs_so_far msg locs
= errs_so_far `snocBag` mk_msg locs
where
mk_msg (loc:_) = let (l,hdr) = dumpLoc loc
in mkLocMessage SevWarning l (hdr $$ msg)
mk_msg [] = msg | 271 | addErr errs_so_far msg locs
= errs_so_far `snocBag` mk_msg locs
where
mk_msg (loc:_) = let (l,hdr) = dumpLoc loc
in mkLocMessage SevWarning l (hdr $$ msg)
mk_msg [] = msg | 209 | false | true | 0 | 9 | 78 | 121 | 57 | 64 | null | null |
joeyinbox/space-invaders-haskell | src/Dataset.hs | gpl-2.0 | eventResultEq _ _ = False | 47 | eventResultEq _ _ = False | 47 | eventResultEq _ _ = False | 47 | false | false | 1 | 5 | 26 | 12 | 5 | 7 | null | null |
kim/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types.hs | mpl-2.0 | -- | The type of resource with which the tag is associated. Valid resource types
-- are: Cluster CIDR/IP EC2 security group Snapshot Cluster security group Subnet group
-- HSM connection HSM certificate Parameter group
--
-- For more information about Amazon Redshift resource types and constructing
-- ARNs, go to <http://docs.aws.amazon.com/redshift/latest/mgmt/constructing-redshift-arn.html Constructing an Amazon Redshift Amazon Resource Name (ARN)> in the
-- Amazon Redshift Cluster Management Guide.
trResourceType :: Lens' TaggedResource (Maybe Text)
trResourceType = lens _trResourceType (\s a -> s { _trResourceType = a }) | 633 | trResourceType :: Lens' TaggedResource (Maybe Text)
trResourceType = lens _trResourceType (\s a -> s { _trResourceType = a }) | 125 | trResourceType = lens _trResourceType (\s a -> s { _trResourceType = a }) | 73 | true | true | 0 | 9 | 87 | 52 | 31 | 21 | null | null |
GRACeFUL-project/haskelzinc | src/Interfaces/MZBuiltIns.hs | bsd-3-clause | mz_sinh = prefCall "sinh" | 26 | mz_sinh = prefCall "sinh" | 26 | mz_sinh = prefCall "sinh" | 26 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
mrakgr/futhark | src/Futhark/Analysis/CallGraph.hs | bsd-3-clause | -- | Building the call grah runs in this monad. There is no
-- mutable state.
runCGM :: CGM a -> CGEnv -> a
runCGM = runReader | 127 | runCGM :: CGM a -> CGEnv -> a
runCGM = runReader | 48 | runCGM = runReader | 18 | true | true | 0 | 8 | 27 | 31 | 14 | 17 | null | null |
kojiromike/Idris-dev | src/IRTS/JavaScript/Specialize.hs | bsd-3-clause | qualifyN :: String -> String -> Name
qualifyN ns n = qualify ns $ sUN n | 71 | qualifyN :: String -> String -> Name
qualifyN ns n = qualify ns $ sUN n | 71 | qualifyN ns n = qualify ns $ sUN n | 34 | false | true | 2 | 8 | 15 | 41 | 17 | 24 | null | null |
DanielWaterworth/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | inferDecl = PDatadecl inferTy
PType
[(emptyDocstring, [], inferCon, PPi impl (sMN 0 "iType") PType (
PPi expl (sMN 0 "ival") (PRef bi (sMN 0 "iType"))
(PRef bi inferTy)), bi, [])] | 325 | inferDecl = PDatadecl inferTy
PType
[(emptyDocstring, [], inferCon, PPi impl (sMN 0 "iType") PType (
PPi expl (sMN 0 "ival") (PRef bi (sMN 0 "iType"))
(PRef bi inferTy)), bi, [])] | 325 | inferDecl = PDatadecl inferTy
PType
[(emptyDocstring, [], inferCon, PPi impl (sMN 0 "iType") PType (
PPi expl (sMN 0 "ival") (PRef bi (sMN 0 "iType"))
(PRef bi inferTy)), bi, [])] | 325 | false | false | 1 | 14 | 175 | 105 | 52 | 53 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Pretty.hs | gpl-2.0 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs
then renderList xs
else do
outp (-1) "\n"
renderList xs | 161 | false | false | 0 | 12 | 54 | 71 | 32 | 39 | null | null |
jre2/HaskellTagging | Data/Tag.hs | bsd-3-clause | getTags :: [PCREExecOption] -> Rules -> Str -> [Tag]
getTags opts rs x = nub $ concat $ mapMaybe (\(r,ts) -> match r x opts >> Just ts) rs | 139 | getTags :: [PCREExecOption] -> Rules -> Str -> [Tag]
getTags opts rs x = nub $ concat $ mapMaybe (\(r,ts) -> match r x opts >> Just ts) rs | 138 | getTags opts rs x = nub $ concat $ mapMaybe (\(r,ts) -> match r x opts >> Just ts) rs | 85 | false | true | 0 | 10 | 29 | 77 | 40 | 37 | null | null |
brendanhay/gogol | gogol-cloudiot/gen/Network/Google/Resource/CloudIOT/Projects/Locations/Registries/Devices/Create.hs | mpl-2.0 | -- | OAuth access token.
plrdcAccessToken :: Lens' ProjectsLocationsRegistriesDevicesCreate (Maybe Text)
plrdcAccessToken
= lens _plrdcAccessToken
(\ s a -> s{_plrdcAccessToken = a}) | 190 | plrdcAccessToken :: Lens' ProjectsLocationsRegistriesDevicesCreate (Maybe Text)
plrdcAccessToken
= lens _plrdcAccessToken
(\ s a -> s{_plrdcAccessToken = a}) | 165 | plrdcAccessToken
= lens _plrdcAccessToken
(\ s a -> s{_plrdcAccessToken = a}) | 85 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
JacksonGariety/earthmacs-hs | src/Window.hs | bsd-3-clause | replaceChar :: Char -> (Window, Buffer) -> (Window, Buffer)
replaceChar char (window, buffer) = normalMode $ addChar char (forwardDelete (window, buffer)) | 154 | replaceChar :: Char -> (Window, Buffer) -> (Window, Buffer)
replaceChar char (window, buffer) = normalMode $ addChar char (forwardDelete (window, buffer)) | 154 | replaceChar char (window, buffer) = normalMode $ addChar char (forwardDelete (window, buffer)) | 94 | false | true | 0 | 9 | 20 | 63 | 35 | 28 | null | null |
rahulmutt/ghcvm | compiler/Eta/BasicTypes/NameEnv.hs | bsd-3-clause | extendNameEnv x y z = addToUFM x y z | 38 | extendNameEnv x y z = addToUFM x y z | 38 | extendNameEnv x y z = addToUFM x y z | 38 | false | false | 0 | 5 | 10 | 20 | 9 | 11 | null | null |
shaunren/htracer | src/Math.hs | gpl-3.0 | liftV2 :: (Scalar -> Scalar -> Scalar) -> Vec3 -> Vec3 -> Vec3
liftV2 f (Vec3 x y z) (Vec3 x' y' z') = Vec3 (f x x') (f y y') (f z z') | 134 | liftV2 :: (Scalar -> Scalar -> Scalar) -> Vec3 -> Vec3 -> Vec3
liftV2 f (Vec3 x y z) (Vec3 x' y' z') = Vec3 (f x x') (f y y') (f z z') | 134 | liftV2 f (Vec3 x y z) (Vec3 x' y' z') = Vec3 (f x x') (f y y') (f z z') | 71 | false | true | 0 | 8 | 33 | 92 | 46 | 46 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Misc.hs | bsd-3-clause | mfromJust s Nothing = errorstar $ "mfromJust: Nothing " ++ s | 61 | mfromJust s Nothing = errorstar $ "mfromJust: Nothing " ++ s | 61 | mfromJust s Nothing = errorstar $ "mfromJust: Nothing " ++ s | 61 | false | false | 0 | 6 | 11 | 19 | 9 | 10 | null | null |
mettekou/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | litIsLifted _ = False | 35 | litIsLifted _ = False | 35 | litIsLifted _ = False | 35 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
fimad/scalpel | scalpel-core/src/Text/HTML/Scalpel/Internal/Scrape/StringLike.hs | apache-2.0 | -- | The 'scrapeStringLike' function parses a 'StringLike' value into a list of
-- tags and executes a 'Scraper' on it.
scrapeStringLike :: (TagSoup.StringLike str)
=> str -> Scraper str a -> Maybe a
scrapeStringLike = fmap runIdentity . scrapeStringLikeT | 272 | scrapeStringLike :: (TagSoup.StringLike str)
=> str -> Scraper str a -> Maybe a
scrapeStringLike = fmap runIdentity . scrapeStringLikeT | 152 | scrapeStringLike = fmap runIdentity . scrapeStringLikeT | 55 | true | true | 0 | 8 | 56 | 47 | 24 | 23 | null | null |
adarqui/ghcjs-jquery | JavaScript/JQuery.hs | mit | closestSelector :: Selector -> JQuery -> IO JQuery
closestSelector s jq = jq_closest (castRef $ toJSString s) jq | 112 | closestSelector :: Selector -> JQuery -> IO JQuery
closestSelector s jq = jq_closest (castRef $ toJSString s) jq | 112 | closestSelector s jq = jq_closest (castRef $ toJSString s) jq | 61 | false | true | 0 | 8 | 17 | 42 | 20 | 22 | null | null |
the-real-blackh/sodium-2d-game-engine | FRP/Sodium/GameEngine2D/CommonGL.hs | bsd-3-clause | orient OrientationUpMirrored = GL.scale (-1) 1 (1 :: GLfloat) | 64 | orient OrientationUpMirrored = GL.scale (-1) 1 (1 :: GLfloat) | 64 | orient OrientationUpMirrored = GL.scale (-1) 1 (1 :: GLfloat) | 64 | false | false | 1 | 7 | 11 | 32 | 15 | 17 | null | null |
Hodapp87/ivory | ivory-model-check/test/Test.hs | bsd-3-clause | shouldFail :: TestTree
shouldFail = testGroup "should be unsafe"
[ mkFailure foo1 [m1]
, mkFailure foo14 [m14]
] | 151 | shouldFail :: TestTree
shouldFail = testGroup "should be unsafe"
[ mkFailure foo1 [m1]
, mkFailure foo14 [m14]
] | 151 | shouldFail = testGroup "should be unsafe"
[ mkFailure foo1 [m1]
, mkFailure foo14 [m14]
] | 128 | false | true | 0 | 8 | 56 | 38 | 20 | 18 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4121 = 4120 | 11 | 4121 = 4120 | 11 | 4121 = 4120 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
abooij/cubicaltt | Connections.hs | mit | -- assumes alpha <= shape us
proj :: (Nominal a, Show a) => System a -> Face -> a
proj us alpha | eps `member` usalpha = usalpha ! eps
| otherwise =
error $ "proj: eps not in " ++ show usalpha ++ "\nwhich is the "
++ show alpha ++ "\nface of " ++ show us
where usalpha = us `face` alpha | 320 | proj :: (Nominal a, Show a) => System a -> Face -> a
proj us alpha | eps `member` usalpha = usalpha ! eps
| otherwise =
error $ "proj: eps not in " ++ show usalpha ++ "\nwhich is the "
++ show alpha ++ "\nface of " ++ show us
where usalpha = us `face` alpha | 291 | proj us alpha | eps `member` usalpha = usalpha ! eps
| otherwise =
error $ "proj: eps not in " ++ show usalpha ++ "\nwhich is the "
++ show alpha ++ "\nface of " ++ show us
where usalpha = us `face` alpha | 238 | true | true | 11 | 9 | 97 | 124 | 59 | 65 | null | null |
rueshyna/gogol | gogol-genomics/gen/Network/Google/Resource/Genomics/Variants/Delete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
vdUploadType :: Lens' VariantsDelete (Maybe Text)
vdUploadType
= lens _vdUploadType (\ s a -> s{_vdUploadType = a}) | 188 | vdUploadType :: Lens' VariantsDelete (Maybe Text)
vdUploadType
= lens _vdUploadType (\ s a -> s{_vdUploadType = a}) | 117 | vdUploadType
= lens _vdUploadType (\ s a -> s{_vdUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
olsner/ghc | testsuite/tests/perf/compiler/T10370.hs | bsd-3-clause | a611 :: IO (); a611 = forever $ putStrLn "a611" | 47 | a611 :: IO ()
a611 = forever $ putStrLn "a611" | 46 | a611 = forever $ putStrLn "a611" | 32 | false | true | 0 | 6 | 9 | 24 | 12 | 12 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F23.hs | bsd-3-clause | ptr_glReadInstrumentsSGIX :: FunPtr (GLint -> IO ())
ptr_glReadInstrumentsSGIX = unsafePerformIO $ getCommand "glReadInstrumentsSGIX" | 133 | ptr_glReadInstrumentsSGIX :: FunPtr (GLint -> IO ())
ptr_glReadInstrumentsSGIX = unsafePerformIO $ getCommand "glReadInstrumentsSGIX" | 133 | ptr_glReadInstrumentsSGIX = unsafePerformIO $ getCommand "glReadInstrumentsSGIX" | 80 | false | true | 0 | 9 | 12 | 33 | 16 | 17 | null | null |
ihc/futhark | src/Futhark/CodeGen/ImpGen.hs | isc | -- | Like 'declaringFParams', but does not create new declarations.
withFParams :: ExplicitMemorish lore => [FParam lore] -> ImpM lore op a -> ImpM lore op a
withFParams = flip $ foldr withFParam
where withFParam fparam m = do
entry <- memBoundToVarEntry Nothing $ noUniquenessReturns $ paramAttr fparam
local (insertInVtable (paramName fparam) entry) m | 375 | withFParams :: ExplicitMemorish lore => [FParam lore] -> ImpM lore op a -> ImpM lore op a
withFParams = flip $ foldr withFParam
where withFParam fparam m = do
entry <- memBoundToVarEntry Nothing $ noUniquenessReturns $ paramAttr fparam
local (insertInVtable (paramName fparam) entry) m | 307 | withFParams = flip $ foldr withFParam
where withFParam fparam m = do
entry <- memBoundToVarEntry Nothing $ noUniquenessReturns $ paramAttr fparam
local (insertInVtable (paramName fparam) entry) m | 217 | true | true | 0 | 11 | 75 | 109 | 51 | 58 | null | null |
urbanslug/ghc | testsuite/tests/indexed-types/should_compile/red-black-delete.hs | bsd-3-clause | showDT (DT c l x r) =
"(DT " ++ show c ++ " " ++ showT l ++ " "
++ "..." ++ " " ++ showT r ++ ")" | 112 | showDT (DT c l x r) =
"(DT " ++ show c ++ " " ++ showT l ++ " "
++ "..." ++ " " ++ showT r ++ ")" | 112 | showDT (DT c l x r) =
"(DT " ++ show c ++ " " ++ showT l ++ " "
++ "..." ++ " " ++ showT r ++ ")" | 112 | false | false | 4 | 8 | 45 | 66 | 29 | 37 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.