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
ezyang/ghc
compiler/types/Type.hs
bsd-3-clause
splitForAllTyVarBndrs :: Type -> ([TyVarBinder], Type) splitForAllTyVarBndrs ty = split ty ty [] where split orig_ty ty bs | Just ty' <- coreView ty = split orig_ty ty' bs split _ (ForAllTy b res) bs = split res res (b:bs) split orig_ty _ bs = (reverse bs, orig_ty) -- | Checks whet...
369
splitForAllTyVarBndrs :: Type -> ([TyVarBinder], Type) splitForAllTyVarBndrs ty = split ty ty [] where split orig_ty ty bs | Just ty' <- coreView ty = split orig_ty ty' bs split _ (ForAllTy b res) bs = split res res (b:bs) split orig_ty _ bs = (reverse bs, orig_ty) -- | Checks whet...
369
splitForAllTyVarBndrs ty = split ty ty [] where split orig_ty ty bs | Just ty' <- coreView ty = split orig_ty ty' bs split _ (ForAllTy b res) bs = split res res (b:bs) split orig_ty _ bs = (reverse bs, orig_ty) -- | Checks whether this is a proper forall (with a named binder)
314
false
true
3
9
98
137
64
73
null
null
seagull-kamome/haskell-FTGL
Graphics/Rendering/FTGL.hs
bsd-2-clause
marshalCharMap EncodingAdobeLatin1= encodeTag 'l' 'a' 't' '1'
61
marshalCharMap EncodingAdobeLatin1= encodeTag 'l' 'a' 't' '1'
61
marshalCharMap EncodingAdobeLatin1= encodeTag 'l' 'a' 't' '1'
61
false
false
0
5
6
18
8
10
null
null
MarkX95/TinyHask
Evaluator.hs
bsd-3-clause
step :: TiState -> TiState step st = case hLookup (heap st) (head $ stack st) of NAp a1 a2 -> apStep st a1 a2 NSupercomb sc args body -> scStep st sc args body NNum n -> numStep st n NInd a -> indStep st a NPrim name prim -> primStep st prim NDa...
399
step :: TiState -> TiState step st = case hLookup (heap st) (head $ stack st) of NAp a1 a2 -> apStep st a1 a2 NSupercomb sc args body -> scStep st sc args body NNum n -> numStep st n NInd a -> indStep st a NPrim name prim -> primStep st prim NDat...
398
step st = case hLookup (heap st) (head $ stack st) of NAp a1 a2 -> apStep st a1 a2 NSupercomb sc args body -> scStep st sc args body NNum n -> numStep st n NInd a -> indStep st a NPrim name prim -> primStep st prim NData tag addrs -> data...
371
false
true
0
9
150
147
66
81
null
null
Ertruby/PPFinalProject
src/Sprockell/Components.hs
gpl-2.0
deQueue :: Fifo a -> (Fifo a, Maybe a) deQueue (Fifo [] ) = (Fifo [], Nothing)
81
deQueue :: Fifo a -> (Fifo a, Maybe a) deQueue (Fifo [] ) = (Fifo [], Nothing)
81
deQueue (Fifo [] ) = (Fifo [], Nothing)
42
false
true
0
7
19
56
27
29
null
null
TomMD/cryptol
src/Cryptol/Prims/Eval.hs
bsd-3-clause
arithBinary :: BinArith -> Binary arithBinary op = loop where loop ty l r | Just (len,a) <- isTSeq ty = case numTValue len of -- words and finite sequences Nat w | isTBit a -> VWord (BV w (op w (fromWord l) (fromWord r))) | otherwise -> VSeq False (zipWith (loop a) (fromSeq l) (fromSe...
877
arithBinary :: BinArith -> Binary arithBinary op = loop where loop ty l r | Just (len,a) <- isTSeq ty = case numTValue len of -- words and finite sequences Nat w | isTBit a -> VWord (BV w (op w (fromWord l) (fromWord r))) | otherwise -> VSeq False (zipWith (loop a) (fromSeq l) (fromSe...
877
arithBinary op = loop where loop ty l r | Just (len,a) <- isTSeq ty = case numTValue len of -- words and finite sequences Nat w | isTBit a -> VWord (BV w (op w (fromWord l) (fromWord r))) | otherwise -> VSeq False (zipWith (loop a) (fromSeq l) (fromSeq r)) -- streams Inf ...
843
false
true
0
16
276
401
194
207
null
null
PeterPiggyDevelopment/TitaniumCloud
src/HttpSend.hs
gpl-3.0
sendUsrFile :: String -> IO (Response String) sendUsrFile s = try (Bin.readFile s) >>= \mb_txt -> case mb_txt of Right a -> return $ sendFile OK a Left e -> liftM (sendHtml NotFound . primHtml) (Prelude.readFile "web/404.html") where _hack :: SomeException _hack = e
301
sendUsrFile :: String -> IO (Response String) sendUsrFile s = try (Bin.readFile s) >>= \mb_txt -> case mb_txt of Right a -> return $ sendFile OK a Left e -> liftM (sendHtml NotFound . primHtml) (Prelude.readFile "web/404.html") where _hack :: SomeException _hack = e
301
sendUsrFile s = try (Bin.readFile s) >>= \mb_txt -> case mb_txt of Right a -> return $ sendFile OK a Left e -> liftM (sendHtml NotFound . primHtml) (Prelude.readFile "web/404.html") where _hack :: SomeException _hack = e
254
false
true
0
13
78
113
55
58
null
null
ktvoelker/argon
src/Config/INI.hs
gpl-3.0
parseQuery' [] = parseError "Expected a tile query"
51
parseQuery' [] = parseError "Expected a tile query"
51
parseQuery' [] = parseError "Expected a tile query"
51
false
false
0
6
7
14
6
8
null
null
imeckler/proof
TranslateTex.hs
mit
proof :: TexParser Ref (Raw ProofF) proof = simpleSection "proof" proofInner where proofInner = (simpleSection "simple" (Simple . Block <$> many anyChunk) <* eof) <|> ((Steps <$> many step) <* eof) cases = simpleSection "cases" (Cases () <$> optLabel <*> many oneCase) where oneCase = descSection "c...
2,087
proof :: TexParser Ref (Raw ProofF) proof = simpleSection "proof" proofInner where proofInner = (simpleSection "simple" (Simple . Block <$> many anyChunk) <* eof) <|> ((Steps <$> many step) <* eof) cases = simpleSection "cases" (Cases () <$> optLabel <*> many oneCase) where oneCase = descSection "c...
2,087
proof = simpleSection "proof" proofInner where proofInner = (simpleSection "simple" (Simple . Block <$> many anyChunk) <* eof) <|> ((Steps <$> many step) <* eof) cases = simpleSection "cases" (Cases () <$> optLabel <*> many oneCase) where oneCase = descSection "case" proofInner -- TODO: Make cla...
2,051
false
true
13
14
495
607
298
309
null
null
samscott89/tamarin-prover
lib/theory/src/Theory/Proof.hs
gpl-3.0
cutOnSolvedDFSDiff :: DiffProof (Maybe a) -> DiffProof (Maybe a) cutOnSolvedDFSDiff prf0 = go (4 :: Integer) $ insertPathsDiff prf0 where go dMax prf = case findSolved 0 prf of NoSolution -> prf0 MaybeNoSolution -> go (2 * dMax) prf Solution path -> extractSolved path prf0 ...
1,422
cutOnSolvedDFSDiff :: DiffProof (Maybe a) -> DiffProof (Maybe a) cutOnSolvedDFSDiff prf0 = go (4 :: Integer) $ insertPathsDiff prf0 where go dMax prf = case findSolved 0 prf of NoSolution -> prf0 MaybeNoSolution -> go (2 * dMax) prf Solution path -> extractSolved path prf0 ...
1,422
cutOnSolvedDFSDiff prf0 = go (4 :: Integer) $ insertPathsDiff prf0 where go dMax prf = case findSolved 0 prf of NoSolution -> prf0 MaybeNoSolution -> go (2 * dMax) prf Solution path -> extractSolved path prf0 where findSolved d node | d >= dMax = MaybeNoS...
1,357
false
true
4
14
513
438
206
232
null
null
MauriceIsAG/HaskellScratch
.stack-work/intero/intero12244UuP.hs
bsd-3-clause
combinationsWithDupes n s = f n 1 s (map (\x -> [x]) s) where f n1 n2 s1 s2 | n1 == n2 = s2 | otherwise = f n1 (n2 + 1) s1 [x ++ [y] | x <- s2, y <- s1, y `notElem` x] ...
346
combinationsWithDupes n s = f n 1 s (map (\x -> [x]) s) where f n1 n2 s1 s2 | n1 == n2 = s2 | otherwise = f n1 (n2 + 1) s1 [x ++ [y] | x <- s2, y <- s1, y `notElem` x] ...
346
combinationsWithDupes n s = f n 1 s (map (\x -> [x]) s) where f n1 n2 s1 s2 | n1 == n2 = s2 | otherwise = f n1 (n2 + 1) s1 [x ++ [y] | x <- s2, y <- s1, y `notElem` x] ...
346
false
false
0
10
203
137
67
70
null
null
ruslantalpa/postgrest
src/PostgREST/DbStructure.hs
mit
addParentRelations (rel@(Relation t c ft fc _ _ _ _):rels) = Relation ft fc t c Parent Nothing Nothing Nothing : rel : addParentRelations rels
142
addParentRelations (rel@(Relation t c ft fc _ _ _ _):rels) = Relation ft fc t c Parent Nothing Nothing Nothing : rel : addParentRelations rels
142
addParentRelations (rel@(Relation t c ft fc _ _ _ _):rels) = Relation ft fc t c Parent Nothing Nothing Nothing : rel : addParentRelations rels
142
false
false
0
9
24
68
33
35
null
null
databrary/databrary
src/Model/RecordSlot/SQL.hs
agpl-3.0
selectVolumeSlotIdRecord :: Selector -- ^ @'Volume' -> ('Record', 'SlotId')@ selectVolumeSlotIdRecord = selectJoin 'makeVolumeSlotIdRecord [ selectColumns 'SlotId "slot_record" ["container", "segment"] , joinOn "slot_record.record = record.id" selectVolumeRecord --- XXX volumes match? ]
297
selectVolumeSlotIdRecord :: Selector selectVolumeSlotIdRecord = selectJoin 'makeVolumeSlotIdRecord [ selectColumns 'SlotId "slot_record" ["container", "segment"] , joinOn "slot_record.record = record.id" selectVolumeRecord --- XXX volumes match? ]
257
selectVolumeSlotIdRecord = selectJoin 'makeVolumeSlotIdRecord [ selectColumns 'SlotId "slot_record" ["container", "segment"] , joinOn "slot_record.record = record.id" selectVolumeRecord --- XXX volumes match? ]
220
true
true
0
8
39
52
26
26
null
null
DavidAlphaFox/ghc
compiler/cmm/CmmNode.hs
bsd-3-clause
mapExpM _ (CmmComment _) = Nothing
45
mapExpM _ (CmmComment _) = Nothing
45
mapExpM _ (CmmComment _) = Nothing
45
false
false
1
6
16
20
8
12
null
null
pbevin/milner-type-poly
test/TypedPESpec.hs
gpl-2.0
f_acc = IdT "f" acc
19
f_acc = IdT "f" acc
19
f_acc = IdT "f" acc
19
false
false
1
5
4
14
5
9
null
null
shlomobauer/BuildIT
src/OutBuild.hs
apache-2.0
loadbalanceIntf h a _ = do return () -----------------
56
loadbalanceIntf h a _ = do return () -----------------
56
loadbalanceIntf h a _ = do return () -----------------
56
false
false
0
8
10
22
10
12
null
null
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/Resource/Content/ShippingSettings/Getsupportedcarriers.hs
mpl-2.0
-- | Creates a value of 'ShippingSettingsGetsupportedcarriers' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ssgMerchantId' shippingSettingsGetsupportedcarriers :: Word64 -- ^ 'ssgMerchantId' -> ShippingSettingsGetsupportedc...
479
shippingSettingsGetsupportedcarriers :: Word64 -- ^ 'ssgMerchantId' -> ShippingSettingsGetsupportedcarriers shippingSettingsGetsupportedcarriers pSsgMerchantId_ = ShippingSettingsGetsupportedcarriers' { _ssgMerchantId = _Coerce # pSsgMerchantId_ }
267
shippingSettingsGetsupportedcarriers pSsgMerchantId_ = ShippingSettingsGetsupportedcarriers' { _ssgMerchantId = _Coerce # pSsgMerchantId_ }
151
true
true
0
8
72
45
24
21
null
null
haskellGardener/yusic
src/Yusic.hs
mit
toOctave F1 = 1
19
toOctave F1 = 1
19
toOctave F1 = 1
19
false
false
0
5
7
9
4
5
null
null
bartavelle/publicsnippets
performanceparsing/parse.hs
bsd-3-clause
findline :: ByteString -> Maybe UnixFile findline s = case BS8.split ' ' s of (inode : hardlinks : atime : mtime : ctime : user : group : blocks : ftype : perms : size : rst) -> do let (path, target) = case break (== "->") rst of (a, []) -...
1,561
findline :: ByteString -> Maybe UnixFile findline s = case BS8.split ' ' s of (inode : hardlinks : atime : mtime : ctime : user : group : blocks : ftype : perms : size : rst) -> do let (path, target) = case break (== "->") rst of (a, []) -...
1,561
findline s = case BS8.split ' ' s of (inode : hardlinks : atime : mtime : ctime : user : group : blocks : ftype : perms : size : rst) -> do let (path, target) = case break (== "->") rst of (a, []) -> (BS8.unwords a, Nothing) ...
1,520
false
true
0
20
973
347
172
175
null
null
mattias-lundell/timber-llvm
src/Scp.hs
bsd-3-clause
annoying env (EAp (EVar (Prim FloatDiv a)) [ELit l, ELit l2]) | zero l2 = True
78
annoying env (EAp (EVar (Prim FloatDiv a)) [ELit l, ELit l2]) | zero l2 = True
78
annoying env (EAp (EVar (Prim FloatDiv a)) [ELit l, ELit l2]) | zero l2 = True
78
false
false
0
11
15
54
25
29
null
null
NightRa/Idris-dev
src/Idris/Core/ProofState.hs
bsd-3-clause
processTactic UnifyProblems ps = do let (ns', probs') = updateProblems ps [] (map setReady (problems ps)) pterm' = updateSolved ns' (pterm ps) traceWhen (unifylog ps) ("(UnifyProblems) Dropping holes: " ++ show (map fst ns')) $ return (ps { pterm = pterm', solved = Nothing, problems ...
700
processTactic UnifyProblems ps = do let (ns', probs') = updateProblems ps [] (map setReady (problems ps)) pterm' = updateSolved ns' (pterm ps) traceWhen (unifylog ps) ("(UnifyProblems) Dropping holes: " ++ show (map fst ns')) $ return (ps { pterm = pterm', solved = Nothing, problems ...
700
processTactic UnifyProblems ps = do let (ns', probs') = updateProblems ps [] (map setReady (problems ps)) pterm' = updateSolved ns' (pterm ps) traceWhen (unifylog ps) ("(UnifyProblems) Dropping holes: " ++ show (map fst ns')) $ return (ps { pterm = pterm', solved = Nothing, problems ...
700
false
false
0
14
250
257
134
123
null
null
4ZP6Capstone2015/ampersand
src/Database/Design/Ampersand/FSpec/ShowHS.hs
gpl-3.0
haskellIdentifier :: String -> String haskellIdentifier cs = unCap (hsId cs) where hsId ('_': cs') = '_': hsId cs' hsId (c:cs') | isAlphaNum c = c: hsId cs' | otherwise = hsId cs' hsId "" = ""
253
haskellIdentifier :: String -> String haskellIdentifier cs = unCap (hsId cs) where hsId ('_': cs') = '_': hsId cs' hsId (c:cs') | isAlphaNum c = c: hsId cs' | otherwise = hsId cs' hsId "" = ""
253
haskellIdentifier cs = unCap (hsId cs) where hsId ('_': cs') = '_': hsId cs' hsId (c:cs') | isAlphaNum c = c: hsId cs' | otherwise = hsId cs' hsId "" = ""
215
false
true
1
8
97
110
49
61
null
null
djeik/goto
libgoto/Language/GoLite/Lexer/Literal.hs
mit
-- | Parses a floating point literal. -- -- A floating point literal has an integral and decimal part, at least one of -- which must be present. The two parts are separated by a mandatory dot, and -- may only contain decimal digits, including 0. Therefore, `0.0`, `0.`, and -- `.0` are all valid floating point literals....
830
floatLiteral :: Parser Double floatLiteral = label "float literal" (d1 <|> d2) where d1 = do i <- some digitChar char '.' notFollowedBy identifier d <- many digitChar return $ read (i ++ "." ++ d ++ "0") d2 =...
493
floatLiteral = label "float literal" (d1 <|> d2) where d1 = do i <- some digitChar char '.' notFollowedBy identifier d <- many digitChar return $ read (i ++ "." ++ d ++ "0") d2 = do char '.' ...
463
true
true
0
14
280
135
65
70
null
null
rolph-recto/liquidhaskell
src/Language/Haskell/Liquid/Bare/GhcSpec.hs
bsd-3-clause
makeGhcSpec0 cfg defVars exports name sp = do targetVars <- makeTargetVars name defVars $ binders cfg return $ sp { config = cfg , exports = exports , tgtVars = targetVars }
235
makeGhcSpec0 cfg defVars exports name sp = do targetVars <- makeTargetVars name defVars $ binders cfg return $ sp { config = cfg , exports = exports , tgtVars = targetVars }
235
makeGhcSpec0 cfg defVars exports name sp = do targetVars <- makeTargetVars name defVars $ binders cfg return $ sp { config = cfg , exports = exports , tgtVars = targetVars }
235
false
false
0
9
93
65
32
33
null
null
DanielG/ohs
src/OHSm/Update.hs
gpl-3.0
option :: [Char] -> [String] -> String -> ArgDescr a -> OptDescr a option s l udsc dsc = Option s l dsc udsc
108
option :: [Char] -> [String] -> String -> ArgDescr a -> OptDescr a option s l udsc dsc = Option s l dsc udsc
108
option s l udsc dsc = Option s l dsc udsc
41
false
true
0
9
23
57
28
29
null
null
eggzilla/Phylogeny
src/Bio/PhylogenyTools.hs
gpl-3.0
getLabel :: Gr String Double -> (Node,a) -> String getLabel parsedNewick inputNode = nodeLabel where nodeLabels = labNodes parsedNewick labeledNode = fromJust (find (\(index,label) -> index == fst inputNode) nodeLabels) nodeLabel = snd labeledNode --auxiliary functions
288
getLabel :: Gr String Double -> (Node,a) -> String getLabel parsedNewick inputNode = nodeLabel where nodeLabels = labNodes parsedNewick labeledNode = fromJust (find (\(index,label) -> index == fst inputNode) nodeLabels) nodeLabel = snd labeledNode --auxiliary functions
288
getLabel parsedNewick inputNode = nodeLabel where nodeLabels = labNodes parsedNewick labeledNode = fromJust (find (\(index,label) -> index == fst inputNode) nodeLabels) nodeLabel = snd labeledNode --auxiliary functions
237
false
true
0
11
54
92
48
44
null
null
GaloisInc/halvm-ghc
compiler/typecheck/TcClassDcl.hs
bsd-3-clause
tcClassMinimalDef :: Name -> [LSig Name] -> [TcMethInfo] -> TcM ClassMinimalDef tcClassMinimalDef _clas sigs op_info = case findMinimalDef sigs of Nothing -> return defMindef Just mindef -> do -- Warn if the given mindef does not imply the default one -- That is, the given mindef should at...
951
tcClassMinimalDef :: Name -> [LSig Name] -> [TcMethInfo] -> TcM ClassMinimalDef tcClassMinimalDef _clas sigs op_info = case findMinimalDef sigs of Nothing -> return defMindef Just mindef -> do -- Warn if the given mindef does not imply the default one -- That is, the given mindef should at...
951
tcClassMinimalDef _clas sigs op_info = case findMinimalDef sigs of Nothing -> return defMindef Just mindef -> do -- Warn if the given mindef does not imply the default one -- That is, the given mindef should at least ensure that the -- class ops without default methods are required...
871
false
true
2
12
267
187
96
91
null
null
fmapfmapfmap/amazonka
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/GetIdentityPoolConfiguration.hs
mpl-2.0
-- | Creates a value of 'GetIdentityPoolConfigurationResponse' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'gipcrsIdentityPoolId' -- -- * 'gipcrsCognitoStreams' -- -- * 'gipcrsPushSync' -- -- * 'gipcrsResponseStatus' getIdentityPoo...
684
getIdentityPoolConfigurationResponse :: Int -- ^ 'gipcrsResponseStatus' -> GetIdentityPoolConfigurationResponse getIdentityPoolConfigurationResponse pResponseStatus_ = GetIdentityPoolConfigurationResponse' { _gipcrsIdentityPoolId = Nothing , _gipcrsCognitoStreams = Nothing , _gipcrsPushSync = No...
378
getIdentityPoolConfigurationResponse pResponseStatus_ = GetIdentityPoolConfigurationResponse' { _gipcrsIdentityPoolId = Nothing , _gipcrsCognitoStreams = Nothing , _gipcrsPushSync = Nothing , _gipcrsResponseStatus = pResponseStatus_ }
258
true
true
0
7
106
65
40
25
null
null
MichaelXavier/Seraph
src/Seraph/Core.hs
bsd-2-clause
managedIO :: IO a -> (a -> IO x) -> IO x managedIO = (>>=)
58
managedIO :: IO a -> (a -> IO x) -> IO x managedIO = (>>=)
58
managedIO = (>>=)
17
false
true
0
10
14
43
20
23
null
null
hanshoglund/stash
src/Database/Stash.hs
bsd-3-clause
put :: Stashable a => Key -> a -> IO () put k v = do let meta_ = Data.Aeson.encode $ k -- need to wrap to match JSON spec! let type_ = Data.Aeson.encode $ Data.Aeson.String $ Data.String.fromString $ show $ Data.Typeable.typeOf v -- Just for sanity at the moment let data_ = Data.Aeson.encode v let hash = D...
758
put :: Stashable a => Key -> a -> IO () put k v = do let meta_ = Data.Aeson.encode $ k -- need to wrap to match JSON spec! let type_ = Data.Aeson.encode $ Data.Aeson.String $ Data.String.fromString $ show $ Data.Typeable.typeOf v -- Just for sanity at the moment let data_ = Data.Aeson.encode v let hash = D...
758
put k v = do let meta_ = Data.Aeson.encode $ k -- need to wrap to match JSON spec! let type_ = Data.Aeson.encode $ Data.Aeson.String $ Data.String.fromString $ show $ Data.Typeable.typeOf v -- Just for sanity at the moment let data_ = Data.Aeson.encode v let hash = Data.Hashable.hash k let dirPath = stashPat...
714
false
true
0
14
128
247
121
126
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x0112' = "\x0045\x0304"
39
decomposeChar '\x0112' = "\x0045\x0304"
39
decomposeChar '\x0112' = "\x0045\x0304"
39
false
false
0
4
3
10
4
6
null
null
keera-studios/hsQt
Qtc/Enums/Gui/QDialogButtonBox.hs
bsd-2-clause
eKdeLayout :: ButtonLayout eKdeLayout = ieButtonLayout $ 2
60
eKdeLayout :: ButtonLayout eKdeLayout = ieButtonLayout $ 2
60
eKdeLayout = ieButtonLayout $ 2
33
false
true
0
6
9
18
8
10
null
null
QuickChick/Luck
luck/examples-template/Stlc.hs
mit
ghcGen :: Gen (Maybe Term) ghcGen = $(mkGenQ defFlags{_fileName="examples/STLC.luck", _maxUnroll=2}) tProxy1
108
ghcGen :: Gen (Maybe Term) ghcGen = $(mkGenQ defFlags{_fileName="examples/STLC.luck", _maxUnroll=2}) tProxy1
108
ghcGen = $(mkGenQ defFlags{_fileName="examples/STLC.luck", _maxUnroll=2}) tProxy1
81
false
true
0
10
10
44
23
21
null
null
jdubrule/bond
compiler/src/Language/Bond/Codegen/CustomMapping.hs
mit
equal :: Parser String equal = symbol "="
41
equal :: Parser String equal = symbol "="
41
equal = symbol "="
18
false
true
0
5
7
17
8
9
null
null
alessandroleite/hephaestus-pl
src/meta-hephaestus/HplAssets/DTMC/Parsers/Dot.hs
lgpl-3.0
dtmcFromFile :: (FilePath, FDTMC) -> Dtmc dtmcFromFile (filename, fdtmc) = Dtmc { dtmcId = filename, chain = fdtmc }
156
dtmcFromFile :: (FilePath, FDTMC) -> Dtmc dtmcFromFile (filename, fdtmc) = Dtmc { dtmcId = filename, chain = fdtmc }
156
dtmcFromFile (filename, fdtmc) = Dtmc { dtmcId = filename, chain = fdtmc }
114
false
true
0
6
58
44
26
18
null
null
percivalgambit/hasked
test/TestModel.hs
bsd-3-clause
-- Run tests on the Model modelTests :: Spec modelTests = do describe "Buffer properties" $ do prop "can load text and write from any arbitrary file it has permissions\ \ for" $ \s -> do (tmpFilepath, tmpHandle) <- openTempFile "/tmp" "hasked_test" hP...
2,144
modelTests :: Spec modelTests = do describe "Buffer properties" $ do prop "can load text and write from any arbitrary file it has permissions\ \ for" $ \s -> do (tmpFilepath, tmpHandle) <- openTempFile "/tmp" "hasked_test" hPutStrLn tmpHandle s ...
2,118
modelTests = do describe "Buffer properties" $ do prop "can load text and write from any arbitrary file it has permissions\ \ for" $ \s -> do (tmpFilepath, tmpHandle) <- openTempFile "/tmp" "hasked_test" hPutStrLn tmpHandle s hClose tm...
2,099
true
true
0
18
917
577
269
308
null
null
abailly/hslogic
src/Hslogic/Parse.hs
bsd-3-clause
multConjunctionParser :: Term -> Parser Formula multConjunctionParser t = string "," >> spaces >> formulaParser >>= return . (t :*)
131
multConjunctionParser :: Term -> Parser Formula multConjunctionParser t = string "," >> spaces >> formulaParser >>= return . (t :*)
131
multConjunctionParser t = string "," >> spaces >> formulaParser >>= return . (t :*)
83
false
true
0
9
19
44
22
22
null
null
andre-artus/handbook-of-practical-logic-and-automated-reasoning-haskell
src/ATP/Util/List.hs
gpl-3.0
findRemFirst :: (a -> Maybe b) -> [a] -> Maybe (b, [a]) findRemFirst _ [] = Nothing
83
findRemFirst :: (a -> Maybe b) -> [a] -> Maybe (b, [a]) findRemFirst _ [] = Nothing
83
findRemFirst _ [] = Nothing
27
false
true
0
9
16
51
27
24
null
null
jstolarek/haddock
haddock-api/src/Haddock/GhcUtils.hs
bsd-2-clause
isDocD :: HsDecl a -> Bool isDocD (DocD _) = True
49
isDocD :: HsDecl a -> Bool isDocD (DocD _) = True
49
isDocD (DocD _) = True
22
false
true
0
9
10
33
14
19
null
null
haskellweekly/haskellweekly.github.io
tools/get-events.hs
mit
capitalizeState :: String -> String capitalizeState state = case state of [_, _] -> fmap Char.toUpper state _ -> state
122
capitalizeState :: String -> String capitalizeState state = case state of [_, _] -> fmap Char.toUpper state _ -> state
122
capitalizeState state = case state of [_, _] -> fmap Char.toUpper state _ -> state
86
false
true
2
6
23
49
24
25
null
null
hpacheco/HAAP
src/HAAP/IO.hs
mit
runIO :: (HaapPureStack t m IO,MonadIO m) => Haap t IO a -> Haap t m a runIO = runIOWith (defaultIOArgs)
104
runIO :: (HaapPureStack t m IO,MonadIO m) => Haap t IO a -> Haap t m a runIO = runIOWith (defaultIOArgs)
104
runIO = runIOWith (defaultIOArgs)
33
false
true
0
7
20
54
27
27
null
null
JacquesCarette/GenCheck
tutorial/list_zipper/ListZipper.hs
bsd-3-clause
-- | @delete z@ removes the element at the cursor (if any). -- Safe to call on an empty zipper. -- forall x z. delete (insert x z) == z delete :: Zipper a -> Zipper a delete (Zip ls (_:rs)) = Zip ls rs
201
delete :: Zipper a -> Zipper a delete (Zip ls (_:rs)) = Zip ls rs
65
delete (Zip ls (_:rs)) = Zip ls rs
34
true
true
0
11
44
51
25
26
null
null
skadinyo/conc
haskell/temp.hs
epl-1.0
union'' [] [] = []
18
union'' [] [] = []
18
union'' [] [] = []
18
false
false
1
6
4
20
8
12
null
null
naums/GameCollection
haskell/Ebay.hs
gpl-3.0
ebayQueryList :: Connection -- ^ Database-Connection -> [Game] -- ^ list of games to query -> IO() ebayQueryList _ [] = return ()
193
ebayQueryList :: Connection -- ^ Database-Connection -> [Game] -- ^ list of games to query -> IO() ebayQueryList _ [] = return ()
193
ebayQueryList _ [] = return ()
30
false
true
0
8
86
41
21
20
null
null
ndmitchell/firstify
Yhc/Core/Firstify/PaperOld.hs
bsd-3-clause
wrapCoreFun (CoreFun x) = CoreApp (CoreFun x) []
48
wrapCoreFun (CoreFun x) = CoreApp (CoreFun x) []
48
wrapCoreFun (CoreFun x) = CoreApp (CoreFun x) []
48
false
false
0
7
7
28
13
15
null
null
Stulv/sudoku
src/Solver.hs
bsd-3-clause
-- Order uncertain cells by number of possible values -- Update the cell with the least number of possible values updateMostCertainCell :: Solution -> [Solution] updateMostCertainCell sol = newGrids sol . head . orderedUpdates $ puzzle sol
241
updateMostCertainCell :: Solution -> [Solution] updateMostCertainCell sol = newGrids sol . head . orderedUpdates $ puzzle sol
127
updateMostCertainCell sol = newGrids sol . head . orderedUpdates $ puzzle sol
79
true
true
0
8
38
41
21
20
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isWorker ZergLair = False
25
isWorker ZergLair = False
25
isWorker ZergLair = False
25
false
false
0
5
3
9
4
5
null
null
romanb/amazonka
amazonka-iam/gen/Network/AWS/IAM/Types.hs
mpl-2.0
-- | The serial number that uniquely identifies the MFA device. For virtual MFA -- devices, the serial number is the device ARN. mfadSerialNumber :: Lens' MFADevice Text mfadSerialNumber = lens _mfadSerialNumber (\s a -> s { _mfadSerialNumber = a })
249
mfadSerialNumber :: Lens' MFADevice Text mfadSerialNumber = lens _mfadSerialNumber (\s a -> s { _mfadSerialNumber = a })
120
mfadSerialNumber = lens _mfadSerialNumber (\s a -> s { _mfadSerialNumber = a })
79
true
true
0
9
40
48
24
24
null
null
np/ling
Ling/Fmt/Benjamin/Layout.hs
bsd-3-clause
-- layout separators layoutOpen, layoutClose, layoutSep :: String layoutOpen = "{"
85
layoutOpen, layoutClose, layoutSep :: String layoutOpen = "{"
62
layoutOpen = "{"
17
true
true
3
5
13
24
11
13
null
null
kranich/haste-compiler
build-release.hs
bsd-3-clause
buildManPages = do mkdir True "man" buildManPage "hastec" buildManPage "haste-cat" where buildManPage inf = run_ "pandoc" ["-s", "-o", outf, inf'] "" where ext | Info.os == "mingw32" = "html" | otherwise = "1" outf = "man" </> inf <.> ext inf' = "do...
341
buildManPages = do mkdir True "man" buildManPage "hastec" buildManPage "haste-cat" where buildManPage inf = run_ "pandoc" ["-s", "-o", outf, inf'] "" where ext | Info.os == "mingw32" = "html" | otherwise = "1" outf = "man" </> inf <.> ext inf' = "do...
341
buildManPages = do mkdir True "man" buildManPage "hastec" buildManPage "haste-cat" where buildManPage inf = run_ "pandoc" ["-s", "-o", outf, inf'] "" where ext | Info.os == "mingw32" = "html" | otherwise = "1" outf = "man" </> inf <.> ext inf' = "do...
341
false
false
0
11
117
110
53
57
null
null
ajnsit/monadbi
src/Control/Monad/Bi.hs
gpl-3.0
lowerVia :: (MonadBi m1 m2, MonadBi m2 m3) => m2 a -> (m1 a -> m1 (m3 a)) lowerVia via = join . liftM (raise . lower . (flip asTypeOf) via) . lower
147
lowerVia :: (MonadBi m1 m2, MonadBi m2 m3) => m2 a -> (m1 a -> m1 (m3 a)) lowerVia via = join . liftM (raise . lower . (flip asTypeOf) via) . lower
147
lowerVia via = join . liftM (raise . lower . (flip asTypeOf) via) . lower
73
false
true
0
12
32
90
44
46
null
null
kishoredbn/barrelfish
tools/skate/AbsSyntaxWiki.hs
mit
hline :: String hline = "----"
30
hline :: String hline = "----"
30
hline = "----"
14
false
true
0
6
5
18
7
11
null
null
typelead/epm
Cabal/Distribution/PackageDescription/Parse.hs
bsd-3-clause
binfoFieldDescrs :: [FieldDescr BuildInfo] binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , commaListFieldWith...
5,239
binfoFieldDescrs :: [FieldDescr BuildInfo] binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , commaListFieldWith...
5,239
binfoFieldDescrs = [ boolField "buildable" buildable (\val binfo -> binfo{buildable=val}) , commaListField "build-tools" disp parseBuildTool buildTools (\xs binfo -> binfo{buildTools=xs}) , commaListFieldWithSep vcat "build-depends" disp ...
5,196
false
true
0
11
1,686
1,188
661
527
null
null
brendanhay/gogol
gogol-container/gen/Network/Google/Container/Types/Product.hs
mpl-2.0
-- | [Output only] The pod CIDR block size per node in this node pool. npPodIPv4CIdRSize :: Lens' NodePool (Maybe Int32) npPodIPv4CIdRSize = lens _npPodIPv4CIdRSize (\ s a -> s{_npPodIPv4CIdRSize = a}) . mapping _Coerce
233
npPodIPv4CIdRSize :: Lens' NodePool (Maybe Int32) npPodIPv4CIdRSize = lens _npPodIPv4CIdRSize (\ s a -> s{_npPodIPv4CIdRSize = a}) . mapping _Coerce
162
npPodIPv4CIdRSize = lens _npPodIPv4CIdRSize (\ s a -> s{_npPodIPv4CIdRSize = a}) . mapping _Coerce
112
true
true
2
8
48
60
28
32
null
null
leepike/SmartCheck
src/Test/SmartCheck/SmartGen.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- | Driver for iterateArb. iterateArbIdx :: SubTypes a => a -> (Idx, Maybe Int) -> Int -> Int -> (a -> P.Property) -> IO (Int, Result a) iterateArbIdx d (idx, max) tries sz prop = case getAtIdx d idx max of ...
1,232
iterateArbIdx :: SubTypes a => a -> (Idx, Maybe Int) -> Int -> Int -> (a -> P.Property) -> IO (Int, Result a) iterateArbIdx d (idx, max) tries sz prop = case getAtIdx d idx max of Nothing -> errorMsg "iterateArb 0" Just ext -> case ext of -- Don't analyze base ty...
1,122
iterateArbIdx d (idx, max) tries sz prop = case getAtIdx d idx max of Nothing -> errorMsg "iterateArb 0" Just ext -> case ext of -- Don't analyze base types. SubT e -> if baseType e then return (0, BaseType) else iterateArb d ext idx tries sz ...
984
true
true
0
13
301
172
92
80
null
null
vikraman/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
pprGlobalRdrEnv :: Bool -> GlobalRdrEnv -> SDoc pprGlobalRdrEnv locals_only env = vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)")) <+> lbrace , nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ] <+> rbrace) ] where remove_...
667
pprGlobalRdrEnv :: Bool -> GlobalRdrEnv -> SDoc pprGlobalRdrEnv locals_only env = vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)")) <+> lbrace , nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ] <+> rbrace) ] where remove_...
667
pprGlobalRdrEnv locals_only env = vcat [ text "GlobalRdrEnv" <+> ppWhen locals_only (ptext (sLit "(locals only)")) <+> lbrace , nest 2 (vcat [ pp (remove_locals gre_list) | gre_list <- occEnvElts env ] <+> rbrace) ] where remove_locals gres | locals_only = filter isLocalGRE gr...
619
false
true
2
15
236
226
108
118
null
null
nishiuramakoto/erasm-plusplus
src/haskell/Combinators.hs
gpl-3.0
-- | The infix either combinator. (\/) :: (b -> a) -> (c -> a) -> Either b c -> a (\/) = either
97
(\/) :: (b -> a) -> (c -> a) -> Either b c -> a (\/) = either
61
(\/) = either
13
true
true
0
9
25
54
28
26
null
null
tjakway/ghcjvm
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_apps (HsAppTypeOut (L _ fun) arg) args = ppr_apps fun (Right (LHsWcTypeX arg) : args)
91
ppr_apps (HsAppTypeOut (L _ fun) arg) args = ppr_apps fun (Right (LHsWcTypeX arg) : args)
91
ppr_apps (HsAppTypeOut (L _ fun) arg) args = ppr_apps fun (Right (LHsWcTypeX arg) : args)
91
false
false
1
9
16
53
23
30
null
null
letsbreelhere/egg
src/Instructions.hs
bsd-3-clause
funRef :: Name -> Operand funRef = ConstantOperand . C.GlobalReference funTy where funTy = ptr $ AST.FunctionType i64 [i64] False
135
funRef :: Name -> Operand funRef = ConstantOperand . C.GlobalReference funTy where funTy = ptr $ AST.FunctionType i64 [i64] False
135
funRef = ConstantOperand . C.GlobalReference funTy where funTy = ptr $ AST.FunctionType i64 [i64] False
109
false
true
0
7
25
48
24
24
null
null
chemist/highlighter
src/Text/Highlighter/Lexers/Properties.hs
bsd-3-clause
root' :: TokenMatcher root' = [ tok "\\s+" (Arbitrary "Text") , tok "(?:[;#]|//).*$" (Arbitrary "Comment") , tok "(.*?)([ \\t]*)([=:])([ \\t]*)(.*(?:(?<=\\\\)\\n.*)*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal"...
351
root' :: TokenMatcher root' = [ tok "\\s+" (Arbitrary "Text") , tok "(?:[;#]|//).*$" (Arbitrary "Comment") , tok "(.*?)([ \\t]*)([=:])([ \\t]*)(.*(?:(?<=\\\\)\\n.*)*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal"...
351
root' = [ tok "\\s+" (Arbitrary "Text") , tok "(?:[;#]|//).*$" (Arbitrary "Comment") , tok "(.*?)([ \\t]*)([=:])([ \\t]*)(.*(?:(?<=\\\\)\\n.*)*)" (ByGroups [(Arbitrary "Name" :. Arbitrary "Attribute"), (Arbitrary "Text"), (Arbitrary "Operator"), (Arbitrary "Text"), (Arbitrary "Literal" :. Arbitrary "String"...
329
false
true
0
13
53
119
59
60
null
null
Lainepress/hledger
hledger-lib/Hledger/Data/Ledger.hs
gpl-3.0
-- | Accounts in ledger whose name matches the pattern, in tree order. ledgerAccountsMatching :: [String] -> Ledger -> [Account] ledgerAccountsMatching pats = filter (matchpats pats . aname) . accounts
201
ledgerAccountsMatching :: [String] -> Ledger -> [Account] ledgerAccountsMatching pats = filter (matchpats pats . aname) . accounts
130
ledgerAccountsMatching pats = filter (matchpats pats . aname) . accounts
72
true
true
0
9
29
46
24
22
null
null
dcreager/cabal
Distribution/PackageDescription/Configuration.hs
bsd-3-clause
mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) -> CondTree v c a -> CondTree w d b mapCondTree fa fc fcnd (CondNode a c ifs) = CondNode (fa a) (fc c) (map g ifs) where g (cnd, t, me) = (fcnd cnd, mapCondTree fa fc fcnd t, fmap (mapCondTree fa fc fcnd...
325
mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) -> CondTree v c a -> CondTree w d b mapCondTree fa fc fcnd (CondNode a c ifs) = CondNode (fa a) (fc c) (map g ifs) where g (cnd, t, me) = (fcnd cnd, mapCondTree fa fc fcnd t, fmap (mapCondTree fa fc fcnd...
325
mapCondTree fa fc fcnd (CondNode a c ifs) = CondNode (fa a) (fc c) (map g ifs) where g (cnd, t, me) = (fcnd cnd, mapCondTree fa fc fcnd t, fmap (mapCondTree fa fc fcnd) me)
209
false
true
0
12
109
178
86
92
null
null
csrhodes/pandoc
src/Text/Pandoc/Writers/Docx.hs
gpl-2.0
blockToOpenXML opts (OrderedList (start, numstyle, numdelim) lst) = do let marker = NumberMarker numstyle numdelim start addList marker numid <- getNumId l <- asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst setFirstPara return l
256
blockToOpenXML opts (OrderedList (start, numstyle, numdelim) lst) = do let marker = NumberMarker numstyle numdelim start addList marker numid <- getNumId l <- asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst setFirstPara return l
256
blockToOpenXML opts (OrderedList (start, numstyle, numdelim) lst) = do let marker = NumberMarker numstyle numdelim start addList marker numid <- getNumId l <- asList $ concat `fmap` mapM (listItemToOpenXML opts numid) lst setFirstPara return l
256
false
false
0
11
47
96
45
51
null
null
ivendrov/frabjous2
src/Frabjous/StdLib.hs
mit
-- | finds the average of a list of numbers average :: [Double] -> Double average l = sum l / length l
102
average :: [Double] -> Double average l = sum l / length l
58
average l = sum l / length l
28
true
true
0
6
22
32
16
16
null
null
gridaphobe/ghc
compiler/basicTypes/Module.hs
bsd-3-clause
stringToUnitId :: String -> UnitId stringToUnitId = fsToUnitId . mkFastString
77
stringToUnitId :: String -> UnitId stringToUnitId = fsToUnitId . mkFastString
77
stringToUnitId = fsToUnitId . mkFastString
42
false
true
0
5
9
19
10
9
null
null
tejon/diagrams-contrib
src/Diagrams/TwoD/Tilings.hs
bsd-3-clause
genPolyVs :: TilingPoly -> Q2 -- ^ one vertex -> Q2 -- ^ vector to second vertex -> Polygon genPolyVs p v d = Polygon . scanl (^+^) v . take (polySides p - 1) . iterate (polyExtRotation p) $ d
304
genPolyVs :: TilingPoly -> Q2 -- ^ one vertex -> Q2 -- ^ vector to second vertex -> Polygon genPolyVs p v d = Polygon . scanl (^+^) v . take (polySides p - 1) . iterate (polyExtRotation p) $ d
304
genPolyVs p v d = Polygon . scanl (^+^) v . take (polySides p - 1) . iterate (polyExtRotation p) $ d
164
false
true
0
11
152
83
40
43
null
null
s9gf4ult/hdbi
testsrc/sqlvalues.hs
bsd-3-clause
testFromToRow :: (FromRow a, ToRow a, Show a, Eq a) => a -> Result testFromToRow a = a ==? (fromRow $ toRow a)
110
testFromToRow :: (FromRow a, ToRow a, Show a, Eq a) => a -> Result testFromToRow a = a ==? (fromRow $ toRow a)
110
testFromToRow a = a ==? (fromRow $ toRow a)
43
false
true
0
8
22
59
30
29
null
null
treeowl/GADTSeq
Data/Sequence.hs
bsd-3-clause
sizeFT (Deep n _ _ _) = n
25
sizeFT (Deep n _ _ _) = n
25
sizeFT (Deep n _ _ _) = n
25
false
false
0
7
7
21
10
11
null
null
GaloisInc/aterm-utils
src/ATerm/Utilities.hs
bsd-3-clause
inSubtree_ :: (Monad m, Monoid log) => CheckM log state m a -> CheckM log state m () inSubtree_ c = do ks <- childrenM at <- currentTerm let kids = P.map (`getATermByIndex1` at) ks P.mapM_ (`withCurrentTerm` (everywhere c)) kids -- | Applies a traversal over the tree defined by the current node (including root...
327
inSubtree_ :: (Monad m, Monoid log) => CheckM log state m a -> CheckM log state m () inSubtree_ c = do ks <- childrenM at <- currentTerm let kids = P.map (`getATermByIndex1` at) ks P.mapM_ (`withCurrentTerm` (everywhere c)) kids -- | Applies a traversal over the tree defined by the current node (including root...
327
inSubtree_ c = do ks <- childrenM at <- currentTerm let kids = P.map (`getATermByIndex1` at) ks P.mapM_ (`withCurrentTerm` (everywhere c)) kids -- | Applies a traversal over the tree defined by the current node (including root node).
242
false
true
0
12
64
117
58
59
null
null
wyn/blash
tests/OpenBLAS1.hs
bsd-3-clause
cblas_copyW :: CInt -> VS.Vector CDouble -> CInt -> VS.Vector CDouble -> CInt -> IO () cblas_copyW n dx incx dy incy = do [C.block| void { cblas_dcopy( $(const int n), $vec-ptr:(const double* dx), $(const int incx), $vec-ptr:(double* dy), $(const int incy) ...
334
cblas_copyW :: CInt -> VS.Vector CDouble -> CInt -> VS.Vector CDouble -> CInt -> IO () cblas_copyW n dx incx dy incy = do [C.block| void { cblas_dcopy( $(const int n), $vec-ptr:(const double* dx), $(const int incx), $vec-ptr:(double* dy), $(const int incy) ...
334
cblas_copyW n dx incx dy incy = do [C.block| void { cblas_dcopy( $(const int n), $vec-ptr:(const double* dx), $(const int incx), $vec-ptr:(double* dy), $(const int incy) ); } |]
247
false
true
0
12
114
71
34
37
null
null
carliros/ParserXML
src/ParserGenericXML.hs
bsd-3-clause
pXML :: Parser NTree pXML = pText <|> pTagged <|> pSpecialTag
61
pXML :: Parser NTree pXML = pText <|> pTagged <|> pSpecialTag
61
pXML = pText <|> pTagged <|> pSpecialTag
40
false
true
1
6
10
26
11
15
null
null
TomMD/cryptol
src/Cryptol/Symbolic/Prims.hs
bsd-3-clause
infChunksOf :: Integer -> [a] -> [[a]] infChunksOf each xs = let (as,bs) = genericSplitAt each xs in as : infChunksOf each bs
147
infChunksOf :: Integer -> [a] -> [[a]] infChunksOf each xs = let (as,bs) = genericSplitAt each xs in as : infChunksOf each bs
147
infChunksOf each xs = let (as,bs) = genericSplitAt each xs in as : infChunksOf each bs
108
false
true
2
10
44
71
34
37
null
null
tjakway/ghcjvm
ghc/Main.hs
bsd-3-clause
showPackagesMode = mkPostLoadMode ShowPackages
46
showPackagesMode = mkPostLoadMode ShowPackages
46
showPackagesMode = mkPostLoadMode ShowPackages
46
false
false
0
5
3
9
4
5
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Solver/TrivialSort.hs
bsd-3-clause
nonTrivSorts :: TrivInfo -> NonTrivSorts -------------------------------------------------------------------- nonTrivSorts ti = S.fromList [s | S s <- ntvs] where ntvs = [fst3 (f v) | v <- G.reachable g root] (g, f, fv) = G.graphFromEdges $ ntGraph ti root = fromMaybe err $ fv NTV er...
375
nonTrivSorts :: TrivInfo -> NonTrivSorts nonTrivSorts ti = S.fromList [s | S s <- ntvs] where ntvs = [fst3 (f v) | v <- G.reachable g root] (g, f, fv) = G.graphFromEdges $ ntGraph ti root = fromMaybe err $ fv NTV err = errorstar "nonTrivSorts: cannot find root!"
306
nonTrivSorts ti = S.fromList [s | S s <- ntvs] where ntvs = [fst3 (f v) | v <- G.reachable g root] (g, f, fv) = G.graphFromEdges $ ntGraph ti root = fromMaybe err $ fv NTV err = errorstar "nonTrivSorts: cannot find root!"
265
true
true
3
12
93
121
60
61
null
null
apyrgio/ganeti
test/hs/Test/Ganeti/SlotMap.hs
bsd-2-clause
case_occupySlots_examples :: Assertion case_occupySlots_examples = do let a n = ("a", Slot n 2) let b n = ("b", Slot n 4) let sm = Map.fromList [a 1, b 2] cm = Map.fromList [("a", 1), ("b", 1), ("c", 5)] assertEqual "fitting occupySlots" (sm `occupySlots` cm) (Map.fromList [a 2, b 3, ("c", Slot ...
364
case_occupySlots_examples :: Assertion case_occupySlots_examples = do let a n = ("a", Slot n 2) let b n = ("b", Slot n 4) let sm = Map.fromList [a 1, b 2] cm = Map.fromList [("a", 1), ("b", 1), ("c", 5)] assertEqual "fitting occupySlots" (sm `occupySlots` cm) (Map.fromList [a 2, b 3, ("c", Slot ...
364
case_occupySlots_examples = do let a n = ("a", Slot n 2) let b n = ("b", Slot n 4) let sm = Map.fromList [a 1, b 2] cm = Map.fromList [("a", 1), ("b", 1), ("c", 5)] assertEqual "fitting occupySlots" (sm `occupySlots` cm) (Map.fromList [a 2, b 3, ("c", Slot 5 0)]) -- | Union of the keys of two ...
325
false
true
4
11
88
170
92
78
null
null
g-deluca/yts-dl
app/Parser.hs
gpl-3.0
toRecord ((Limit l):xs) p = if (isNothing (limit p)) then toRecord xs (p {limit = Just l}) else Nothing
104
toRecord ((Limit l):xs) p = if (isNothing (limit p)) then toRecord xs (p {limit = Just l}) else Nothing
104
toRecord ((Limit l):xs) p = if (isNothing (limit p)) then toRecord xs (p {limit = Just l}) else Nothing
104
false
false
0
10
19
63
33
30
null
null
Hara-Laboratory/subleq-toolchain
Language/Subleq/Model/InstructionSet/SubleqR.hs
gpl-3.0
extend 0 _ = []
15
extend 0 _ = []
15
extend 0 _ = []
15
false
false
0
5
4
15
6
9
null
null
dmcclean/HaTeX
Text/LaTeX/Packages/AMSMath.hs
bsd-3-clause
-- | Roman, i.e. not-italic math. mathrm :: LaTeXC l => l -> l mathrm = comm1 "mathrm"
86
mathrm :: LaTeXC l => l -> l mathrm = comm1 "mathrm"
52
mathrm = comm1 "mathrm"
23
true
true
0
8
17
33
14
19
null
null
riaqn/resolve
src/Resolve/Exceptions.hs
bsd-3-clause
errorFromException x = do Error a <- fromException x cast a
63
errorFromException x = do Error a <- fromException x cast a
63
errorFromException x = do Error a <- fromException x cast a
63
false
false
0
8
14
28
11
17
null
null
GaloisInc/saw-script
crux-mir-comp/src/Mir/Compositional/Override.hs
bsd-3-clause
setupToReg :: forall sym t st fs tp. (IsSymInterface sym, sym ~ W4.ExprBuilder t st fs, HasCallStack) => sym -> SAW.SharedContext -> -- | `termSub`: maps `VarIndex`es in the MethodSpec's namespace to `Term`s -- in the context's namespace. Map SAW.VarIndex SAW.Term -> -- | `regMap`: maps `Var...
3,215
setupToReg :: forall sym t st fs tp. (IsSymInterface sym, sym ~ W4.ExprBuilder t st fs, HasCallStack) => sym -> SAW.SharedContext -> -- | `termSub`: maps `VarIndex`es in the MethodSpec's namespace to `Term`s -- in the context's namespace. Map SAW.VarIndex SAW.Term -> -- | `regMap`: maps `Var...
3,215
setupToReg sym sc termSub regMap allocMap shp sv = go shp sv where go :: forall tp. TypeShape tp -> MS.SetupValue MIR -> IO (RegValue sym tp) go (UnitShape _) (MS.SetupStruct _ False []) = return () go (PrimShape _ btpr) (MS.SetupTerm tt) = do term <- liftIO $ SAW.scInstantiateExt sc termSub $ SAW...
2,628
false
true
39
23
904
1,039
511
528
null
null
metataro/CPIB_ILMCompiler
src/VM/BaseDecls.hs
bsd-3-clause
isOutgoingCopy OutFlow CopyMech = True
40
isOutgoingCopy OutFlow CopyMech = True
40
isOutgoingCopy OutFlow CopyMech = True
40
false
false
0
5
6
11
5
6
null
null
csrhodes/pandoc
src/Text/Pandoc/Writers/Haddock.hs
gpl-2.0
bulletListItemToHaddock :: WriterOptions -> [Block] -> State WriterState Doc bulletListItemToHaddock opts items = do contents <- blockListToHaddock opts items let sps = replicate (writerTabStop opts - 2) ' ' let start = text ('-' : ' ' : sps) -- remove trailing blank line if it is a tight list let contents' =...
725
bulletListItemToHaddock :: WriterOptions -> [Block] -> State WriterState Doc bulletListItemToHaddock opts items = do contents <- blockListToHaddock opts items let sps = replicate (writerTabStop opts - 2) ' ' let start = text ('-' : ' ' : sps) -- remove trailing blank line if it is a tight list let contents' =...
725
bulletListItemToHaddock opts items = do contents <- blockListToHaddock opts items let sps = replicate (writerTabStop opts - 2) ' ' let start = text ('-' : ' ' : sps) -- remove trailing blank line if it is a tight list let contents' = case reverse items of (BulletList xs:_) | isTightList...
648
false
true
0
16
240
207
96
111
null
null
HS-Carbon/hs-carbon-aggregator
src/library/Carbon/Codec/Pickle/Decode.hs
apache-2.0
mkMetricTuple :: (Monad m) => Value -> m MetricTuple mkMetricTuple (Tuple [BinString path, Tuple [valTimestamp, valValue]]) = do timestamp <- pickleToTimestamp valTimestamp value <- pickleToValue valValue return $ metricTuple path timestamp value
258
mkMetricTuple :: (Monad m) => Value -> m MetricTuple mkMetricTuple (Tuple [BinString path, Tuple [valTimestamp, valValue]]) = do timestamp <- pickleToTimestamp valTimestamp value <- pickleToValue valValue return $ metricTuple path timestamp value
258
mkMetricTuple (Tuple [BinString path, Tuple [valTimestamp, valValue]]) = do timestamp <- pickleToTimestamp valTimestamp value <- pickleToValue valValue return $ metricTuple path timestamp value
205
false
true
0
9
43
92
43
49
null
null
nomeata/led-display
src/USB.hs
bsd-3-clause
openLEDDevice :: ((Screen -> IO ()) -> IO a) -> IO a openLEDDevice cont = do ref <- newIORef emptyScreen forkIO $ do ctx <- newCtx setDebug ctx PrintWarnings devs <- getDevices ctx mbdev <- findM isLEDDisplay devs case mbdev of Nothing -> do pu...
783
openLEDDevice :: ((Screen -> IO ()) -> IO a) -> IO a openLEDDevice cont = do ref <- newIORef emptyScreen forkIO $ do ctx <- newCtx setDebug ctx PrintWarnings devs <- getDevices ctx mbdev <- findM isLEDDisplay devs case mbdev of Nothing -> do pu...
783
openLEDDevice cont = do ref <- newIORef emptyScreen forkIO $ do ctx <- newCtx setDebug ctx PrintWarnings devs <- getDevices ctx mbdev <- findM isLEDDisplay devs case mbdev of Nothing -> do putStrLn "Device 0x1d34:0013 not found." ...
730
false
true
0
23
323
249
110
139
null
null
GU-CLASP/TypedFlow
examples/seq2seq/Seq2Seq.hs
lgpl-3.0
decoder :: forall (lstmSize :: Nat) (n :: Nat) (outVocabSize :: Nat) (d::Nat) w. KnownNat lstmSize => KnownNat d => (KnownNat outVocabSize, KnownNat n) => KnownBits w => String -> Gen ( T '[] Int32 -- ^ length -> T '[n, d] (Flt w) -- t...
1,310
decoder :: forall (lstmSize :: Nat) (n :: Nat) (outVocabSize :: Nat) (d::Nat) w. KnownNat lstmSize => KnownNat d => (KnownNat outVocabSize, KnownNat n) => KnownBits w => String -> Gen ( T '[] Int32 -- ^ length -> T '[n, d] (Flt w) -- t...
1,310
decoder prefix = do -- note: for an intra-language translation the embeddings can be shared easily. projs <- parameterDefault (prefix++"proj") lstm1 <- mkLSTM (prefix++"lstm1") embs <- parameterDefault "embs" w1 <- parameter' (prefix++"att1") =<< glorotUniform return $ \ lens hs thoughtVectors targetInput -...
785
false
true
0
21
437
384
199
185
null
null
alang9/deque
Data/Deque/NonCat.hs
bsd-3-clause
fixup2' (BigR (RX (B5 a b c d e) (B0)) N (TinyL B0)) = go5 a b c d e
104
fixup2' (BigR (RX (B5 a b c d e) (B0)) N (TinyL B0)) = go5 a b c d e
104
fixup2' (BigR (RX (B5 a b c d e) (B0)) N (TinyL B0)) = go5 a b c d e
104
false
false
0
10
55
62
30
32
null
null
copton/bitcoin-script-tools
src/Language/Bitcoin/Main.hs
gpl-3.0
fileIn :: String -> IO (Handle, String) fileIn name | name == "-" = return (stdin, "<<stdin>>") | otherwise = do handle <- openFile name ReadMode return (handle, name)
179
fileIn :: String -> IO (Handle, String) fileIn name | name == "-" = return (stdin, "<<stdin>>") | otherwise = do handle <- openFile name ReadMode return (handle, name)
179
fileIn name | name == "-" = return (stdin, "<<stdin>>") | otherwise = do handle <- openFile name ReadMode return (handle, name)
139
false
true
1
9
40
78
38
40
null
null
ocramz/petsc-hs
examples/Test2.hs
gpl-3.0
taoSetObjectiveAndGradientRoutine t f = taoSetObjectiveAndGradientRoutine' t f' where f' ta v r v2 _ = f ta v r v2 -- PETSC_EXTERN PetscErrorCode TaoSetHessianRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
240
taoSetObjectiveAndGradientRoutine t f = taoSetObjectiveAndGradientRoutine' t f' where f' ta v r v2 _ = f ta v r v2 -- PETSC_EXTERN PetscErrorCode TaoSetHessianRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
240
taoSetObjectiveAndGradientRoutine t f = taoSetObjectiveAndGradientRoutine' t f' where f' ta v r v2 _ = f ta v r v2 -- PETSC_EXTERN PetscErrorCode TaoSetHessianRoutine(Tao,Mat,Mat,PetscErrorCode(*)(Tao,Vec, Mat, Mat, void*), void*);
240
false
false
0
7
36
44
21
23
null
null
kim/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeVolumeStatus.hs
mpl-2.0
-- | The token to use to retrieve the next page of results. This value is 'null' -- when there are no more results to return. dvsrNextToken :: Lens' DescribeVolumeStatusResponse (Maybe Text) dvsrNextToken = lens _dvsrNextToken (\s a -> s { _dvsrNextToken = a })
261
dvsrNextToken :: Lens' DescribeVolumeStatusResponse (Maybe Text) dvsrNextToken = lens _dvsrNextToken (\s a -> s { _dvsrNextToken = a })
135
dvsrNextToken = lens _dvsrNextToken (\s a -> s { _dvsrNextToken = a })
70
true
true
0
9
44
47
26
21
null
null
ulricha/dsh
src/Database/DSH/Compiler.hs
bsd-3-clause
typeCheckSL :: String -> AlgebraDag TSL -> IO () typeCheckSL flavor dag = case inferSLTypes dag of Left msg -> putStrLn $ printf "Type inference failed for %s SL plan\n%s" flavor msg Right _ -> putStrLn $ printf "Type inference succesful for %s SL plan" flavor -- | Show unoptimized vector plan (SL...
321
typeCheckSL :: String -> AlgebraDag TSL -> IO () typeCheckSL flavor dag = case inferSLTypes dag of Left msg -> putStrLn $ printf "Type inference failed for %s SL plan\n%s" flavor msg Right _ -> putStrLn $ printf "Type inference succesful for %s SL plan" flavor -- | Show unoptimized vector plan (SL...
321
typeCheckSL flavor dag = case inferSLTypes dag of Left msg -> putStrLn $ printf "Type inference failed for %s SL plan\n%s" flavor msg Right _ -> putStrLn $ printf "Type inference succesful for %s SL plan" flavor -- | Show unoptimized vector plan (SL)
272
false
true
0
9
74
78
36
42
null
null
sashabu/libcspm
src/CSPM/Evaluator/Environment.hs
bsd-3-clause
maybeLookup :: Environment -> Name -> Maybe Value maybeLookup (Environment env) n = let nv = nameUnique n lookupInLayers [] = Nothing lookupInLayers (m:ms) = case M.lookup nv m of Just v -> Just v Nothing -> lookupInLayers ms in lookupInLayer...
325
maybeLookup :: Environment -> Name -> Maybe Value maybeLookup (Environment env) n = let nv = nameUnique n lookupInLayers [] = Nothing lookupInLayers (m:ms) = case M.lookup nv m of Just v -> Just v Nothing -> lookupInLayers ms in lookupInLayer...
325
maybeLookup (Environment env) n = let nv = nameUnique n lookupInLayers [] = Nothing lookupInLayers (m:ms) = case M.lookup nv m of Just v -> Just v Nothing -> lookupInLayers ms in lookupInLayers env
275
false
true
0
12
119
112
51
61
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/ExtensionPredicates.hs
bsd-3-clause
-- | Is the <https://www.opengl.org/registry/specs/ARB/texture_cube_map.txt EXT_texture_cube_map> extension supported? glGetEXTTextureCubeMap :: MonadIO m => m Bool glGetEXTTextureCubeMap = getExtensions >>= (return . member "GL_EXT_texture_cube_map")
251
glGetEXTTextureCubeMap :: MonadIO m => m Bool glGetEXTTextureCubeMap = getExtensions >>= (return . member "GL_EXT_texture_cube_map")
132
glGetEXTTextureCubeMap = getExtensions >>= (return . member "GL_EXT_texture_cube_map")
86
true
true
0
8
22
36
18
18
null
null
julienschmaltz/madl
src/Madl/MsgTypes.hs
mit
-- | Get the number of keys from a colorset. colorSetKeySize :: ColorSet -> Int colorSetKeySize = length . colorSetKeys
119
colorSetKeySize :: ColorSet -> Int colorSetKeySize = length . colorSetKeys
74
colorSetKeySize = length . colorSetKeys
39
true
true
0
5
19
20
11
9
null
null
jberryman/wai
wai-extra/Network/Wai/Middleware/ForceSSL.hs
mit
-- | For requests that don't appear secure, redirect to https -- -- Since 3.0.7 forceSSL :: Middleware forceSSL app req sendResponse = case (appearsSecure req, redirectResponse req) of (False, Just resp) -> sendResponse resp _ -> app req sendResponse
287
forceSSL :: Middleware forceSSL app req sendResponse = case (appearsSecure req, redirectResponse req) of (False, Just resp) -> sendResponse resp _ -> app req sendResponse
207
forceSSL app req sendResponse = case (appearsSecure req, redirectResponse req) of (False, Just resp) -> sendResponse resp _ -> app req sendResponse
184
true
true
0
9
76
66
34
32
null
null
DavidAlphaFox/darcs
src/Darcs/Util/Diff/Patience.hs
gpl-2.0
lcs :: Ord a => [a] -> [a] -> [a] lcs [] _ = []
47
lcs :: Ord a => [a] -> [a] -> [a] lcs [] _ = []
47
lcs [] _ = []
13
false
true
0
10
14
50
24
26
null
null
agocorona/MFlow
src/MFlow/Forms.hs
bsd-3-clause
encryptedLogout = logout' setEncryptedCookie
44
encryptedLogout = logout' setEncryptedCookie
44
encryptedLogout = logout' setEncryptedCookie
44
false
false
0
5
3
9
4
5
null
null
mrakgr/futhark
src/Futhark/Analysis/HORepresentation/SOAC.hs
bsd-3-clause
width (Scan _ w _ _) = w
24
width (Scan _ w _ _) = w
24
width (Scan _ w _ _) = w
24
false
false
0
6
7
22
10
12
null
null
brendanhay/gogol
gogol-remotebuildexecution/gen/Network/Google/RemoteBuildExecution/Types/Product.hs
mpl-2.0
-- | A list of keys for node properties the client expects to retrieve for -- output files and directories. Keys are either names of string-based -- NodeProperty or names of fields in NodeProperties. In order to ensure -- that equivalent \`Action\`s always hash to the same value, the node -- properties MUST be lexicogr...
822
bbrevcOutputNodeProperties :: Lens' BuildBazelRemoteExecutionV2Command [Text] bbrevcOutputNodeProperties = lens _bbrevcOutputNodeProperties (\ s a -> s{_bbrevcOutputNodeProperties = a}) . _Default . _Coerce
226
bbrevcOutputNodeProperties = lens _bbrevcOutputNodeProperties (\ s a -> s{_bbrevcOutputNodeProperties = a}) . _Default . _Coerce
148
true
true
0
11
136
61
36
25
null
null
nevrenato/Hets_Fork
THF/HasCASL2THF0Buildins.hs
gpl-2.0
implFS :: Constant -> String implFS c = let ns = (show . pretty . mkDefName) c cs = (show . pretty) c in encTHF (ns ++ defnS ++ cs ++ " = (^ [X : $o, Y : $o] : (X => Y))")
187
implFS :: Constant -> String implFS c = let ns = (show . pretty . mkDefName) c cs = (show . pretty) c in encTHF (ns ++ defnS ++ cs ++ " = (^ [X : $o, Y : $o] : (X => Y))")
187
implFS c = let ns = (show . pretty . mkDefName) c cs = (show . pretty) c in encTHF (ns ++ defnS ++ cs ++ " = (^ [X : $o, Y : $o] : (X => Y))")
158
false
true
0
12
59
76
38
38
null
null
wiggly/workshop
app/Mapper.hs
bsd-3-clause
main :: IO () main = do let m = M.empty :: MyMap m' = M.put m "Iron Man" 1900 m'' = M.put m' "Spider-Man" 1250 m''' = M.put m'' "Elephant Man" 1150 m'''' = M.put m''' "Spider-Man" 1850 m''''' = M.delete m'''' "Spider-Man" m'''''' = M.clear m''''' putStrLn "Mapper" putStrLn $ "m...
549
main :: IO () main = do let m = M.empty :: MyMap m' = M.put m "Iron Man" 1900 m'' = M.put m' "Spider-Man" 1250 m''' = M.put m'' "Elephant Man" 1150 m'''' = M.put m''' "Spider-Man" 1850 m''''' = M.delete m'''' "Spider-Man" m'''''' = M.clear m''''' putStrLn "Mapper" putStrLn $ "m...
549
main = do let m = M.empty :: MyMap m' = M.put m "Iron Man" 1900 m'' = M.put m' "Spider-Man" 1250 m''' = M.put m'' "Elephant Man" 1150 m'''' = M.put m''' "Spider-Man" 1850 m''''' = M.delete m'''' "Spider-Man" m'''''' = M.clear m''''' putStrLn "Mapper" putStrLn $ "m" showMap m ...
535
false
true
0
11
152
205
91
114
null
null
shlevy/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
90
typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
90
typeRepTyConName = tcQual tYPEABLE_INTERNAL (fsLit "TypeRep") typeRepTyConKey
90
false
false
0
7
19
19
9
10
null
null