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
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
bsd-3-clause
-- * V1APIVersions -- | 'v1APIVersionsApiVersion' Lens v1APIVersionsApiVersionL :: Lens_' V1APIVersions (Maybe Text) v1APIVersionsApiVersionL f V1APIVersions{..} = (\v1APIVersionsApiVersion -> V1APIVersions { v1APIVersionsApiVersion, ..} ) <$> f v1APIVersionsApiVersion
270
v1APIVersionsApiVersionL :: Lens_' V1APIVersions (Maybe Text) v1APIVersionsApiVersionL f V1APIVersions{..} = (\v1APIVersionsApiVersion -> V1APIVersions { v1APIVersionsApiVersion, ..} ) <$> f v1APIVersionsApiVersion
214
v1APIVersionsApiVersionL f V1APIVersions{..} = (\v1APIVersionsApiVersion -> V1APIVersions { v1APIVersionsApiVersion, ..} ) <$> f v1APIVersionsApiVersion
152
true
true
1
8
27
62
31
31
null
null
raposalorx/mssbot
Text.hs
bsd-3-clause
unescapeEntities ('&':xs) = let (b, a) = break (== ';') xs in case (lookupEntity b, a) of (Just c, ';':as) -> c ++ unescapeEntities as _ -> '&' : unescapeEntities xs
199
unescapeEntities ('&':xs) = let (b, a) = break (== ';') xs in case (lookupEntity b, a) of (Just c, ';':as) -> c ++ unescapeEntities as _ -> '&' : unescapeEntities xs
199
unescapeEntities ('&':xs) = let (b, a) = break (== ';') xs in case (lookupEntity b, a) of (Just c, ';':as) -> c ++ unescapeEntities as _ -> '&' : unescapeEntities xs
199
false
false
2
10
64
96
48
48
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
wconfdDefCtmo :: Int wconfdDefCtmo = 10
39
wconfdDefCtmo :: Int wconfdDefCtmo = 10
39
wconfdDefCtmo = 10
18
false
true
0
6
5
18
7
11
null
null
markmandel/cis194
src/week1/homework/HW01Tests.hs
apache-2.0
-- hanoi == -- All Tests ------------------------------------------ allTests :: [Test] allTests = concat [ ex1Tests , ex2Tests , ex3Tests , ex4Tests , ex5Tests , ex6Tests ]
283
allTests :: [Test] allTests = concat [ ex1Tests , ex2Tests , ex3Tests , ex4Tests , ex5Tests , ex6Tests ]
212
allTests = concat [ ex1Tests , ex2Tests , ex3Tests , ex4Tests , ex5Tests , ex6Tests ]
193
true
true
0
7
136
43
24
19
null
null
sof/json
Text/JSON/Parsec.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- XXX: Because Parsec is not Applicative yet... pure :: a -> CharParser () a pure = return
178
pure :: a -> CharParser () a pure = return
47
pure = return
16
true
true
0
8
24
30
14
16
null
null
rfranek/duckling
Duckling/AmountOfMoney/RO/Rules.hs
bsd-3-clause
ruleRiyals :: Rule ruleRiyals = Rule { name = "riyals" , pattern = [ regex "rial (saudit?|qatarian?)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of "saudi" -> Just . Token AmountOfMoney $ currencyOnly SAR "saudit" ...
562
ruleRiyals :: Rule ruleRiyals = Rule { name = "riyals" , pattern = [ regex "rial (saudit?|qatarian?)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of "saudi" -> Just . Token AmountOfMoney $ currencyOnly SAR "saudit" ...
562
ruleRiyals = Rule { name = "riyals" , pattern = [ regex "rial (saudit?|qatarian?)" ] , prod = \tokens -> case tokens of (Token RegexMatch (GroupMatch (match:_)):_) -> case Text.toLower match of "saudi" -> Just . Token AmountOfMoney $ currencyOnly SAR "saudit" -> Just . Token A...
543
false
true
0
18
165
182
90
92
null
null
ardumont/haskell-lab
src/FunSet.hs
gpl-2.0
set (x:xs) = add (set xs) x
27
set (x:xs) = add (set xs) x
27
set (x:xs) = add (set xs) x
27
false
false
0
7
6
28
13
15
null
null
expipiplus1/minizinc
src/Language/MiniZinc/Print.hs
mit
itemDoc (ASolve s) = solveDoc s
31
itemDoc (ASolve s) = solveDoc s
31
itemDoc (ASolve s) = solveDoc s
31
false
false
0
6
5
19
8
11
null
null
rueshyna/gogol
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
mpl-2.0
-- | Creates a value of 'Table' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'tRows' -- -- * 'tName' -- -- * 'tColumnHeaders' -- -- * 'tRowHeaders' table :: Table table = Table' { _tRows = Nothing , _tName = Nothing ...
386
table :: Table table = Table' { _tRows = Nothing , _tName = Nothing , _tColumnHeaders = Nothing , _tRowHeaders = Nothing }
150
table = Table' { _tRows = Nothing , _tName = Nothing , _tColumnHeaders = Nothing , _tRowHeaders = Nothing }
131
true
true
0
7
96
58
36
22
null
null
gcampax/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
68
foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
68
foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
68
false
false
0
7
19
19
9
10
null
null
AmpersandTarski/ampersand
src/Ampersand/ADL1/Lattices.hs
gpl-3.0
translateWith :: (Ord a, SetLike x) => EqualitySystem a -> x a -> (EqualitySystem a, IntSet.IntSet) translateWith ~(ES nomenclature imap) inSet = ( ES newNomenclature imap , IntSet.fromList$ map (newNomenclature Map.!) (toList inSet) ) where newNomenclature = foldr (\x y -> if Map.member x y then y else Ma...
374
translateWith :: (Ord a, SetLike x) => EqualitySystem a -> x a -> (EqualitySystem a, IntSet.IntSet) translateWith ~(ES nomenclature imap) inSet = ( ES newNomenclature imap , IntSet.fromList$ map (newNomenclature Map.!) (toList inSet) ) where newNomenclature = foldr (\x y -> if Map.member x y then y else Ma...
374
translateWith ~(ES nomenclature imap) inSet = ( ES newNomenclature imap , IntSet.fromList$ map (newNomenclature Map.!) (toList inSet) ) where newNomenclature = foldr (\x y -> if Map.member x y then y else Map.insert x (Map.size y) y) nomenclature (toList inSet)
274
false
true
0
12
68
162
82
80
null
null
sergv/vector
Data/Vector/Fusion/Bundle/Monadic.hs
bsd-3-clause
enumFromTo_intlike x y = x `seq` y `seq` fromStream (Stream step x) (Exact (len x y)) where {-# INLINE [0] len #-} len u v | u > v = 0 | otherwise = BOUNDS_CHECK(check) "enumFromTo" "vector too large" (n > 0) $ fromIntegral n where ...
451
enumFromTo_intlike x y = x `seq` y `seq` fromStream (Stream step x) (Exact (len x y)) where {-# INLINE [0] len #-} len u v | u > v = 0 | otherwise = BOUNDS_CHECK(check) "enumFromTo" "vector too large" (n > 0) $ fromIntegral n where ...
451
enumFromTo_intlike x y = x `seq` y `seq` fromStream (Stream step x) (Exact (len x y)) where {-# INLINE [0] len #-} len u v | u > v = 0 | otherwise = BOUNDS_CHECK(check) "enumFromTo" "vector too large" (n > 0) $ fromIntegral n where ...
451
false
false
14
9
185
193
87
106
null
null
Concelo/concelo
src/Database/Concelo/Subscriber.hs
bsd-3-clause
nextMessage :: Co.Action Subscriber (Maybe Pr.Message) nextMessage = do missing <- ((const () <$>) . BT.reverseTrie <$> get subscriberMissing) return $ if T.isEmpty missing then Nothing else Just $ Pr.Nack missing
255
nextMessage :: Co.Action Subscriber (Maybe Pr.Message) nextMessage = do missing <- ((const () <$>) . BT.reverseTrie <$> get subscriberMissing) return $ if T.isEmpty missing then Nothing else Just $ Pr.Nack missing
255
nextMessage = do missing <- ((const () <$>) . BT.reverseTrie <$> get subscriberMissing) return $ if T.isEmpty missing then Nothing else Just $ Pr.Nack missing
200
false
true
0
13
72
87
43
44
null
null
fmapfmapfmap/amazonka
gen/src/Gen/Types/Id.hs
mpl-2.0
replaceId :: Id -> Id -> Id replaceId x y = x & representation .~ y ^. representation
85
replaceId :: Id -> Id -> Id replaceId x y = x & representation .~ y ^. representation
85
replaceId x y = x & representation .~ y ^. representation
57
false
true
0
7
17
36
18
18
null
null
psibi/persistent
persistent-test/test/main.hs
mit
main :: IO () main = do #ifndef WITH_NOSQL # ifdef WITH_SQLITE handle (\(_ :: IOException) -> return ()) $ removeFile $ fromText sqlite_database_file # endif runConn $ do mapM_ setup [ PersistentTest.testMigrate , PersistentTest.noPrefixMigrate , EmbedTest.embedMigrate , EmbedOrde...
1,655
main :: IO () main = do #ifndef WITH_NOSQL # ifdef WITH_SQLITE handle (\(_ :: IOException) -> return ()) $ removeFile $ fromText sqlite_database_file # endif runConn $ do mapM_ setup [ PersistentTest.testMigrate , PersistentTest.noPrefixMigrate , EmbedTest.embedMigrate , EmbedOrde...
1,655
main = do #ifndef WITH_NOSQL # ifdef WITH_SQLITE handle (\(_ :: IOException) -> return ()) $ removeFile $ fromText sqlite_database_file # endif runConn $ do mapM_ setup [ PersistentTest.testMigrate , PersistentTest.noPrefixMigrate , EmbedTest.embedMigrate , EmbedOrderTest.embedOrd...
1,641
false
true
0
13
346
294
149
145
null
null
badp/ganeti
src/Ganeti/HTools/Program/Hsqueeze.hs
gpl-2.0
-- | Online a list of nodes, and return the state after balancing with -- the sequence of moves that lead there. onlineNodes :: [Ndx] -> (Node.List, Instance.List) -> ((Node.List, Instance.List), [MoveJob]) onlineNodes = onlineOfflineNodes False
260
onlineNodes :: [Ndx] -> (Node.List, Instance.List) -> ((Node.List, Instance.List), [MoveJob]) onlineNodes = onlineOfflineNodes False
147
onlineNodes = onlineOfflineNodes False
38
true
true
0
9
50
56
33
23
null
null
circuithub/mandrill
test/Online.hs
mit
testOnlineRouteAdd :: MandrillKey -> Assertion testOnlineRouteAdd k = do res <- API.addRoute k "foobar.com" "mail-*" "http://requestb.in/19a4frw1" Nothing case res of MandrillSuccess a -> print a MandrillFailure e -> fail $ "inbound/add-domain.json " ++ show e
271
testOnlineRouteAdd :: MandrillKey -> Assertion testOnlineRouteAdd k = do res <- API.addRoute k "foobar.com" "mail-*" "http://requestb.in/19a4frw1" Nothing case res of MandrillSuccess a -> print a MandrillFailure e -> fail $ "inbound/add-domain.json " ++ show e
271
testOnlineRouteAdd k = do res <- API.addRoute k "foobar.com" "mail-*" "http://requestb.in/19a4frw1" Nothing case res of MandrillSuccess a -> print a MandrillFailure e -> fail $ "inbound/add-domain.json " ++ show e
224
false
true
0
11
45
77
35
42
null
null
christiaanb/ghc
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- 'trivial*Code': deal with trivial instructions -- Trivial (dyadic: 'trivialCode', floating-point: 'trivialFCode', -- unary: 'trivialUCode', unary fl-pt:'trivialUFCode') instructions. -- Only look for constants on the right hand side, b...
2,052
trivialCode :: Width -> Bool -> (Reg -> Reg -> RI -> Instr) -> CmmExpr -> CmmExpr -> NatM Register trivialCode rep signed instr x (CmmLit (CmmInt y _)) | Just imm <- makeImmediate rep signed y = do (src1, code1) <- getSomeReg x let code dst = code1...
396
trivialCode rep signed instr x (CmmLit (CmmInt y _)) | Just imm <- makeImmediate rep signed y = do (src1, code1) <- getSomeReg x let code dst = code1 `snocOL` instr dst src1 (RIImm imm) return (Any (intSize rep) code)
249
true
true
0
15
424
176
88
88
null
null
peter-fogg/pardoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
optionLine :: OrgParser () optionLine = try $ do key <- metaKey case key of "link" -> parseLinkFormat >>= uncurry addLinkFormat _ -> mzero
155
optionLine :: OrgParser () optionLine = try $ do key <- metaKey case key of "link" -> parseLinkFormat >>= uncurry addLinkFormat _ -> mzero
155
optionLine = try $ do key <- metaKey case key of "link" -> parseLinkFormat >>= uncurry addLinkFormat _ -> mzero
128
false
true
0
12
40
53
25
28
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp ISraOp = _ILIT(35)
31
tagOf_PrimOp ISraOp = _ILIT(35)
31
tagOf_PrimOp ISraOp = _ILIT(35)
31
false
false
0
6
3
15
7
8
null
null
adamse/haddock
haddock-api/src/Haddock/Interface/Rename.hs
bsd-2-clause
renameL :: Located Name -> RnM (Located DocName) renameL = mapM rename
70
renameL :: Located Name -> RnM (Located DocName) renameL = mapM rename
70
renameL = mapM rename
21
false
true
0
8
11
30
14
16
null
null
ekmett/multipass
Data/Pass/Robust.hs
bsd-3-clause
quartile :: (Robust l, Fractional a, Ord a) => Rational -> l a a quartile n = quantile (n/4)
92
quartile :: (Robust l, Fractional a, Ord a) => Rational -> l a a quartile n = quantile (n/4)
92
quartile n = quantile (n/4)
27
false
true
0
7
18
54
27
27
null
null
philipturnbull/quenelle
src/Quenelle/Rule.hs
gpl-2.0
pArgVarArgsPosExpr _ _ = False
31
pArgVarArgsPosExpr _ _ = False
31
pArgVarArgsPosExpr _ _ = False
31
false
false
0
5
5
11
5
6
null
null
hferreiro/replay
testsuite/tests/codeGen/should_run/cgrun065.hs
bsd-3-clause
main = putStr (test_sizeofArray ++ "\n" ++ test_sizeofMutableArray ++ "\n" )
106
main = putStr (test_sizeofArray ++ "\n" ++ test_sizeofMutableArray ++ "\n" )
106
main = putStr (test_sizeofArray ++ "\n" ++ test_sizeofMutableArray ++ "\n" )
106
false
false
0
9
40
24
12
12
null
null
vTurbine/ghc
compiler/nativeGen/AsmCodeGen.hs
bsd-3-clause
sequenceBlocks infos (entry:blocks) = seqBlocks infos (mkNode entry : reverse (flattenSCCs (sccBlocks blocks)))
113
sequenceBlocks infos (entry:blocks) = seqBlocks infos (mkNode entry : reverse (flattenSCCs (sccBlocks blocks)))
113
sequenceBlocks infos (entry:blocks) = seqBlocks infos (mkNode entry : reverse (flattenSCCs (sccBlocks blocks)))
113
false
false
0
12
14
48
23
25
null
null
brendanhay/gogol
gogol-replicapool/gen/Network/Google/ReplicaPool/Types/Product.hs
mpl-2.0
-- | The name of the replica pool. Must follow the regex -- [a-z]([-a-z0-9]*[a-z0-9])? and be 1-28 characters long. pName :: Lens' Pool (Maybe Text) pName = lens _pName (\ s a -> s{_pName = a})
193
pName :: Lens' Pool (Maybe Text) pName = lens _pName (\ s a -> s{_pName = a})
77
pName = lens _pName (\ s a -> s{_pName = a})
44
true
true
0
9
35
47
26
21
null
null
arekfu/project_euler
p0025/p0025.hs
mit
= 1.0 - phi :: Double
21
= 1.0 - phi :: Double
21
= 1.0 - phi :: Double
21
false
false
2
5
5
17
6
11
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
4002 = 4001
11
4002 = 4001
11
4002 = 4001
11
false
false
1
5
2
10
3
7
null
null
AlexanderPankiv/ghc
ghc/Main.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- Parsing the mode flag parseModeFlags :: [Located String] -> IO (Mode, [Located String], [Located String]) parseModeFlags args = do let ((leftover, errs1, warns), (mModeFlag, ...
780
parseModeFlags :: [Located String] -> IO (Mode, [Located String], [Located String]) parseModeFlags args = do let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) = runCmdLine (processArgs mode_flags args) (Nothing, [], [])...
673
parseModeFlags args = do let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) = runCmdLine (processArgs mode_flags args) (Nothing, [], []) mode = case mModeFlag of Nothing -> doMakeMode Just (m, _) -> m -- See Note [Handling errors when parsi...
530
true
true
0
16
229
219
115
104
null
null
aztek/voogie
src/Voogie/FOOL/Traverse.hs
gpl-3.0
traverseTerm :: Applicative f => (Term -> f Term) -> (Type -> f Type) -> Term -> f Term traverseTerm termF typeF = \case Variable v -> Variable <$> typedF v Constant i -> Constant <$> typedF i Application f ts -> Application <$> typedF f <*> traverse ter...
987
traverseTerm :: Applicative f => (Term -> f Term) -> (Type -> f Type) -> Term -> f Term traverseTerm termF typeF = \case Variable v -> Variable <$> typedF v Constant i -> Constant <$> typedF i Application f ts -> Application <$> typedF f <*> traverse ter...
987
traverseTerm termF typeF = \case Variable v -> Variable <$> typedF v Constant i -> Constant <$> typedF i Application f ts -> Application <$> typedF f <*> traverse termF ts Binary op f g -> Binary op <$> termF f <*> termF g Unary op f -> Unary op <$> termF f Quantify q v...
860
false
true
34
10
358
138
94
44
null
null
skill-lang/skill
deps/haskell/Deserialize.hs
bsd-3-clause
g'tDs_v1 :: [UserType] -> [String] -> [TD_v2] -> Int -> Get ([TD_v1], [String]) g'tDs_v1 _ _ _ 0 = return ([],[])
113
g'tDs_v1 :: [UserType] -> [String] -> [TD_v2] -> Int -> Get ([TD_v1], [String]) g'tDs_v1 _ _ _ 0 = return ([],[])
113
g'tDs_v1 _ _ _ 0 = return ([],[])
33
false
true
0
12
20
77
41
36
null
null
olorin/amazonka
amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/SwapEnvironmentCNAMEs.hs
mpl-2.0
-- | The name of the destination environment. -- -- Condition: You must specify at least the 'DestinationEnvironmentID' or -- the 'DestinationEnvironmentName'. You may also specify both. You must -- specify the 'SourceEnvironmentName' with the -- 'DestinationEnvironmentName'. secnameDestinationEnvironmentName :: Lens' ...
483
secnameDestinationEnvironmentName :: Lens' SwapEnvironmentCNAMEs (Maybe Text) secnameDestinationEnvironmentName = lens _secnameDestinationEnvironmentName (\ s a -> s{_secnameDestinationEnvironmentName = a})
206
secnameDestinationEnvironmentName = lens _secnameDestinationEnvironmentName (\ s a -> s{_secnameDestinationEnvironmentName = a})
128
true
true
0
9
53
51
30
21
null
null
quantumman/Panpipes
Control/Proxy/Network.hs
bsd-3-clause
toTcpD :: Proxy p => Socket -> () -> Consumer (ExceptionP p) Strict.ByteString SafeIO () toTcpD sock () = forever $ do bs <- request () tryIO $ sendAll sock bs
184
toTcpD :: Proxy p => Socket -> () -> Consumer (ExceptionP p) Strict.ByteString SafeIO () toTcpD sock () = forever $ do bs <- request () tryIO $ sendAll sock bs
184
toTcpD sock () = forever $ do bs <- request () tryIO $ sendAll sock bs
74
false
true
2
11
55
88
39
49
null
null
sordina/businesscardposter
src/Main.hs
mit
tblue = blue `withOpacity` 0.8
34
tblue = blue `withOpacity` 0.8
34
tblue = blue `withOpacity` 0.8
34
false
false
0
5
8
12
7
5
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Parse.hs
bsd-3-clause
bbindP = lowerIdP <* dcolon
31
bbindP = lowerIdP <* dcolon
31
bbindP = lowerIdP <* dcolon
31
false
false
0
5
8
10
5
5
null
null
jtdaugherty/mathblog
src/Main.hs
bsd-3-clause
isEventInteresting :: BlogInputFS -> Event -> Bool isEventInteresting ifs ev = let fp = case ev of Added f _ -> f Modified f _ -> f Removed f _ -> f isPost f = (ifsPostSourceDir ifs) `isPrefixOf` f && ".txt" `isSuffixOf` f && ...
878
isEventInteresting :: BlogInputFS -> Event -> Bool isEventInteresting ifs ev = let fp = case ev of Added f _ -> f Modified f _ -> f Removed f _ -> f isPost f = (ifsPostSourceDir ifs) `isPrefixOf` f && ".txt" `isSuffixOf` f && ...
878
isEventInteresting ifs ev = let fp = case ev of Added f _ -> f Modified f _ -> f Removed f _ -> f isPost f = (ifsPostSourceDir ifs) `isPrefixOf` f && ".txt" `isSuffixOf` f && not ("." `isPrefixOf` takeFileName f) is...
827
false
true
0
15
368
270
143
127
null
null
capn-freako/lambda-ccc
src/LambdaCCC/Unused/CoerceEncode.hs
bsd-3-clause
castTo :: Type -> CoreExpr -> CoreExpr castTo ty e = mkCast e (mkUnsafeCo (exprType e) ty)
90
castTo :: Type -> CoreExpr -> CoreExpr castTo ty e = mkCast e (mkUnsafeCo (exprType e) ty)
90
castTo ty e = mkCast e (mkUnsafeCo (exprType e) ty)
51
false
true
0
9
16
50
22
28
null
null
julianalucena/mancala
Board.hs
lgpl-3.0
capture :: Hole -> Board -> Board capture (player, pos) b = holes2board (getOtherPlayer player) holesCapturedSeeds where holesCapturedSeeds = updateHole mancalaPos newMancalaSeeds holesRemovedSeeds newMancalaSeeds = (holesRemovedSeeds !! mancalaPos) + opositeSeeds mancalaPos = length holesRemovedSeeds...
583
capture :: Hole -> Board -> Board capture (player, pos) b = holes2board (getOtherPlayer player) holesCapturedSeeds where holesCapturedSeeds = updateHole mancalaPos newMancalaSeeds holesRemovedSeeds newMancalaSeeds = (holesRemovedSeeds !! mancalaPos) + opositeSeeds mancalaPos = length holesRemovedSeeds...
583
capture (player, pos) b = holes2board (getOtherPlayer player) holesCapturedSeeds where holesCapturedSeeds = updateHole mancalaPos newMancalaSeeds holesRemovedSeeds newMancalaSeeds = (holesRemovedSeeds !! mancalaPos) + opositeSeeds mancalaPos = length holesRemovedSeeds - 1 holesRemovedSeeds = u...
549
false
true
6
13
112
155
76
79
null
null
beni55/attoparsec
tests/QC/IPv6/Internal.hs
bsd-3-clause
maybeTokPureIPv6Addr :: T.Text -> Maybe [IPv6AddrToken] maybeTokPureIPv6Addr t = do ltks <- maybeIPv6AddrTokens t if isIPv6Addr ltks then Just $ (toDoubleColon . ipv4AddrReplacement . fromDoubleColon) ltks else Nothing where ipv4AddrReplacement ltks' = init ltks' ++ ipv4AddrToIPv6AddrToken...
413
maybeTokPureIPv6Addr :: T.Text -> Maybe [IPv6AddrToken] maybeTokPureIPv6Addr t = do ltks <- maybeIPv6AddrTokens t if isIPv6Addr ltks then Just $ (toDoubleColon . ipv4AddrReplacement . fromDoubleColon) ltks else Nothing where ipv4AddrReplacement ltks' = init ltks' ++ ipv4AddrToIPv6AddrToken...
413
maybeTokPureIPv6Addr t = do ltks <- maybeIPv6AddrTokens t if isIPv6Addr ltks then Just $ (toDoubleColon . ipv4AddrReplacement . fromDoubleColon) ltks else Nothing where ipv4AddrReplacement ltks' = init ltks' ++ ipv4AddrToIPv6AddrTokens (last ltks') -- | Tokenize a 'T.Text' into 'Just' a l...
357
false
true
0
12
81
96
46
50
null
null
tpsinnem/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
-- | Introduce a 'Bind' into the given term for each element of the -- given list of (name, binder) pairs. bindAll :: [(n, Binder (TT n))] -> TT n -> TT n bindAll [] t = t
171
bindAll :: [(n, Binder (TT n))] -> TT n -> TT n bindAll [] t = t
64
bindAll [] t = t
16
true
true
3
9
37
53
26
27
null
null
leshchevds/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
ssHypervisorList :: String ssHypervisorList = "hypervisor_list"
63
ssHypervisorList :: String ssHypervisorList = "hypervisor_list"
63
ssHypervisorList = "hypervisor_list"
36
false
true
0
4
5
11
6
5
null
null
ezyang/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
{- ********************************************************************* * * The sum types * * ************************************************************************ -}...
452
mkSumTy :: [Type] -> Type mkSumTy tys = mkTyConApp (sumTyCon (length tys)) (map getRuntimeRep tys ++ tys)
130
mkSumTy tys = mkTyConApp (sumTyCon (length tys)) (map getRuntimeRep tys ++ tys)
104
true
true
0
9
203
51
26
25
null
null
Helkafen/cabal
Cabal/tests/PackageTests/TestSuiteExeV10/Check.hs
bsd-3-clause
checkTest :: FilePath -> Assertion checkTest ghcPath = buildAndTest ghcPath "Default" [] []
91
checkTest :: FilePath -> Assertion checkTest ghcPath = buildAndTest ghcPath "Default" [] []
91
checkTest ghcPath = buildAndTest ghcPath "Default" [] []
56
false
true
0
7
12
36
16
20
null
null
ShivanKaul/gitmail
github/src/GitMail/Csrf.hs
mit
-- | Determines whether the given state token is present in the cache. peekToken :: R.RedisCtx m f => CsrfToken -> m (f Bool) peekToken = R.exists . (tokenKeyPrefix `BS.append`) . unCsrfToken
191
peekToken :: R.RedisCtx m f => CsrfToken -> m (f Bool) peekToken = R.exists . (tokenKeyPrefix `BS.append`) . unCsrfToken
120
peekToken = R.exists . (tokenKeyPrefix `BS.append`) . unCsrfToken
65
true
true
0
9
31
54
29
25
null
null
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/Internal/SqlValue.hs
mit
{- | Attempts to decode a 'SqlValue' as a Haskell 'Int' value. If decoding fails 'Nothing' is returned. -} toInt64 :: SqlValue -> Either String Int64 toInt64 = toParsedValue (AttoB8.signed AttoB8.decimal)
210
toInt64 :: SqlValue -> Either String Int64 toInt64 = toParsedValue (AttoB8.signed AttoB8.decimal)
99
toInt64 = toParsedValue (AttoB8.signed AttoB8.decimal)
56
true
true
0
8
36
40
18
22
null
null
plietar/super-user-spark
src/Compiler.hs
mit
inputCompiled :: FilePath -> Sparker [Deployment] inputCompiled fp = do form <- asks conf_compile_format case form of FormatBinary -> do content <- liftIO $ BS.readFile fp case decodeOrFail $ decompress content of Left (_,_,err) -> throwError $ CompileError $ "...
966
inputCompiled :: FilePath -> Sparker [Deployment] inputCompiled fp = do form <- asks conf_compile_format case form of FormatBinary -> do content <- liftIO $ BS.readFile fp case decodeOrFail $ decompress content of Left (_,_,err) -> throwError $ CompileError $ "...
966
inputCompiled fp = do form <- asks conf_compile_format case form of FormatBinary -> do content <- liftIO $ BS.readFile fp case decodeOrFail $ decompress content of Left (_,_,err) -> throwError $ CompileError $ "Something went wrong while deserialising binary da...
916
false
true
0
17
320
243
113
130
null
null
seereason/ghcjs
src/Gen2/Prim.hs
mit
genPrim _ _ AtomicModifyMutVarOp [r] [m,f] = PrimInline [j| `r` = h$atomicModifyMutVar(`m`,`f`); |]
101
genPrim _ _ AtomicModifyMutVarOp [r] [m,f] = PrimInline [j| `r` = h$atomicModifyMutVar(`m`,`f`); |]
101
genPrim _ _ AtomicModifyMutVarOp [r] [m,f] = PrimInline [j| `r` = h$atomicModifyMutVar(`m`,`f`); |]
101
false
false
0
6
14
33
19
14
null
null
MnO2/hindley-milner
src/HM/HigherRank.hs
bsd-3-clause
checkSigma :: Term -> Sigma -> Tc () checkSigma expr sigma = do { (skol_tvs, rho) <- deepskol sigma ; checkRho expr rho ; env_tys <- getEnvTypes ; esc_tvs <- getFreeTyVars (sigma : env_tys) ; let bad_tvs = filter (`elem` esc_tvs) skol_tvs ; check (null bad_tvs) (text ...
352
checkSigma :: Term -> Sigma -> Tc () checkSigma expr sigma = do { (skol_tvs, rho) <- deepskol sigma ; checkRho expr rho ; env_tys <- getEnvTypes ; esc_tvs <- getFreeTyVars (sigma : env_tys) ; let bad_tvs = filter (`elem` esc_tvs) skol_tvs ; check (null bad_tvs) (text ...
352
checkSigma expr sigma = do { (skol_tvs, rho) <- deepskol sigma ; checkRho expr rho ; env_tys <- getEnvTypes ; esc_tvs <- getFreeTyVars (sigma : env_tys) ; let bad_tvs = filter (`elem` esc_tvs) skol_tvs ; check (null bad_tvs) (text "Type not polymorphic enough") }
315
false
true
0
12
103
129
64
65
null
null
fmapfmapfmap/amazonka
amazonka-cognito-identity/test/Test/AWS/Gen/CognitoIdentity.hs
mpl-2.0
testSetIdentityPoolRolesResponse :: SetIdentityPoolRolesResponse -> TestTree testSetIdentityPoolRolesResponse = res "SetIdentityPoolRolesResponse" "fixture/SetIdentityPoolRolesResponse.proto" cognitoIdentity (Proxy :: Proxy SetIdentityPoolRoles)
261
testSetIdentityPoolRolesResponse :: SetIdentityPoolRolesResponse -> TestTree testSetIdentityPoolRolesResponse = res "SetIdentityPoolRolesResponse" "fixture/SetIdentityPoolRolesResponse.proto" cognitoIdentity (Proxy :: Proxy SetIdentityPoolRoles)
261
testSetIdentityPoolRolesResponse = res "SetIdentityPoolRolesResponse" "fixture/SetIdentityPoolRolesResponse.proto" cognitoIdentity (Proxy :: Proxy SetIdentityPoolRoles)
184
false
true
0
7
30
33
17
16
null
null
Yuras/plist
src/Text/XML/Plist/Write.hs
bsd-3-clause
objectToXml (PlDict objects) = selem "dict" elems where elems = concatMap toXml objects toXml (key, val) = [selem "key" [txt key], objectToXml val]
151
objectToXml (PlDict objects) = selem "dict" elems where elems = concatMap toXml objects toXml (key, val) = [selem "key" [txt key], objectToXml val]
151
objectToXml (PlDict objects) = selem "dict" elems where elems = concatMap toXml objects toXml (key, val) = [selem "key" [txt key], objectToXml val]
151
false
false
0
10
26
66
33
33
null
null
cnc-patch/disass
src/Language/Assembly/X86/Parse.hs
bsd-3-clause
anyInt64 :: (Stream s m Word8, Monad m) => ParsecT s PState m Int64 anyInt64 = fromIntegral <$> anyWord64
105
anyInt64 :: (Stream s m Word8, Monad m) => ParsecT s PState m Int64 anyInt64 = fromIntegral <$> anyWord64
105
anyInt64 = fromIntegral <$> anyWord64
37
false
true
0
6
18
43
22
21
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/Events.hs
lgpl-2.1
-- | Get the current timer handler. windowGetOnTimer :: Window a -> IO (IO ()) windowGetOnTimer window = unsafeWindowGetHandlerState window wxEVT_TIMER (return ())
165
windowGetOnTimer :: Window a -> IO (IO ()) windowGetOnTimer window = unsafeWindowGetHandlerState window wxEVT_TIMER (return ())
129
windowGetOnTimer window = unsafeWindowGetHandlerState window wxEVT_TIMER (return ())
86
true
true
0
9
24
48
23
25
null
null
edsko/hackage-server
Distribution/Client/Mirror/Repo/Local.hs
bsd-3-clause
downloadIndex :: FilePath -> FilePath -> MirrorSession [PkgIndexInfo] downloadIndex root _cacheDir = do -- We don't know which version of the index this repo has. If there is a -- 00-index available then reading this is faster (fewer entries); but if -- there isn't, we check if the 01-index is available. ...
1,192
downloadIndex :: FilePath -> FilePath -> MirrorSession [PkgIndexInfo] downloadIndex root _cacheDir = do -- We don't know which version of the index this repo has. If there is a -- 00-index available then reading this is faster (fewer entries); but if -- there isn't, we check if the 01-index is available. ...
1,192
downloadIndex root _cacheDir = do -- We don't know which version of the index this repo has. If there is a -- 00-index available then reading this is faster (fewer entries); but if -- there isn't, we check if the 01-index is available. firstToSucceed $ map tryDownload [index00, index01] where tryD...
1,122
false
true
0
10
386
244
125
119
null
null
mikebenfield/hclaws
test/Tests/Math/Hclaws/Systems/Linear.hs
isc
unitTests :: TestTree unitTests = testGroup "Unit Tests" [ waveFanTestGroup solution1 L.system "solution 1" , waveFanTestGroup solution2 L.system "solution 2" ]
172
unitTests :: TestTree unitTests = testGroup "Unit Tests" [ waveFanTestGroup solution1 L.system "solution 1" , waveFanTestGroup solution2 L.system "solution 2" ]
172
unitTests = testGroup "Unit Tests" [ waveFanTestGroup solution1 L.system "solution 1" , waveFanTestGroup solution2 L.system "solution 2" ]
150
false
true
0
8
32
40
20
20
null
null
beni55/hdbc-postgresql
Database/HDBC/PostgreSQL/ErrorCodes.hs
bsd-3-clause
-- |Is set to @\"57P01\"@. adminShutdown :: String adminShutdown = "57P01"
74
adminShutdown :: String adminShutdown = "57P01"
47
adminShutdown = "57P01"
23
true
true
0
4
10
12
7
5
null
null
HJvT/GeBoP
Ataxx.hs
bsd-3-clause
taxx :: Ataxx ataxx = undefined
32
ataxx :: Ataxx ataxx = undefined
32
ataxx = undefined
17
false
true
0
6
6
17
7
10
null
null
geva995/murlyka
src/Utils/MakeContents.hs
gpl-3.0
rules_for_srcs::Info1->String rules_for_srcs i = Lists.intercalate "\n\n" . map ( \e-> "." ++ e ++ ".o:\n\t" ++ "$(CXX) -c $< -o $@ $(CXXFLAGS) " ++ incl ++ (if not . null $ b then "\n\t" ++ "mv $@ ./" ++ b else "") ) $ exts where exts = src_exts i incl = includes i b = build_d i
318
rules_for_srcs::Info1->String rules_for_srcs i = Lists.intercalate "\n\n" . map ( \e-> "." ++ e ++ ".o:\n\t" ++ "$(CXX) -c $< -o $@ $(CXXFLAGS) " ++ incl ++ (if not . null $ b then "\n\t" ++ "mv $@ ./" ++ b else "") ) $ exts where exts = src_exts i incl = includes i b = build_d i
318
rules_for_srcs i = Lists.intercalate "\n\n" . map ( \e-> "." ++ e ++ ".o:\n\t" ++ "$(CXX) -c $< -o $@ $(CXXFLAGS) " ++ incl ++ (if not . null $ b then "\n\t" ++ "mv $@ ./" ++ b else "") ) $ exts where exts = src_exts i incl = includes i b = build_d i
288
false
true
5
13
95
133
60
73
null
null
Nathan-Fenner/New-Nickel
ParseAST.hs
mit
parseInstanceBody :: Parse [InstanceStatement Parsed] parseInstanceBody = parseBraces parseInstanceStatement
108
parseInstanceBody :: Parse [InstanceStatement Parsed] parseInstanceBody = parseBraces parseInstanceStatement
108
parseInstanceBody = parseBraces parseInstanceStatement
54
false
true
0
7
8
23
11
12
null
null
collective/ECSpooler
backends/haskell/haskell_libs/BasicParseLib.hs
gpl-2.0
(>*>) :: Parse a b -> Parse a c -> Parse a (b,c) (>*>) p1 p2 inp = [((y,z),rem2)|(y,rem1) <- p1 inp, (z,rem2) <- p2 rem1]
121
(>*>) :: Parse a b -> Parse a c -> Parse a (b,c) (>*>) p1 p2 inp = [((y,z),rem2)|(y,rem1) <- p1 inp, (z,rem2) <- p2 rem1]
121
(>*>) p1 p2 inp = [((y,z),rem2)|(y,rem1) <- p1 inp, (z,rem2) <- p2 rem1]
72
false
true
0
9
25
105
56
49
null
null
sdiehl/ghc
testsuite/tests/numeric/should_run/numrun014.hs
bsd-3-clause
ain :: IO () main = do putStrLn "=== Subtraction ===" print (zero - zero) print (zero - nan) print (zero - inf) print (zero - neginf) print (nan - zero) print (nan - nan) print (nan - inf) print (nan - neginf) print (inf - zero) ...
5,380
main :: IO () main = do putStrLn "=== Subtraction ===" print (zero - zero) print (zero - nan) print (zero - inf) print (zero - neginf) print (nan - zero) print (nan - nan) print (nan - inf) print (nan - neginf) print (inf - zero) ...
5,380
main = do putStrLn "=== Subtraction ===" print (zero - zero) print (zero - nan) print (zero - inf) print (zero - neginf) print (nan - zero) print (nan - nan) print (nan - inf) print (nan - neginf) print (inf - zero) prin...
5,366
false
true
1
9
2,406
2,199
1,008
1,191
null
null
mtolly/rail
src/Language/Rail/Run.hs
gpl-3.0
-- | A memory state with no defined variables or functions, and an empty stack. -- Non-pure I/O commands are performed in the 'IO' monad. emptyMemory :: Memory IO emptyMemory = Memory { stack = [] , variables = Map.empty , functions = Map.empty , executor = runIO }
280
emptyMemory :: Memory IO emptyMemory = Memory { stack = [] , variables = Map.empty , functions = Map.empty , executor = runIO }
142
emptyMemory = Memory { stack = [] , variables = Map.empty , functions = Map.empty , executor = runIO }
117
true
true
1
8
63
55
30
25
null
null
bgamari/datalogger-web
WebApp.hs
bsd-3-clause
csv :: Csv.ToRecord a => [a] -> ActionM () csv xs = do setHeader "Content-Type" "text/plain" raw $ Csv.encode xs
120
csv :: Csv.ToRecord a => [a] -> ActionM () csv xs = do setHeader "Content-Type" "text/plain" raw $ Csv.encode xs
120
csv xs = do setHeader "Content-Type" "text/plain" raw $ Csv.encode xs
77
false
true
0
10
27
60
26
34
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
matchQTyConName, clauseQTyConName, expQTyConName, stmtQTyConName, decQTyConName, conQTyConName, strictTypeQTyConName, varStrictTypeQTyConName, typeQTyConName, fieldExpQTyConName, patQTyConName, fieldPatQTyConName, predQTyConName, decsQTyConName, ruleBndrQTyConName, tySynEqnQTyConName, roleTyConName :: N...
395
matchQTyConName, clauseQTyConName, expQTyConName, stmtQTyConName, decQTyConName, conQTyConName, strictTypeQTyConName, varStrictTypeQTyConName, typeQTyConName, fieldExpQTyConName, patQTyConName, fieldPatQTyConName, predQTyConName, decsQTyConName, ruleBndrQTyConName, tySynEqnQTyConName, roleTyConName :: N...
395
matchQTyConName = libTc (fsLit "MatchQ") matchQTyConKey
71
false
true
2
7
56
58
43
15
null
null
fmapfmapfmap/amazonka
amazonka-iam/gen/Network/AWS/IAM/CreateUser.hs
mpl-2.0
-- | The path for the user name. For more information about paths, see -- <http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM Identifiers> -- in the /Using IAM/ guide. -- -- This parameter is optional. If it is not included, it defaults to a -- slash (\/). cuPath :: Lens' CreateUser (Maybe Text)...
368
cuPath :: Lens' CreateUser (Maybe Text) cuPath = lens _cuPath (\ s a -> s{_cuPath = a})
87
cuPath = lens _cuPath (\ s a -> s{_cuPath = a})
47
true
true
0
9
58
51
30
21
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Actions/CycleWS.hs
bsd-2-clause
-- | Switch to the previous workspace. prevWS :: X () prevWS = switchWorkspace (-1)
83
prevWS :: X () prevWS = switchWorkspace (-1)
44
prevWS = switchWorkspace (-1)
29
true
true
0
7
14
30
14
16
null
null
McCraeAndrew/cpi-ide
cpiwb.hs
gpl-3.0
envCmd :: String -> Environment () envCmd _ = do s <- getEnv; say $ prettys $ L.sort s -- species Command
120
envCmd :: String -> Environment () envCmd _ = do s <- getEnv; say $ prettys $ L.sort s -- species Command
120
envCmd _ = do s <- getEnv; say $ prettys $ L.sort s -- species Command
85
false
true
0
10
36
53
24
29
null
null
jaapweel/piffle
src/CPretty.hs
gpl-2.0
parenize2 e@(Index _ _) = pretty e
38
parenize2 e@(Index _ _) = pretty e
38
parenize2 e@(Index _ _) = pretty e
38
false
false
0
8
10
23
11
12
null
null
nejla/nejla-common
src/NejlaCommon/Test/Expectation.hs
bsd-3-clause
-- | shouldBe lifted to MonadIO shouldBe :: (Eq a, Show a, MonadIO m) => a -> a -> m () shouldBe x y = withFrozenCallStack $ liftIO $ HSpec.shouldBe x y
152
shouldBe :: (Eq a, Show a, MonadIO m) => a -> a -> m () shouldBe x y = withFrozenCallStack $ liftIO $ HSpec.shouldBe x y
120
shouldBe x y = withFrozenCallStack $ liftIO $ HSpec.shouldBe x y
64
true
true
0
9
31
66
33
33
null
null
Shou/Chabunko
Chasocketo.hs
gpl-2.0
ong :: TMVar Input -> Nick -> Connection -> POSIXTime -> IO () pong t u c time = do emm <- safe . timeout (10^6 * 10) $ receiveData c case emm of Left _ -> do let da = ($ ("pong: Connection closed" :: Text)) forM_ [void . safe . sendClose c, warn] da atomically . putT...
1,139
pong :: TMVar Input -> Nick -> Connection -> POSIXTime -> IO () pong t u c time = do emm <- safe . timeout (10^6 * 10) $ receiveData c case emm of Left _ -> do let da = ($ ("pong: Connection closed" :: Text)) forM_ [void . safe . sendClose c, warn] da atomically . put...
1,139
pong t u c time = do emm <- safe . timeout (10^6 * 10) $ receiveData c case emm of Left _ -> do let da = ($ ("pong: Connection closed" :: Text)) forM_ [void . safe . sendClose c, warn] da atomically . putTMVar t . InCmd . CmdWrap time c $ End u Right Nothing -...
1,075
false
true
0
19
410
405
194
211
null
null
futurice/waitra
test/Main.hs
mit
app :: Application app = waitraMiddleware [echoRoute, jsonRoute] emptyApp
73
app :: Application app = waitraMiddleware [echoRoute, jsonRoute] emptyApp
73
app = waitraMiddleware [echoRoute, jsonRoute] emptyApp
54
false
true
0
6
8
29
13
16
null
null
phischu/fragnix
builtins/ghc-prim/GHC.Prim.hs
bsd-3-clause
-- | Read a vector from specified index of mutable array. readInt32X4Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Int32X4# #) readInt32X4Array# = readInt32X4Array#
185
readInt32X4Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,Int32X4# #) readInt32X4Array# = readInt32X4Array#
125
readInt32X4Array# = readInt32X4Array#
37
true
true
0
9
29
38
19
19
null
null
snowleopard/alga
src/Algebra/Graph/HigherKinded/Class.hs
mit
vertices [x] = vertex x
26
vertices [x] = vertex x
26
vertices [x] = vertex x
26
false
false
0
6
7
15
7
8
null
null
bergmark/hlint
src/CmdLine.hs
bsd-3-clause
automatic CmdGrep{..} = do cmdPath <- return $ if null cmdPath then ["."] else cmdPath cmdExtension <- return $ if null cmdExtension then ["hs", "lhs"] else cmdExtension return CmdGrep{..}
200
automatic CmdGrep{..} = do cmdPath <- return $ if null cmdPath then ["."] else cmdPath cmdExtension <- return $ if null cmdExtension then ["hs", "lhs"] else cmdExtension return CmdGrep{..}
200
automatic CmdGrep{..} = do cmdPath <- return $ if null cmdPath then ["."] else cmdPath cmdExtension <- return $ if null cmdExtension then ["hs", "lhs"] else cmdExtension return CmdGrep{..}
200
false
false
1
11
40
86
41
45
null
null
TobyGoodwin/eee
Main.hs
gpl-3.0
run :: Eee () run = do args <- liftIO $ getArgs case take 1 args of ("check":_) -> checkAll ("clear":_) -> liftIO clearAll ("send":_) -> sendAll ("status":_) -> statusAll _ -> usage
205
run :: Eee () run = do args <- liftIO $ getArgs case take 1 args of ("check":_) -> checkAll ("clear":_) -> liftIO clearAll ("send":_) -> sendAll ("status":_) -> statusAll _ -> usage
205
run = do args <- liftIO $ getArgs case take 1 args of ("check":_) -> checkAll ("clear":_) -> liftIO clearAll ("send":_) -> sendAll ("status":_) -> statusAll _ -> usage
191
false
true
0
11
56
100
50
50
null
null
mitsuji/exp-CloudHaskell
app/WaiChat.hs
bsd-3-clause
clientApp :: WSServerApp' clientApp pconn = do conn <- liftIO $ WS.acceptRequest pconn cpid <- forkClient conn registClient cpid name loop conn cpid where loop :: WS.Connection -> ProcessId -> IO' () loop conn cpid = do msg <- liftIO $ WS.receive conn case msg of WS.ControlMessage ...
793
clientApp :: WSServerApp' clientApp pconn = do conn <- liftIO $ WS.acceptRequest pconn cpid <- forkClient conn registClient cpid name loop conn cpid where loop :: WS.Connection -> ProcessId -> IO' () loop conn cpid = do msg <- liftIO $ WS.receive conn case msg of WS.ControlMessage ...
793
clientApp pconn = do conn <- liftIO $ WS.acceptRequest pconn cpid <- forkClient conn registClient cpid name loop conn cpid where loop :: WS.Connection -> ProcessId -> IO' () loop conn cpid = do msg <- liftIO $ WS.receive conn case msg of WS.ControlMessage (WS.Close _ _) -> do ...
767
false
true
0
14
223
272
125
147
null
null
rueshyna/gogol
gogol-customsearch/gen/Network/Google/Resource/Search/CSE/List.hs
mpl-2.0
-- | Creates a value of 'CSEList' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'cselImgDominantColor' -- -- * 'cselSiteSearchFilter' -- -- * 'cselC2coff' -- -- * 'cselOrTerms' -- -- * 'cselStart' -- -- * 'cselRights' -- -- * 'cselEx...
1,866
cSEList :: Text -- ^ 'cselQ' -> CSEList cSEList pCselQ_ = CSEList' { _cselImgDominantColor = Nothing , _cselSiteSearchFilter = Nothing , _cselC2coff = Nothing , _cselOrTerms = Nothing , _cselStart = Nothing , _cselRights = Nothing , _cselExcludeTerms = Nothing , _cselNum = 10...
1,003
cSEList pCselQ_ = CSEList' { _cselImgDominantColor = Nothing , _cselSiteSearchFilter = Nothing , _cselC2coff = Nothing , _cselOrTerms = Nothing , _cselStart = Nothing , _cselRights = Nothing , _cselExcludeTerms = Nothing , _cselNum = 10 , _cselFileType = Nothing , _cselSearch...
955
true
true
0
7
442
289
208
81
null
null
thade/haskellml
src/NeuralNetworks.hs
bsd-3-clause
backPropagate :: [Matrix Double] -> [Matrix Double] -> [Matrix Double] -> Matrix Double -> Matrix Double -> [Matrix Double] backPropagate thetaList inputMatrices activationMatrices output_layer targetYs = output_deltas `par` doBackProp 0 deltaList where deltaList = makeZeroDeltaList thetaList m = rows targetY...
1,894
backPropagate :: [Matrix Double] -> [Matrix Double] -> [Matrix Double] -> Matrix Double -> Matrix Double -> [Matrix Double] backPropagate thetaList inputMatrices activationMatrices output_layer targetYs = output_deltas `par` doBackProp 0 deltaList where deltaList = makeZeroDeltaList thetaList m = rows targetY...
1,894
backPropagate thetaList inputMatrices activationMatrices output_layer targetYs = output_deltas `par` doBackProp 0 deltaList where deltaList = makeZeroDeltaList thetaList m = rows targetYs -- reverse the lists we'll be iterating through, since we're going backwards from the output layer revInputs = rev...
1,770
false
true
9
14
409
455
223
232
null
null
LudvikGalois/Fay-IFS
IFS.hs
gpl-3.0
chooseTransition' p ((p',x):xs) = if p <= p' then x else chooseTransition' p xs
79
chooseTransition' p ((p',x):xs) = if p <= p' then x else chooseTransition' p xs
79
chooseTransition' p ((p',x):xs) = if p <= p' then x else chooseTransition' p xs
79
false
false
0
7
13
43
22
21
null
null
Concomitant/LambdaHack
Game/LambdaHack/Server/DebugServer.hs
bsd-3-clause
debugPretty :: (MonadServer m, Show a) => a -> UpdAtomic -> m () debugPretty cmd cmdA = do ps <- posUpdAtomic cmdA serverPrint $ debugShow (cmd, ps)
152
debugPretty :: (MonadServer m, Show a) => a -> UpdAtomic -> m () debugPretty cmd cmdA = do ps <- posUpdAtomic cmdA serverPrint $ debugShow (cmd, ps)
152
debugPretty cmd cmdA = do ps <- posUpdAtomic cmdA serverPrint $ debugShow (cmd, ps)
87
false
true
0
9
30
70
34
36
null
null
supermitch/learn-haskell
real-world-haskell/ch03/BadPattern.hs
mit
-- file: ch03/BadPattern.hs badExample (x:xs) = x + badExample xs
66
badExample (x:xs) = x + badExample xs
37
badExample (x:xs) = x + badExample xs
37
true
false
2
6
10
27
12
15
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Embedded.hs
bsd-3-clause
-- | A short-hand notion for @ elAttr \"picture\" ... @ picture ∷ forall t m a. DomBuilder t m ⇒ Picture → m a → m a picture bm children = snd <$> picture' bm children
167
picture ∷ forall t m a. DomBuilder t m ⇒ Picture → m a → m a picture bm children = snd <$> picture' bm children
111
picture bm children = snd <$> picture' bm children
50
true
true
0
9
36
56
28
28
null
null
brendanhay/gogol
gogol-blogger/gen/Network/Google/Resource/Blogger/Posts/GetByPath.hs
mpl-2.0
-- | Creates a value of 'PostsGetByPath' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'pgbpXgafv' -- -- * 'pgbpUploadProtocol' -- -- * 'pgbpPath' -- -- * 'pgbpAccessToken' -- -- * 'pgbpUploadType' -- -- * 'pgbpBlogId' -- -- * 'pgbpM...
812
postsGetByPath :: Text -- ^ 'pgbpPath' -> Text -- ^ 'pgbpBlogId' -> PostsGetByPath postsGetByPath pPgbpPath_ pPgbpBlogId_ = PostsGetByPath' { _pgbpXgafv = Nothing , _pgbpUploadProtocol = Nothing , _pgbpPath = pPgbpPath_ , _pgbpAccessToken = Nothing , _pgbpUploadType = Nothing , _pg...
438
postsGetByPath pPgbpPath_ pPgbpBlogId_ = PostsGetByPath' { _pgbpXgafv = Nothing , _pgbpUploadProtocol = Nothing , _pgbpPath = pPgbpPath_ , _pgbpAccessToken = Nothing , _pgbpUploadType = Nothing , _pgbpBlogId = pPgbpBlogId_ , _pgbpMaxComments = Nothing , _pgbpView = Nothing , _pgbpC...
343
true
true
0
8
174
112
74
38
null
null
crooney/mooninite
src/Parser.hs
bsd-3-clause
pComment :: Parser Char pComment = const ' ' <$> ((pSymbol ";|" <* pSexp) <<|> (pSym ';' *> pSome (pAnySym $ filter (/= '\n') ['\000' .. '\254']))) <?> "Comment"
177
pComment :: Parser Char pComment = const ' ' <$> ((pSymbol ";|" <* pSexp) <<|> (pSym ';' *> pSome (pAnySym $ filter (/= '\n') ['\000' .. '\254']))) <?> "Comment"
177
pComment = const ' ' <$> ((pSymbol ";|" <* pSexp) <<|> (pSym ';' *> pSome (pAnySym $ filter (/= '\n') ['\000' .. '\254']))) <?> "Comment"
153
false
true
2
14
44
79
40
39
null
null
nathanic/hive-hs
test/Hive/Game/Properties.hs
gpl-3.0
jank = fromRight $ applyMovesToGame [Move wL (Axial 0 0),Move bM (Axial 0 1),Move wQ (Axial (-1) 0),Move bB1 (Axial (-1) 2),Move wP (Axial (-2) 0),Move bQ (Axial 0 2),Move wG1 (Axial 1 (-1)),Move bB1 (Axial 0 1),Move wA1 (Axial 2 (-2)),Move bB1 (Axial 0 2)] newGame
265
jank = fromRight $ applyMovesToGame [Move wL (Axial 0 0),Move bM (Axial 0 1),Move wQ (Axial (-1) 0),Move bB1 (Axial (-1) 2),Move wP (Axial (-2) 0),Move bQ (Axial 0 2),Move wG1 (Axial 1 (-1)),Move bB1 (Axial 0 1),Move wA1 (Axial 2 (-2)),Move bB1 (Axial 0 2)] newGame
265
jank = fromRight $ applyMovesToGame [Move wL (Axial 0 0),Move bM (Axial 0 1),Move wQ (Axial (-1) 0),Move bB1 (Axial (-1) 2),Move wP (Axial (-2) 0),Move bQ (Axial 0 2),Move wG1 (Axial 1 (-1)),Move bB1 (Axial 0 1),Move wA1 (Axial 2 (-2)),Move bB1 (Axial 0 2)] newGame
265
false
false
0
12
46
200
102
98
null
null
totem3/cwhs
src/Chatwork/V0/Message.hs
mit
close :: Text.Parsec.Prim.Stream s m Char => Text.Parsec.Prim.ParsecT s u m Char close = char ']'
97
close :: Text.Parsec.Prim.Stream s m Char => Text.Parsec.Prim.ParsecT s u m Char close = char ']'
97
close = char ']'
16
false
true
0
7
15
42
22
20
null
null
Bodigrim/exp-pairs
tests/RatioInf.hs
gpl-3.0
testConversion :: Rational -> Bool testConversion a = toRational (Finite a) == a
80
testConversion :: Rational -> Bool testConversion a = toRational (Finite a) == a
80
testConversion a = toRational (Finite a) == a
45
false
true
0
8
12
31
15
16
null
null
schell/lamdu
Lamdu/Data/Expression/Utils.hs
gpl-3.0
couldEq :: Eq def => Expression def a -> Expression def a -> Bool couldEq x y = isJust $ matchExpression (const . Just) onMismatch x y where onMismatch (Expression (BodyLeaf Hole) _) e = Just e onMismatch e (Expression (BodyLeaf Hole) _) = Just e onMismatch _ _ = Nothing
287
couldEq :: Eq def => Expression def a -> Expression def a -> Bool couldEq x y = isJust $ matchExpression (const . Just) onMismatch x y where onMismatch (Expression (BodyLeaf Hole) _) e = Just e onMismatch e (Expression (BodyLeaf Hole) _) = Just e onMismatch _ _ = Nothing
287
couldEq x y = isJust $ matchExpression (const . Just) onMismatch x y where onMismatch (Expression (BodyLeaf Hole) _) e = Just e onMismatch e (Expression (BodyLeaf Hole) _) = Just e onMismatch _ _ = Nothing
221
false
true
0
9
66
133
62
71
null
null
lambdageek/emile
src/Language/Example/MiniMod.hs
bsd-2-clause
c :: MExpr MiniSIL -> M (SIL.Mod MiniSIL, SIL.TyVarBinds MiniSIL, SIL.Σ MiniSIL) c = elaborateME'
97
c :: MExpr MiniSIL -> M (SIL.Mod MiniSIL, SIL.TyVarBinds MiniSIL, SIL.Σ MiniSIL) c = elaborateME'
97
c = elaborateME'
16
false
true
0
10
14
51
23
28
null
null
unisonweb/platform
parser-typechecker/src/Unison/Runtime/Foreign.hs
mit
unwrapBuiltin :: BuiltinForeign f => Foreign -> f unwrapBuiltin (Wrap _ x) = unsafeCoerce x
91
unwrapBuiltin :: BuiltinForeign f => Foreign -> f unwrapBuiltin (Wrap _ x) = unsafeCoerce x
91
unwrapBuiltin (Wrap _ x) = unsafeCoerce x
41
false
true
0
7
14
36
17
19
null
null
louispan/glazier-react
src/Glazier/React/Markup.hs
bsd-3-clause
-- | For raw text content textMarkup :: MonadPut' Markup m => JSString -> m () textMarkup n = modifyEnv' @Markup (`DL.snoc` TextMarkup n)
137
textMarkup :: MonadPut' Markup m => JSString -> m () textMarkup n = modifyEnv' @Markup (`DL.snoc` TextMarkup n)
111
textMarkup n = modifyEnv' @Markup (`DL.snoc` TextMarkup n)
58
true
true
0
8
23
51
26
25
null
null
fibsifan/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
gpl-2.0
toPolyglossia ("en":"NZ":_) = ("english", "variant=newzealand")
70
toPolyglossia ("en":"NZ":_) = ("english", "variant=newzealand")
70
toPolyglossia ("en":"NZ":_) = ("english", "variant=newzealand")
70
false
false
0
7
11
27
14
13
null
null
kmels/hledger
extra/hledger-vty/Hledger/Vty/Main.hs
gpl-3.0
helpmsg = "(b)alance, (r)egister, (p)rint, (right) to drill down, (left) to back up, (q)uit"
92
helpmsg = "(b)alance, (r)egister, (p)rint, (right) to drill down, (left) to back up, (q)uit"
92
helpmsg = "(b)alance, (r)egister, (p)rint, (right) to drill down, (left) to back up, (q)uit"
92
false
false
0
4
13
6
3
3
null
null
kowey/pandoc-old
src/Text/Pandoc/Writers/Man.hs
gpl-2.0
inlineToMan _ Ellipses = return $ text "\\&..."
47
inlineToMan _ Ellipses = return $ text "\\&..."
47
inlineToMan _ Ellipses = return $ text "\\&..."
47
false
false
0
6
7
18
8
10
null
null
KaneTW/Idris-dev
src/Idris/REPL.hs
bsd-3-clause
process fn (AddProofClauseFrom updatefile l n) = addProofClauseFrom fn updatefile l n
89
process fn (AddProofClauseFrom updatefile l n) = addProofClauseFrom fn updatefile l n
89
process fn (AddProofClauseFrom updatefile l n) = addProofClauseFrom fn updatefile l n
89
false
false
0
7
15
30
14
16
null
null
keera-studios/hsQt
Qtc/Gui/QGridLayout.hs
bsd-2-clause
columnMinimumWidth :: QGridLayout a -> ((Int)) -> IO (Int) columnMinimumWidth x0 (x1) = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QGridLayout_columnMinimumWidth cobj_x0 (toCInt x1)
199
columnMinimumWidth :: QGridLayout a -> ((Int)) -> IO (Int) columnMinimumWidth x0 (x1) = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QGridLayout_columnMinimumWidth cobj_x0 (toCInt x1)
199
columnMinimumWidth x0 (x1) = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QGridLayout_columnMinimumWidth cobj_x0 (toCInt x1)
140
false
true
4
8
33
76
36
40
null
null
mzero/plush
src/Plush/Run/BuiltIns/Text.hs
apache-2.0
trExpand ('\\': _ :cs) = trExpand cs
43
trExpand ('\\': _ :cs) = trExpand cs
43
trExpand ('\\': _ :cs) = trExpand cs
43
false
false
0
8
13
23
11
12
null
null
BartAdv/idris-cil
src/IRTS/CodegenCil.hs
bsd-3-clause
cgOp LStrLen [s] = do loadString s tell [ callvirt Int32 "mscorlib" "System.String" "get_Length" [] , boxInt32 ]
123
cgOp LStrLen [s] = do loadString s tell [ callvirt Int32 "mscorlib" "System.String" "get_Length" [] , boxInt32 ]
123
cgOp LStrLen [s] = do loadString s tell [ callvirt Int32 "mscorlib" "System.String" "get_Length" [] , boxInt32 ]
123
false
false
0
10
28
47
21
26
null
null
kolmodin/cabal
Cabal/Distribution/Simple/PackageIndex.hs
bsd-3-clause
-- -- * Lookups -- -- | Does a lookup by source package id (name & version). -- -- Since multiple package DBs mask each other by 'UnitId', -- then we get back at most one package. -- lookupUnitId :: PackageIndex a -> UnitId -> Maybe a lookupUnitId (PackageIndex pids _) pid = Map.lookup pid pids
309
lookupUnitId :: PackageIndex a -> UnitId -> Maybe a lookupUnitId (PackageIndex pids _) pid = Map.lookup pid pids
125
lookupUnitId (PackageIndex pids _) pid = Map.lookup pid pids
60
true
true
0
7
69
53
29
24
null
null
peterthiemann/cftools
src/Tests.hs
bsd-3-clause
test3c = findMatch [] alpha3 beta3
34
test3c = findMatch [] alpha3 beta3
34
test3c = findMatch [] alpha3 beta3
34
false
false
0
6
5
15
7
8
null
null
oldmanmike/ghc
compiler/utils/Outputable.hs
bsd-3-clause
qualPackage :: PprStyle -> QueryQualifyPackage qualPackage (PprUser q _) m = queryQualifyPackage q m
101
qualPackage :: PprStyle -> QueryQualifyPackage qualPackage (PprUser q _) m = queryQualifyPackage q m
101
qualPackage (PprUser q _) m = queryQualifyPackage q m
54
false
true
0
7
14
33
16
17
null
null