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
bos/text-icu
tests/Properties.hs
bsd-2-clause
-- Iteration t_charIterator_String a b = (compare `on` I.fromString) a b == compare a b
88
t_charIterator_String a b = (compare `on` I.fromString) a b == compare a b
74
t_charIterator_String a b = (compare `on` I.fromString) a b == compare a b
74
true
false
0
9
15
37
19
18
null
null
rodrigogribeiro/mptc
test/Cases/TcExpTest.hs
bsd-3-clause
testtcexp17 = testtcexp test17
30
testtcexp17 = testtcexp test17
30
testtcexp17 = testtcexp test17
30
false
false
0
5
3
9
4
5
null
null
ndmitchell/cmdargs
System/Console/CmdArgs/Explicit/Complete.hs
bsd-3-clause
-- | Follow args deals with all seen arguments, then calls on to deal with the next one followArgs :: Mode a -> [String] -> (String -> [Complete]) followArgs m = first where first [] = expectArgFlagMode (modeModes m) (argsPick 0) (modeFlags m) first xs = norm 0 xs -- i is the number of arguments that have gone past norm i [] = expectArgFlag (argsPick i) (modeFlags m) norm i ("--":xs) = expectArg $ argsPick (i + length xs) norm i (('-':'-':x):xs) | null b, flagInfo flg == FlagReq = val i flg xs | otherwise = norm i xs where (a,b) = break (== '=') x flg = getFlag a norm i (('-':x:y):xs) = case flagInfo flg of FlagReq | null y -> val i flg xs | otherwise -> norm i xs FlagOpt{} -> norm i xs _ | "=" `isPrefixOf` y -> norm i xs | null y -> norm i xs | otherwise -> norm i (('-':y):xs) where flg = getFlag [x] norm i (x:xs) = norm (i+1) xs val i flg [] = expectVal flg val i flg (x:xs) = norm i xs argsPick i = let (lst,end) = modeArgs m in if i < length lst then Just $ lst !! i else end -- if you can't find the flag, pick one that is FlagNone (has all the right fallback) getFlag x = fromMaybe (flagNone [] id "") $ pickBy flagNames x $ modeFlags m
1,424
followArgs :: Mode a -> [String] -> (String -> [Complete]) followArgs m = first where first [] = expectArgFlagMode (modeModes m) (argsPick 0) (modeFlags m) first xs = norm 0 xs -- i is the number of arguments that have gone past norm i [] = expectArgFlag (argsPick i) (modeFlags m) norm i ("--":xs) = expectArg $ argsPick (i + length xs) norm i (('-':'-':x):xs) | null b, flagInfo flg == FlagReq = val i flg xs | otherwise = norm i xs where (a,b) = break (== '=') x flg = getFlag a norm i (('-':x:y):xs) = case flagInfo flg of FlagReq | null y -> val i flg xs | otherwise -> norm i xs FlagOpt{} -> norm i xs _ | "=" `isPrefixOf` y -> norm i xs | null y -> norm i xs | otherwise -> norm i (('-':y):xs) where flg = getFlag [x] norm i (x:xs) = norm (i+1) xs val i flg [] = expectVal flg val i flg (x:xs) = norm i xs argsPick i = let (lst,end) = modeArgs m in if i < length lst then Just $ lst !! i else end -- if you can't find the flag, pick one that is FlagNone (has all the right fallback) getFlag x = fromMaybe (flagNone [] id "") $ pickBy flagNames x $ modeFlags m
1,336
followArgs m = first where first [] = expectArgFlagMode (modeModes m) (argsPick 0) (modeFlags m) first xs = norm 0 xs -- i is the number of arguments that have gone past norm i [] = expectArgFlag (argsPick i) (modeFlags m) norm i ("--":xs) = expectArg $ argsPick (i + length xs) norm i (('-':'-':x):xs) | null b, flagInfo flg == FlagReq = val i flg xs | otherwise = norm i xs where (a,b) = break (== '=') x flg = getFlag a norm i (('-':x:y):xs) = case flagInfo flg of FlagReq | null y -> val i flg xs | otherwise -> norm i xs FlagOpt{} -> norm i xs _ | "=" `isPrefixOf` y -> norm i xs | null y -> norm i xs | otherwise -> norm i (('-':y):xs) where flg = getFlag [x] norm i (x:xs) = norm (i+1) xs val i flg [] = expectVal flg val i flg (x:xs) = norm i xs argsPick i = let (lst,end) = modeArgs m in if i < length lst then Just $ lst !! i else end -- if you can't find the flag, pick one that is FlagNone (has all the right fallback) getFlag x = fromMaybe (flagNone [] id "") $ pickBy flagNames x $ modeFlags m
1,277
true
true
4
13
512
614
286
328
null
null
antarestrader/sapphire
Builtin/Hash.hs
gpl-3.0
valueToHKeyM :: Value -> EvalM HKey valueToHKeyM VNil = throwError $Err "RunTimeError" "Illigal value as key to a Hash." [VNil]
127
valueToHKeyM :: Value -> EvalM HKey valueToHKeyM VNil = throwError $Err "RunTimeError" "Illigal value as key to a Hash." [VNil]
127
valueToHKeyM VNil = throwError $Err "RunTimeError" "Illigal value as key to a Hash." [VNil]
91
false
true
0
7
19
39
18
21
null
null
aBhallo/AoC2016
Day 18/day18part2.hs
mit
isSafe ('.', '.', '^') = False
30
isSafe ('.', '.', '^') = False
30
isSafe ('.', '.', '^') = False
30
false
false
0
5
5
19
10
9
null
null
pjones/thetvdb
Network/API/TheTVDB/Zipper.hs
mit
-- | Safe version of 'season'. season' :: Zipper -> Maybe Season season' (Zipper _ (x:_, _) _) = Just x
103
season' :: Zipper -> Maybe Season season' (Zipper _ (x:_, _) _) = Just x
72
season' (Zipper _ (x:_, _) _) = Just x
38
true
true
0
11
20
49
24
25
null
null
dmvianna/haskellbook
src/Ch09Ex-stdFunc.hs
unlicense
squishMap f (x:xs) = f x ++ squishMap f xs
42
squishMap f (x:xs) = f x ++ squishMap f xs
42
squishMap f (x:xs) = f x ++ squishMap f xs
42
false
false
2
6
9
35
14
21
null
null
urbanslug/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
cmpEqTick (FillInCaseDefault a) (FillInCaseDefault b) = a `compare` b
87
cmpEqTick (FillInCaseDefault a) (FillInCaseDefault b) = a `compare` b
87
cmpEqTick (FillInCaseDefault a) (FillInCaseDefault b) = a `compare` b
87
false
false
1
8
26
33
15
18
null
null
raventid/coursera_learning
haskell/chpater5/worksheet.hs
mit
myUncurry f (a, b) = f a b
26
myUncurry f (a, b) = f a b
26
myUncurry f (a, b) = f a b
26
false
false
0
6
7
22
11
11
null
null
qsn/rhcalc
src/Operators.hs
mit
op_tail [List xs] = [List $ tail xs]
36
op_tail [List xs] = [List $ tail xs]
36
op_tail [List xs] = [List $ tail xs]
36
false
false
0
7
7
26
12
14
null
null
wavewave/HEPUtil
src/HEP/Util/Formatter/Fortran.hs
bsd-2-clause
digitChar 7 = '7'
17
digitChar 7 = '7'
17
digitChar 7 = '7'
17
false
false
0
5
3
9
4
5
null
null
amir-sabbaghi/proxy
src/Server.hs
gpl-3.0
server (ServerSettings bindAddr _ _ (Just (HTTPS port cert key))) worker = do chain <- credentialLoadX509 cert key let (cc, pkey) = either error id chain (CertificateChain c) = cc params = def { serverCACertificates = def c , serverWantClientCert = False , serverShared = def { sharedCredentials = Credentials [(cc, pkey)] } , serverSupported = def { supportedCiphers = ciphersuite_all } , serverDebug = def } :: ServerParams print $ "[HTTPS] Listening on port " ++ port serve HostAny port $ \(socket, remoteAddr) -> do ctx <- contextNew socket params handshake ctx let write = sendData ctx . BL.fromStrict rcv = recvData ctx worker write rcv `catch` \e -> print (e :: SomeException) bye ctx return ()
906
server (ServerSettings bindAddr _ _ (Just (HTTPS port cert key))) worker = do chain <- credentialLoadX509 cert key let (cc, pkey) = either error id chain (CertificateChain c) = cc params = def { serverCACertificates = def c , serverWantClientCert = False , serverShared = def { sharedCredentials = Credentials [(cc, pkey)] } , serverSupported = def { supportedCiphers = ciphersuite_all } , serverDebug = def } :: ServerParams print $ "[HTTPS] Listening on port " ++ port serve HostAny port $ \(socket, remoteAddr) -> do ctx <- contextNew socket params handshake ctx let write = sendData ctx . BL.fromStrict rcv = recvData ctx worker write rcv `catch` \e -> print (e :: SomeException) bye ctx return ()
906
server (ServerSettings bindAddr _ _ (Just (HTTPS port cert key))) worker = do chain <- credentialLoadX509 cert key let (cc, pkey) = either error id chain (CertificateChain c) = cc params = def { serverCACertificates = def c , serverWantClientCert = False , serverShared = def { sharedCredentials = Credentials [(cc, pkey)] } , serverSupported = def { supportedCiphers = ciphersuite_all } , serverDebug = def } :: ServerParams print $ "[HTTPS] Listening on port " ++ port serve HostAny port $ \(socket, remoteAddr) -> do ctx <- contextNew socket params handshake ctx let write = sendData ctx . BL.fromStrict rcv = recvData ctx worker write rcv `catch` \e -> print (e :: SomeException) bye ctx return ()
906
false
false
1
17
322
282
141
141
null
null
JoeyEremondi/utrecht-apa-p1
src/Type/Unify.hs
bsd-3-clause
unify :: A.Region -> Variable -> Variable -> StateT TS.SolverState IO () unify region variable1 variable2 = do result <- runErrorT (unifyHelp region variable1 variable2) either TS.addHint return result -- ACTUALLY UNIFY STUFF
236
unify :: A.Region -> Variable -> Variable -> StateT TS.SolverState IO () unify region variable1 variable2 = do result <- runErrorT (unifyHelp region variable1 variable2) either TS.addHint return result -- ACTUALLY UNIFY STUFF
236
unify region variable1 variable2 = do result <- runErrorT (unifyHelp region variable1 variable2) either TS.addHint return result -- ACTUALLY UNIFY STUFF
163
false
true
0
10
43
76
36
40
null
null
AndreasPK/stack
src/Stack/PackageDump.hs
bsd-3-clause
stripPrefixText :: Text -> Text -> Maybe Text stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
147
stripPrefixText :: Text -> Text -> Maybe Text stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
147
stripPrefixText x y | x `T.isPrefixOf` y = Just $ T.drop (T.length x) y | otherwise = Nothing
101
false
true
1
10
33
68
33
35
null
null
TachoMex/Haskrypto
src/Haskrypto/ElGamal.hs
mit
calculateNoise :: ElGamalKey -> Point Integer -> Point Integer calculateNoise (ElGamalKey curve _ password _) public_key = multiply curve public_key password
159
calculateNoise :: ElGamalKey -> Point Integer -> Point Integer calculateNoise (ElGamalKey curve _ password _) public_key = multiply curve public_key password
157
calculateNoise (ElGamalKey curve _ password _) public_key = multiply curve public_key password
94
false
true
0
7
22
49
23
26
null
null
conal/reify-core
src/ReifyCore/Reify.hs
bsd-3-clause
reifyE :: ReExpr reifyE = anytdE (repeatR reifyMisc)
52
reifyE :: ReExpr reifyE = anytdE (repeatR reifyMisc)
52
reifyE = anytdE (repeatR reifyMisc)
35
false
true
0
7
7
27
11
16
null
null
jrockway/c2hs
src/Main.hs
gpl-2.0
dumpArg "ctrav" = Dump CTrav
31
dumpArg "ctrav" = Dump CTrav
31
dumpArg "ctrav" = Dump CTrav
31
false
false
0
5
7
12
5
7
null
null
nwf/trifecta
src/Text/Trifecta/Util/Array.hs
bsd-3-clause
-- | /O(n)/ Delete an element at the given position in this array, -- decreasing its size by one. delete :: Array e -> Int -> Array e delete ary idx = run $ do mary <- new_ (count-1) copy ary 0 mary 0 idx copy ary (idx+1) mary idx (count-(idx+1)) return mary where !count = length ary
303
delete :: Array e -> Int -> Array e delete ary idx = run $ do mary <- new_ (count-1) copy ary 0 mary 0 idx copy ary (idx+1) mary idx (count-(idx+1)) return mary where !count = length ary
205
delete ary idx = run $ do mary <- new_ (count-1) copy ary 0 mary 0 idx copy ary (idx+1) mary idx (count-(idx+1)) return mary where !count = length ary
169
true
true
0
12
76
120
57
63
null
null
kajigor/uKanren_transformations
src/.FirstOrder/Eval.hs
bsd-3-clause
mature :: Stream Subst -> Stream Subst mature s | isMature s = s
64
mature :: Stream Subst -> Stream Subst mature s | isMature s = s
64
mature s | isMature s = s
25
false
true
0
8
13
33
14
19
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/InlineC.hs
gpl-3.0
slepcFin' :: IO CInt slepcFin' = [C.block| int{ SlepcFinalize(); }|]
68
slepcFin' :: IO CInt slepcFin' = [C.block| int{ SlepcFinalize(); }|]
68
slepcFin' = [C.block| int{ SlepcFinalize(); }|]
47
false
true
0
5
9
20
12
8
null
null
sdiehl/ghc
compiler/GHC/Cmm/CLabel.hs
bsd-3-clause
pprCLbl (SRTLabel u) = tempLabelPrefixOrUnderscore <> pprUniqueAlways u <> pp_cSEP <> text "srt"
98
pprCLbl (SRTLabel u) = tempLabelPrefixOrUnderscore <> pprUniqueAlways u <> pp_cSEP <> text "srt"
98
pprCLbl (SRTLabel u) = tempLabelPrefixOrUnderscore <> pprUniqueAlways u <> pp_cSEP <> text "srt"
98
false
false
0
8
14
34
15
19
null
null
green-haskell/ghc
compiler/types/TypeRep.hs
bsd-3-clause
pprTyThingCategory (AConLike (PatSynCon _)) = ptext (sLit "Pattern synonym")
77
pprTyThingCategory (AConLike (PatSynCon _)) = ptext (sLit "Pattern synonym")
77
pprTyThingCategory (AConLike (PatSynCon _)) = ptext (sLit "Pattern synonym")
77
false
false
0
9
9
30
14
16
null
null
nevrenato/Hets_Fork
ExtModal/Parse_AS.hs
gpl-2.0
parseInterModality :: AParser st MODALITY parseInterModality = parseBinModality Intersection parseCompModality
110
parseInterModality :: AParser st MODALITY parseInterModality = parseBinModality Intersection parseCompModality
110
parseInterModality = parseBinModality Intersection parseCompModality
68
false
true
0
5
9
21
10
11
null
null
emmanueltouzery/cigale-timesheet
src/WebGui/Config.hs
mit
displaySectionItem :: MonadWidget t m => PluginConfig -> ConfigItem -> m (Event t ConfigChangeRequest) displaySectionItem pluginConfig ci@ConfigItem{..} = elAttrStyle "div" ("class" =: "card") (marginAll $ px 20) $ do let divStyle = display flex >> flexDirection rowReverse cfgChgEvt <- elAttrStyle "div" ("class" =: "card-header") divStyle $ do delEvt <- addDeleteButton ci updEvt <- addEditButton pluginConfig ci elStyle "span" (flexGrow 1) $ text $ T.pack configItemName -- leftmost is ok, they can't both happen at the same time return $ leftmost [delEvt, updEvt] elAttr "div" ("class" =: "card-block") $ pluginContents pluginConfig ci return cfgChgEvt
764
displaySectionItem :: MonadWidget t m => PluginConfig -> ConfigItem -> m (Event t ConfigChangeRequest) displaySectionItem pluginConfig ci@ConfigItem{..} = elAttrStyle "div" ("class" =: "card") (marginAll $ px 20) $ do let divStyle = display flex >> flexDirection rowReverse cfgChgEvt <- elAttrStyle "div" ("class" =: "card-header") divStyle $ do delEvt <- addDeleteButton ci updEvt <- addEditButton pluginConfig ci elStyle "span" (flexGrow 1) $ text $ T.pack configItemName -- leftmost is ok, they can't both happen at the same time return $ leftmost [delEvt, updEvt] elAttr "div" ("class" =: "card-block") $ pluginContents pluginConfig ci return cfgChgEvt
764
displaySectionItem pluginConfig ci@ConfigItem{..} = elAttrStyle "div" ("class" =: "card") (marginAll $ px 20) $ do let divStyle = display flex >> flexDirection rowReverse cfgChgEvt <- elAttrStyle "div" ("class" =: "card-header") divStyle $ do delEvt <- addDeleteButton ci updEvt <- addEditButton pluginConfig ci elStyle "span" (flexGrow 1) $ text $ T.pack configItemName -- leftmost is ok, they can't both happen at the same time return $ leftmost [delEvt, updEvt] elAttr "div" ("class" =: "card-block") $ pluginContents pluginConfig ci return cfgChgEvt
661
false
true
0
17
200
228
104
124
null
null
HIPERFIT/language-c-quote
Language/C/Parser/Monad.hs
bsd-3-clause
alexInputPrevChar :: AlexInput -> Char alexInputPrevChar (AlexInput _ _ 0) = '\n'
89
alexInputPrevChar :: AlexInput -> Char alexInputPrevChar (AlexInput _ _ 0) = '\n'
89
alexInputPrevChar (AlexInput _ _ 0) = '\n'
50
false
true
0
7
19
28
14
14
null
null
uuhan/Idris-dev
src/IRTS/JavaScript/AST.hs
bsd-3-clause
jsAst2Text :: JsExpr -> Text jsAst2Text JsNull = "null"
55
jsAst2Text :: JsExpr -> Text jsAst2Text JsNull = "null"
55
jsAst2Text JsNull = "null"
26
false
true
0
5
8
18
9
9
null
null
prannayk/conj
Judge/judge.hs
gpl-3.0
main = do inpu <- getArgs err <- compileCode inpu if(err == CompileFail) then do writeLog inpu (Left err) else do err <- testStuff inpu writeLog inpu err
173
main = do inpu <- getArgs err <- compileCode inpu if(err == CompileFail) then do writeLog inpu (Left err) else do err <- testStuff inpu writeLog inpu err
173
main = do inpu <- getArgs err <- compileCode inpu if(err == CompileFail) then do writeLog inpu (Left err) else do err <- testStuff inpu writeLog inpu err
173
false
false
0
12
47
73
33
40
null
null
guoy34/ampersand
src/Database/Design/Ampersand/ADL1/Lattices.hs
gpl-3.0
findSubsetAsRevMap lst (RevMap st mp) = RevMap st (IntMap.fromList [ (l, rm) | (l, rst) <- listAndRest lst , (Just mp') <- [IntMap.lookup l mp] , let rm@(RevMap st2 mp2) = findSubsetAsRevMap rst mp' , not (Set.null st2 && IntMap.null mp2) ] )
393
findSubsetAsRevMap lst (RevMap st mp) = RevMap st (IntMap.fromList [ (l, rm) | (l, rst) <- listAndRest lst , (Just mp') <- [IntMap.lookup l mp] , let rm@(RevMap st2 mp2) = findSubsetAsRevMap rst mp' , not (Set.null st2 && IntMap.null mp2) ] )
393
findSubsetAsRevMap lst (RevMap st mp) = RevMap st (IntMap.fromList [ (l, rm) | (l, rst) <- listAndRest lst , (Just mp') <- [IntMap.lookup l mp] , let rm@(RevMap st2 mp2) = findSubsetAsRevMap rst mp' , not (Set.null st2 && IntMap.null mp2) ] )
393
false
false
0
14
193
136
66
70
null
null
ghorn/rawesome
wtfviz/src/KiteSim.hs
lgpl-3.0
withContext = ZMQ.withContext
29
withContext = ZMQ.withContext
29
withContext = ZMQ.withContext
29
false
false
0
5
2
8
4
4
null
null
hamishmack/haskell-gi
lib/Data/GI/CodeGen/Code.hs
lgpl-2.1
findAPI _ = return Nothing
26
findAPI _ = return Nothing
26
findAPI _ = return Nothing
26
false
false
0
5
4
12
5
7
null
null
bgamari/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
acute 'e' = "é"
15
acute 'e' = "é"
15
acute 'e' = "é"
15
false
false
1
5
3
13
4
9
null
null
CBMM/CBaaS
cbaas-lib/src/Parse.hs
bsd-3-clause
parseExpr :: T.Text -> Either T.Text (Expr ()) parseExpr t = first (T.pack . show) $ P.parse expr "expression" (T.unpack t)
123
parseExpr :: T.Text -> Either T.Text (Expr ()) parseExpr t = first (T.pack . show) $ P.parse expr "expression" (T.unpack t)
123
parseExpr t = first (T.pack . show) $ P.parse expr "expression" (T.unpack t)
76
false
true
0
9
20
68
33
35
null
null
wjt/bustle
Bustle/UI.hs
lgpl-2.1
openLog (SingleLog filepath) = do result <- readLog filepath return (result, ([], []))
94
openLog (SingleLog filepath) = do result <- readLog filepath return (result, ([], []))
94
openLog (SingleLog filepath) = do result <- readLog filepath return (result, ([], []))
94
false
false
0
10
20
48
23
25
null
null
farrellm/advent-2016
src/AdventPrelude.hs
mit
stepSearch :: forall a b. Ord b => (a -> [a]) -> (a -> Int) -> (a -> Bool) -> (a -> b) -> a -> [a] stepSearch s h g pi i = go (H.singleton (h i + 1, [i])) mempty where go :: MinPrioHeap Int [a] -> Set b -> [a] go (H.view -> Just ((_, p@(a:_)), q)) c | g a = p | otherwise = let ns = filter ((`notMember` c) . pi) (s a) l = length p ps = fmap (\n -> (l + 1 + h n, n : p)) ns in go (foldl' (flip H.insert) q ps) (foldl' (flip insertSet) c (map pi ns))
534
stepSearch :: forall a b. Ord b => (a -> [a]) -> (a -> Int) -> (a -> Bool) -> (a -> b) -> a -> [a] stepSearch s h g pi i = go (H.singleton (h i + 1, [i])) mempty where go :: MinPrioHeap Int [a] -> Set b -> [a] go (H.view -> Just ((_, p@(a:_)), q)) c | g a = p | otherwise = let ns = filter ((`notMember` c) . pi) (s a) l = length p ps = fmap (\n -> (l + 1 + h n, n : p)) ns in go (foldl' (flip H.insert) q ps) (foldl' (flip insertSet) c (map pi ns))
534
stepSearch s h g pi i = go (H.singleton (h i + 1, [i])) mempty where go :: MinPrioHeap Int [a] -> Set b -> [a] go (H.view -> Just ((_, p@(a:_)), q)) c | g a = p | otherwise = let ns = filter ((`notMember` c) . pi) (s a) l = length p ps = fmap (\n -> (l + 1 + h n, n : p)) ns in go (foldl' (flip H.insert) q ps) (foldl' (flip insertSet) c (map pi ns))
426
false
true
2
14
196
347
179
168
null
null
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
-- * Others defaultBridge :: String defaultBridge = "xen-br0"
62
defaultBridge :: String defaultBridge = "xen-br0"
49
defaultBridge = "xen-br0"
25
true
true
0
6
9
19
8
11
null
null
eddywestbrook/hobbits
src/Data/Binding/Hobbits/Examples/LambdaLifting.hs
bsd-3-clause
elemMC :: MbLName c a -> FVList c fvs -> Maybe (Member fvs a) elemMC _ MNil = Nothing
85
elemMC :: MbLName c a -> FVList c fvs -> Maybe (Member fvs a) elemMC _ MNil = Nothing
85
elemMC _ MNil = Nothing
23
false
true
0
10
18
50
22
28
null
null
fgaray/shakespeare
Text/Lucius.hs
mit
stringCI :: String -> Parser () stringCI [] = return ()
55
stringCI :: String -> Parser () stringCI [] = return ()
55
stringCI [] = return ()
23
false
true
0
8
10
35
15
20
null
null
thielema/gitit
Network/Gitit/Handlers.hs
gpl-2.0
showHistory :: String -> String -> Params -> Handler showHistory file page params = do fs <- getFileStore hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing) (Just $ pLimit params) base' <- getWikiBase let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos, strAttr "revision" (revId rev), strAttr "diffurl" (base' ++ "/_diff/" ++ page)] << [ thespan ! [theclass "date"] << (show $ revDateTime rev) , stringToHtml " (" , thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++ urlEncodeVars [("forUser", authorName $ revAuthor rev)]] << (authorName $ revAuthor rev) , stringToHtml "): " , anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] << thespan ! [theclass "subject"] << revDescription rev , noscript << ([ stringToHtml " [compare with " , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] << "previous" ] ++ (if pos /= 1 then [ primHtmlChar "nbsp" , primHtmlChar "bull" , primHtmlChar "nbsp" , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++ revId rev] << "current" ] else []) ++ [stringToHtml "]"]) ] let contents = if null hist then noHtml else ulist ! [theclass "history"] << zipWith versionToHtml hist [length hist, (length hist - 1)..1] let more = if length hist == pLimit params then anchor ! [href $ base' ++ "/_history" ++ urlForPage page ++ "?limit=" ++ show (pLimit params + 100)] << "Show more..." else noHtml let tabs = if file == page -- source file, not wiki page then [ViewTab,HistoryTab] else pgTabs defaultPageLayout formattedPage defaultPageLayout{ pgPageName = page, pgMessages = pMessages params, pgScripts = ["dragdiff.js"], pgTabs = tabs, pgSelectedTab = HistoryTab, pgTitle = ("Changes to " ++ page) } $ contents +++ more
2,556
showHistory :: String -> String -> Params -> Handler showHistory file page params = do fs <- getFileStore hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing) (Just $ pLimit params) base' <- getWikiBase let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos, strAttr "revision" (revId rev), strAttr "diffurl" (base' ++ "/_diff/" ++ page)] << [ thespan ! [theclass "date"] << (show $ revDateTime rev) , stringToHtml " (" , thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++ urlEncodeVars [("forUser", authorName $ revAuthor rev)]] << (authorName $ revAuthor rev) , stringToHtml "): " , anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] << thespan ! [theclass "subject"] << revDescription rev , noscript << ([ stringToHtml " [compare with " , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] << "previous" ] ++ (if pos /= 1 then [ primHtmlChar "nbsp" , primHtmlChar "bull" , primHtmlChar "nbsp" , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++ revId rev] << "current" ] else []) ++ [stringToHtml "]"]) ] let contents = if null hist then noHtml else ulist ! [theclass "history"] << zipWith versionToHtml hist [length hist, (length hist - 1)..1] let more = if length hist == pLimit params then anchor ! [href $ base' ++ "/_history" ++ urlForPage page ++ "?limit=" ++ show (pLimit params + 100)] << "Show more..." else noHtml let tabs = if file == page -- source file, not wiki page then [ViewTab,HistoryTab] else pgTabs defaultPageLayout formattedPage defaultPageLayout{ pgPageName = page, pgMessages = pMessages params, pgScripts = ["dragdiff.js"], pgTabs = tabs, pgSelectedTab = HistoryTab, pgTitle = ("Changes to " ++ page) } $ contents +++ more
2,556
showHistory file page params = do fs <- getFileStore hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing) (Just $ pLimit params) base' <- getWikiBase let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos, strAttr "revision" (revId rev), strAttr "diffurl" (base' ++ "/_diff/" ++ page)] << [ thespan ! [theclass "date"] << (show $ revDateTime rev) , stringToHtml " (" , thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++ urlEncodeVars [("forUser", authorName $ revAuthor rev)]] << (authorName $ revAuthor rev) , stringToHtml "): " , anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] << thespan ! [theclass "subject"] << revDescription rev , noscript << ([ stringToHtml " [compare with " , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] << "previous" ] ++ (if pos /= 1 then [ primHtmlChar "nbsp" , primHtmlChar "bull" , primHtmlChar "nbsp" , anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++ revId rev] << "current" ] else []) ++ [stringToHtml "]"]) ] let contents = if null hist then noHtml else ulist ! [theclass "history"] << zipWith versionToHtml hist [length hist, (length hist - 1)..1] let more = if length hist == pLimit params then anchor ! [href $ base' ++ "/_history" ++ urlForPage page ++ "?limit=" ++ show (pLimit params + 100)] << "Show more..." else noHtml let tabs = if file == page -- source file, not wiki page then [ViewTab,HistoryTab] else pgTabs defaultPageLayout formattedPage defaultPageLayout{ pgPageName = page, pgMessages = pMessages params, pgScripts = ["dragdiff.js"], pgTabs = tabs, pgSelectedTab = HistoryTab, pgTitle = ("Changes to " ++ page) } $ contents +++ more
2,503
false
true
0
26
1,078
694
355
339
null
null
fferreira/hnh
CPS.hs
gpl-3.0
linkL (i:is) (e:es) k = do k'<- linkL is es k cps e (i, k')
67
linkL (i:is) (e:es) k = do k'<- linkL is es k cps e (i, k')
67
linkL (i:is) (e:es) k = do k'<- linkL is es k cps e (i, k')
67
false
false
1
9
22
61
27
34
null
null
scvalex/logorrhea
lib/DrLogos/Parser.hs
bsd-3-clause
p_startHistory :: Parser BotMessage p_startHistory = StartHistory <$> (string "History for question " >> p_tag)
111
p_startHistory :: Parser BotMessage p_startHistory = StartHistory <$> (string "History for question " >> p_tag)
111
p_startHistory = StartHistory <$> (string "History for question " >> p_tag)
75
false
true
0
8
14
28
14
14
null
null
tweag/network-transport-zeromq
src/Network/Transport/ZMQ/Internal/Types.hs
bsd-3-clause
nextElement :: (Enum a, Ord a) => (b -> IO Bool) -> b -> Counter a b -> IO (Counter a b, (a, b)) nextElement t e c = nextElement' t (const e) c
191
nextElement :: (Enum a, Ord a) => (b -> IO Bool) -> b -> Counter a b -> IO (Counter a b, (a, b)) nextElement t e c = nextElement' t (const e) c
191
nextElement t e c = nextElement' t (const e) c
46
false
true
0
11
81
93
47
46
null
null
joe9/streaming-betfair-api
src/Betfair/StreamingAPI/API/Log.hs
mit
tracePPLog :: Pretty a => Context -> Direction -> a -> IO a tracePPLog c d s = (toLog c . displayPrettyPrefix d) s >> return s
130
tracePPLog :: Pretty a => Context -> Direction -> a -> IO a tracePPLog c d s = (toLog c . displayPrettyPrefix d) s >> return s
130
tracePPLog c d s = (toLog c . displayPrettyPrefix d) s >> return s
66
false
true
0
9
30
66
30
36
null
null
YoshikuniJujo/papillon
test/testCode.hs
bsd-3-clause
main :: IO () main = do args <- getArgs case args of ["-q"] -> print . ppr =<< runQ (quoteDec papillon test) _ -> putStrLn =<< papillonStr test
149
main :: IO () main = do args <- getArgs case args of ["-q"] -> print . ppr =<< runQ (quoteDec papillon test) _ -> putStrLn =<< papillonStr test
149
main = do args <- getArgs case args of ["-q"] -> print . ppr =<< runQ (quoteDec papillon test) _ -> putStrLn =<< papillonStr test
135
false
true
0
13
34
71
34
37
null
null
tolysz/postgresql-simple
src/Database/PostgreSQL/Simple/FromRow.hs
bsd-3-clause
field :: FromField a => RowParser a field = fieldWith fromField
63
field :: FromField a => RowParser a field = fieldWith fromField
63
field = fieldWith fromField
27
false
true
0
6
10
24
11
13
null
null
deech/stack
src/Stack/Types/Config.hs
bsd-3-clause
hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File) hoogleDatabasePath = do dir <- hoogleRoot return (dir </> $(mkRelFile "database.hoo")) -- | Path for platform followed by snapshot name followed by compiler -- name.
269
hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File) hoogleDatabasePath = do dir <- hoogleRoot return (dir </> $(mkRelFile "database.hoo")) -- | Path for platform followed by snapshot name followed by compiler -- name.
269
hoogleDatabasePath = do dir <- hoogleRoot return (dir </> $(mkRelFile "database.hoo")) -- | Path for platform followed by snapshot name followed by compiler -- name.
174
false
true
0
12
47
74
37
37
null
null
urbanslug/ghc
compiler/utils/ExtsCompat46.hs
bsd-3-clause
leWord# :: Word# -> Word# -> Bool leWord# a b = isTrue# (a `E.leWord#` b)
73
leWord# :: Word# -> Word# -> Bool leWord# a b = isTrue# (a `E.leWord#` b)
73
leWord# a b = isTrue# (a `E.leWord#` b)
39
false
true
0
7
14
38
20
18
null
null
alexbiehl/StringMap
tests/Dim2Test.hs
mit
lawLookupGE :: Point -> PointSet -> Bool lawLookupGE p ps = lawPointSetMorphism (lookupGE p) (lookupGE $ pToP' p) ps
116
lawLookupGE :: Point -> PointSet -> Bool lawLookupGE p ps = lawPointSetMorphism (lookupGE p) (lookupGE $ pToP' p) ps
116
lawLookupGE p ps = lawPointSetMorphism (lookupGE p) (lookupGE $ pToP' p) ps
75
false
true
0
8
18
47
23
24
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
emitCmmLitSwitch :: CmmExpr -- Tag to switch on -> [(Literal, CmmAGraph)] -- Tagged branches -> CmmAGraph -- Default branch (always) -> FCode () -- Emit the code -- Used for general literals, whose size might not be a word, -- where there is always a default case, and where we don't know -- the range of values for certain. For simplicity we always generate a tree. -- -- ToDo: for integers we could do better here, perhaps by generalising -- mk_switch and using that. --SDM 15/09/2004 emitCmmLitSwitch _scrut [] deflt = emit deflt
629
emitCmmLitSwitch :: CmmExpr -- Tag to switch on -> [(Literal, CmmAGraph)] -- Tagged branches -> CmmAGraph -- Default branch (always) -> FCode () emitCmmLitSwitch _scrut [] deflt = emit deflt
270
emitCmmLitSwitch _scrut [] deflt = emit deflt
51
true
true
0
10
189
63
36
27
null
null
arekfu/project_euler
p0061/p0061.hs
mit
testPermutation :: [Integer] -> [[Integer]] testPermutation perm = (foldr (.) id $ map (concatMap . stepOnList) perm) fourDigitOctagonals
137
testPermutation :: [Integer] -> [[Integer]] testPermutation perm = (foldr (.) id $ map (concatMap . stepOnList) perm) fourDigitOctagonals
137
testPermutation perm = (foldr (.) id $ map (concatMap . stepOnList) perm) fourDigitOctagonals
93
false
true
0
10
17
61
31
30
null
null
green-haskell/ghc
compiler/coreSyn/CoreUtils.hs
bsd-3-clause
exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e
74
exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e
74
exprIsTrivial (App e arg) = not (isRuntimeArg arg) && exprIsTrivial e
74
false
false
0
8
15
33
15
18
null
null
slpopejoy/fadno-xml
src/Fadno/MusicXml/MusicXml30.hs
bsd-2-clause
parseID :: String -> P.XParse ID parseID = return . fromString
62
parseID :: String -> P.XParse ID parseID = return . fromString
62
parseID = return . fromString
29
false
true
0
7
10
24
12
12
null
null
GaloisInc/galua
lib/macho/src/Data/Macho.hs
mit
r_type 11 CPU_TYPE_POWERPC64 = PPC_RELOC_LO16_SECTDIFF
54
r_type 11 CPU_TYPE_POWERPC64 = PPC_RELOC_LO16_SECTDIFF
54
r_type 11 CPU_TYPE_POWERPC64 = PPC_RELOC_LO16_SECTDIFF
54
false
false
0
5
4
11
5
6
null
null
Alex-Diez/haskell-tdd-kata
old-katas/src/BowlingKata/Day1.hs
bsd-3-clause
score (x:y:z:[]) = x + y + z
28
score (x:y:z:[]) = x + y + z
28
score (x:y:z:[]) = x + y + z
28
false
false
4
9
7
38
17
21
null
null
sdiehl/ghc
compiler/parser/ApiAnnotation.hs
bsd-3-clause
unicodeAnn AnnDarrow = AnnDarrowU
37
unicodeAnn AnnDarrow = AnnDarrowU
37
unicodeAnn AnnDarrow = AnnDarrowU
37
false
false
0
4
7
10
4
6
null
null
fmapfmapfmap/amazonka
amazonka-ml/gen/Network/AWS/MachineLearning/UpdateEvaluation.hs
mpl-2.0
-- | Creates a value of 'UpdateEvaluation' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ueEvaluationId' -- -- * 'ueEvaluationName' updateEvaluation :: Text -- ^ 'ueEvaluationId' -> Text -- ^ 'ueEvaluationName' -> UpdateEvaluation updateEvaluation pEvaluationId_ pEvaluationName_ = UpdateEvaluation' { _ueEvaluationId = pEvaluationId_ , _ueEvaluationName = pEvaluationName_ }
491
updateEvaluation :: Text -- ^ 'ueEvaluationId' -> Text -- ^ 'ueEvaluationName' -> UpdateEvaluation updateEvaluation pEvaluationId_ pEvaluationName_ = UpdateEvaluation' { _ueEvaluationId = pEvaluationId_ , _ueEvaluationName = pEvaluationName_ }
271
updateEvaluation pEvaluationId_ pEvaluationName_ = UpdateEvaluation' { _ueEvaluationId = pEvaluationId_ , _ueEvaluationName = pEvaluationName_ }
160
true
true
0
8
92
56
32
24
null
null
j5b/ps-pc
OutputModel.hs
gpl-3.0
modelToGraph (dom, us, bs) | length dom /= length (nub dom) = begin ++ "label = \"Domain contains duplicated individuals\" ;\n" ++ end | not $ isUnique us = begin ++ "label = \"Duplicated unary relation names exist\" ;\n" ++ end | not $ isUnique bs = begin ++ "label = \"Duplicated binary relation names exist\" ;\n" ++ end | otherwise = begin ++ concat ulabels ++ domOnlyToGraph (dom \\ unodes) ++ concatMap drawEdges bs ++ end where (unodes, ulabels) = unaryToGraph $ mapUnary us Map.empty begin = "digraph {\n " end = "}" -- Returns true if there is only 1 occurrence of the fst of the pairs in the list
664
modelToGraph (dom, us, bs) | length dom /= length (nub dom) = begin ++ "label = \"Domain contains duplicated individuals\" ;\n" ++ end | not $ isUnique us = begin ++ "label = \"Duplicated unary relation names exist\" ;\n" ++ end | not $ isUnique bs = begin ++ "label = \"Duplicated binary relation names exist\" ;\n" ++ end | otherwise = begin ++ concat ulabels ++ domOnlyToGraph (dom \\ unodes) ++ concatMap drawEdges bs ++ end where (unodes, ulabels) = unaryToGraph $ mapUnary us Map.empty begin = "digraph {\n " end = "}" -- Returns true if there is only 1 occurrence of the fst of the pairs in the list
664
modelToGraph (dom, us, bs) | length dom /= length (nub dom) = begin ++ "label = \"Domain contains duplicated individuals\" ;\n" ++ end | not $ isUnique us = begin ++ "label = \"Duplicated unary relation names exist\" ;\n" ++ end | not $ isUnique bs = begin ++ "label = \"Duplicated binary relation names exist\" ;\n" ++ end | otherwise = begin ++ concat ulabels ++ domOnlyToGraph (dom \\ unodes) ++ concatMap drawEdges bs ++ end where (unodes, ulabels) = unaryToGraph $ mapUnary us Map.empty begin = "digraph {\n " end = "}" -- Returns true if there is only 1 occurrence of the fst of the pairs in the list
664
false
false
3
11
169
179
87
92
null
null
nshepperd/funn
AI/Funn/CL/Buffer.hs
mit
malloc :: (MonadIO m, Storable a) => Int -> m (Buffer a) malloc n = fromMemSub <$> MemSub.malloc n
98
malloc :: (MonadIO m, Storable a) => Int -> m (Buffer a) malloc n = fromMemSub <$> MemSub.malloc n
98
malloc n = fromMemSub <$> MemSub.malloc n
41
false
true
2
10
18
56
26
30
null
null
uduki/hsQt
Qtc/Enums/Core/QLineF.hs
bsd-2-clause
ieIntersectType :: Int -> IntersectType ieIntersectType x = QEnum (CIntersectType x)
84
ieIntersectType :: Int -> IntersectType ieIntersectType x = QEnum (CIntersectType x)
84
ieIntersectType x = QEnum (CIntersectType x)
44
false
true
0
7
10
27
13
14
null
null
alessandroleite/hephaestus-pl
src/funsat-0.6.2/src/Funsat/Types/Internal.hs
lgpl-3.0
incNumDecisions = modify $ \s -> let st = stats s in s{ stats = st{numDecisions = numDecisions st + 1} }
106
incNumDecisions = modify $ \s -> let st = stats s in s{ stats = st{numDecisions = numDecisions st + 1} }
106
incNumDecisions = modify $ \s -> let st = stats s in s{ stats = st{numDecisions = numDecisions st + 1} }
106
false
false
0
14
23
52
27
25
null
null
tejon/diagrams-contrib
tests/Diagrams/TwoD/Path/Turtle/Tests.hs
bsd-3-clause
closeCurrentSingle :: TurtleState Double -> Property closeCurrentSingle t = (isPenDown t) ==> ((length . paths $ t') == (succ . length . paths $ t)) where t' = t # closeCurrent
180
closeCurrentSingle :: TurtleState Double -> Property closeCurrentSingle t = (isPenDown t) ==> ((length . paths $ t') == (succ . length . paths $ t)) where t' = t # closeCurrent
180
closeCurrentSingle t = (isPenDown t) ==> ((length . paths $ t') == (succ . length . paths $ t)) where t' = t # closeCurrent
127
false
true
0
11
34
76
39
37
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
-- data AnnTarget = ... valueAnnotationName, typeAnnotationName, moduleAnnotationName :: Name valueAnnotationName = libFun (fsLit "valueAnnotation") valueAnnotationIdKey
171
valueAnnotationName, typeAnnotationName, moduleAnnotationName :: Name valueAnnotationName = libFun (fsLit "valueAnnotation") valueAnnotationIdKey
147
valueAnnotationName = libFun (fsLit "valueAnnotation") valueAnnotationIdKey
77
true
true
0
7
17
27
16
11
null
null
abuiles/turbinado-blog
tmp/dependencies/utf8-string-0.3.3/Data/String/UTF8.hs
bsd-3-clause
-- | Traverse a bytestring (left biased). -- This fuction is strict in the accumulator. foldl :: UTF8Bytes string index => (a -> Char -> a) -> a -> UTF8 string -> a foldl add acc (Str cs) = G.foldl add acc cs
209
foldl :: UTF8Bytes string index => (a -> Char -> a) -> a -> UTF8 string -> a foldl add acc (Str cs) = G.foldl add acc cs
121
foldl add acc (Str cs) = G.foldl add acc cs
44
true
true
0
9
43
70
35
35
null
null
spl/generic-deriving-extras
src/Generics/Deriving/Zipper/Trace.hs
bsd-3-clause
modify :: Monad m => (a -> a) -> Loc a r c -> ZipperT m (Loc a r c) modify f = return . Base.modify f
101
modify :: Monad m => (a -> a) -> Loc a r c -> ZipperT m (Loc a r c) modify f = return . Base.modify f
101
modify f = return . Base.modify f
33
false
true
0
10
26
67
32
35
null
null
anttisalonen/starrover2
src/SpaceState/Common.hs
mit
-- accelerate :: (MonadState SpaceState m) => GLdouble -> m () accelerate a = modify $ modTri $ modifyAcceleration (const (0.0, a, 0.0))
137
accelerate a = modify $ modTri $ modifyAcceleration (const (0.0, a, 0.0))
74
accelerate a = modify $ modTri $ modifyAcceleration (const (0.0, a, 0.0))
74
true
false
0
9
23
36
19
17
null
null
bgold-cosmos/Tidal
src/Sound/Tidal/Params.hs
gpl-3.0
overshapeCountTo :: String -> Pattern Double -> Pattern ValueMap overshapeCountTo name ipat = innerJoin $ (\i -> pStateF "overshape" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
177
overshapeCountTo :: String -> Pattern Double -> Pattern ValueMap overshapeCountTo name ipat = innerJoin $ (\i -> pStateF "overshape" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
177
overshapeCountTo name ipat = innerJoin $ (\i -> pStateF "overshape" name (maybe 0 ((`mod'` i) . (+1)))) <$> ipat
112
false
true
2
13
27
84
43
41
null
null
WSCU/JSEuterpea
Euterpea Examples/SimpleEuterpea.hs
gpl-3.0
etInversion c@(Chord k r "major") = case r1 of 0 -> 0 4 -> 1 7 -> 2 _ -> error ("Bad base note in chord " ++ show c) where r1 = (r-k) `mod` 12
167
getInversion c@(Chord k r "major") = case r1 of 0 -> 0 4 -> 1 7 -> 2 _ -> error ("Bad base note in chord " ++ show c) where r1 = (r-k) `mod` 12
167
getInversion c@(Chord k r "major") = case r1 of 0 -> 0 4 -> 1 7 -> 2 _ -> error ("Bad base note in chord " ++ show c) where r1 = (r-k) `mod` 12
167
false
false
0
11
60
84
43
41
null
null
samscott89/tamarin-prover
lib/theory/src/Theory/Tools/IntruderRules.hs
gpl-3.0
privateConstructorEquations :: [StRule] -> [(LNTerm, ByteString)] privateConstructorEquations rs = case rs of [] -> [] (StRule lhs (RhsGround (viewTerm -> FApp (NoEq (vname,(0,Private))) []))):xs -> (lhs, vname):(privateConstructorEquations xs) _:xs -> privateConstructorEquations xs -- given equations with priavte constructors on the RHS and a list of private function names x, -- returns the list of all such constructors such that the LHS only contains public functions or functions in x
522
privateConstructorEquations :: [StRule] -> [(LNTerm, ByteString)] privateConstructorEquations rs = case rs of [] -> [] (StRule lhs (RhsGround (viewTerm -> FApp (NoEq (vname,(0,Private))) []))):xs -> (lhs, vname):(privateConstructorEquations xs) _:xs -> privateConstructorEquations xs -- given equations with priavte constructors on the RHS and a list of private function names x, -- returns the list of all such constructors such that the LHS only contains public functions or functions in x
522
privateConstructorEquations rs = case rs of [] -> [] (StRule lhs (RhsGround (viewTerm -> FApp (NoEq (vname,(0,Private))) []))):xs -> (lhs, vname):(privateConstructorEquations xs) _:xs -> privateConstructorEquations xs -- given equations with priavte constructors on the RHS and a list of private function names x, -- returns the list of all such constructors such that the LHS only contains public functions or functions in x
456
false
true
0
19
99
131
71
60
null
null
expipiplus1/vulkan
src/Vulkan/Extensions/VK_KHR_win32_surface.hs
bsd-3-clause
conNameWin32SurfaceCreateFlagsKHR :: String conNameWin32SurfaceCreateFlagsKHR = "Win32SurfaceCreateFlagsKHR"
108
conNameWin32SurfaceCreateFlagsKHR :: String conNameWin32SurfaceCreateFlagsKHR = "Win32SurfaceCreateFlagsKHR"
108
conNameWin32SurfaceCreateFlagsKHR = "Win32SurfaceCreateFlagsKHR"
64
false
true
0
4
5
11
6
5
null
null
mettekou/ghc
compiler/utils/Bag.hs
bsd-3-clause
foldlBagM k z (UnitBag x) = k z x
37
foldlBagM k z (UnitBag x) = k z x
37
foldlBagM k z (UnitBag x) = k z x
37
false
false
0
7
12
24
11
13
null
null
farnoy/torrent
src/Network/BitTorrent/Client.hs
bsd-3-clause
-- | Reach out to peer located at the address and enter the peer loop. reachOutToPeer :: GlobalState -> TorrentState -> SockAddr -> IO () reachOutToPeer globalState state addr = do sock <- socket AF_INET Stream defaultProtocol connect sock addr -- handle <- socketToHandle sock ReadWriteMode writeHandshake sock globalState state handshake <- readHandshake sock case handshake of Just (BHandshake hisInfoHash hisId) -> do let ourInfoHash = infoHash $ torrentStateMetaInfo state bitField = BF.newBitField (pieceCount state) when (hisInfoHash == ourInfoHash) $ do let pData = newPeer bitField addr hisId mainPeerLoop state pData sock pure () Nothing -> close sock
730
reachOutToPeer :: GlobalState -> TorrentState -> SockAddr -> IO () reachOutToPeer globalState state addr = do sock <- socket AF_INET Stream defaultProtocol connect sock addr -- handle <- socketToHandle sock ReadWriteMode writeHandshake sock globalState state handshake <- readHandshake sock case handshake of Just (BHandshake hisInfoHash hisId) -> do let ourInfoHash = infoHash $ torrentStateMetaInfo state bitField = BF.newBitField (pieceCount state) when (hisInfoHash == ourInfoHash) $ do let pData = newPeer bitField addr hisId mainPeerLoop state pData sock pure () Nothing -> close sock
659
reachOutToPeer globalState state addr = do sock <- socket AF_INET Stream defaultProtocol connect sock addr -- handle <- socketToHandle sock ReadWriteMode writeHandshake sock globalState state handshake <- readHandshake sock case handshake of Just (BHandshake hisInfoHash hisId) -> do let ourInfoHash = infoHash $ torrentStateMetaInfo state bitField = BF.newBitField (pieceCount state) when (hisInfoHash == ourInfoHash) $ do let pData = newPeer bitField addr hisId mainPeerLoop state pData sock pure () Nothing -> close sock
592
true
true
0
19
166
200
89
111
null
null
banacorn/mini-pascal
src/Compiler/PreAST/Type.hs
mit
merge :: Program a b -> Program c d -> Program a d merge (Program d0 s0) (Program _ s1) = Program d0 (map (uncurry mergeSubprogram) (zip s0 s1)) where mergeSubprogram (Subprogram d0 _) (Subprogram _ c1) = Subprogram d0 c1
235
merge :: Program a b -> Program c d -> Program a d merge (Program d0 s0) (Program _ s1) = Program d0 (map (uncurry mergeSubprogram) (zip s0 s1)) where mergeSubprogram (Subprogram d0 _) (Subprogram _ c1) = Subprogram d0 c1
235
merge (Program d0 s0) (Program _ s1) = Program d0 (map (uncurry mergeSubprogram) (zip s0 s1)) where mergeSubprogram (Subprogram d0 _) (Subprogram _ c1) = Subprogram d0 c1
184
false
true
0
10
54
121
56
65
null
null
j3h/doc-review
src/Report.hs
bsd-3-clause
analyzeFiles :: ReportConfig -> IO CommentStats analyzeFiles (ReportConfig filenames) = foldM (\s fn -> s `seq` (mappend s <$> getStats fn)) mempty filenames
159
analyzeFiles :: ReportConfig -> IO CommentStats analyzeFiles (ReportConfig filenames) = foldM (\s fn -> s `seq` (mappend s <$> getStats fn)) mempty filenames
159
analyzeFiles (ReportConfig filenames) = foldM (\s fn -> s `seq` (mappend s <$> getStats fn)) mempty filenames
111
false
true
0
11
24
63
32
31
null
null
mrkkrp/stack
src/Stack/Types/TemplateName.hs
bsd-3-clause
templateNameArgument :: O.Mod O.ArgumentFields TemplateName -> O.Parser TemplateName templateNameArgument = O.argument (do string <- O.str either O.readerError return (parseTemplateNameFromString string))
249
templateNameArgument :: O.Mod O.ArgumentFields TemplateName -> O.Parser TemplateName templateNameArgument = O.argument (do string <- O.str either O.readerError return (parseTemplateNameFromString string))
249
templateNameArgument = O.argument (do string <- O.str either O.readerError return (parseTemplateNameFromString string))
143
false
true
0
11
64
64
30
34
null
null
julienschmaltz/madl
src/Parser/ASTTranslator.hs
mit
getProcess context pcontext (s:ss) (nrmap, ts) = getProcess context pcontext (ss++newStates) (nrmap', ts ++ newTransitions) where (nrmap', newTransitions) = unfoldProcessState context pcontext nrmap s newStates = Map.keys $ Map.difference nrmap' nrmap -- | Get a process specification from a single state
313
getProcess context pcontext (s:ss) (nrmap, ts) = getProcess context pcontext (ss++newStates) (nrmap', ts ++ newTransitions) where (nrmap', newTransitions) = unfoldProcessState context pcontext nrmap s newStates = Map.keys $ Map.difference nrmap' nrmap -- | Get a process specification from a single state
313
getProcess context pcontext (s:ss) (nrmap, ts) = getProcess context pcontext (ss++newStates) (nrmap', ts ++ newTransitions) where (nrmap', newTransitions) = unfoldProcessState context pcontext nrmap s newStates = Map.keys $ Map.difference nrmap' nrmap -- | Get a process specification from a single state
313
false
false
0
9
49
96
51
45
null
null
chadbrewbaker/combinat
Math/Combinat/Numbers/Series.hs
bsd-3-clause
rop_conv3_vs_gen exp1 exp2 exp3 ser = (one =!= two) where one = convolveWithPSeries3 k1 k2 k3 xs two = convolveWithPSeries [k2,k3,k1] xs k1 = fromExp exp1 k2 = fromExp exp2 k3 = fromExp exp3 xs = fromSer ser
223
prop_conv3_vs_gen exp1 exp2 exp3 ser = (one =!= two) where one = convolveWithPSeries3 k1 k2 k3 xs two = convolveWithPSeries [k2,k3,k1] xs k1 = fromExp exp1 k2 = fromExp exp2 k3 = fromExp exp3 xs = fromSer ser
223
prop_conv3_vs_gen exp1 exp2 exp3 ser = (one =!= two) where one = convolveWithPSeries3 k1 k2 k3 xs two = convolveWithPSeries [k2,k3,k1] xs k1 = fromExp exp1 k2 = fromExp exp2 k3 = fromExp exp3 xs = fromSer ser
223
false
false
0
6
53
88
46
42
null
null
copton/ocram
ruab/src/Ruab/Util.hs
gpl-2.0
-- util {{{1 internalError :: String -> String -> a internalError where_ what = let message = "internal error: " ++ where_ ++ ": " ++ what l = length message border = "+" ++ replicate (l+2) '-' ++ "+" text = "\n" ++ border ++ "\n| " ++ message ++ " |\n" ++ border ++ "\n" in error text
309
internalError :: String -> String -> a internalError where_ what = let message = "internal error: " ++ where_ ++ ": " ++ what l = length message border = "+" ++ replicate (l+2) '-' ++ "+" text = "\n" ++ border ++ "\n| " ++ message ++ " |\n" ++ border ++ "\n" in error text
296
internalError where_ what = let message = "internal error: " ++ where_ ++ ": " ++ what l = length message border = "+" ++ replicate (l+2) '-' ++ "+" text = "\n" ++ border ++ "\n| " ++ message ++ " |\n" ++ border ++ "\n" in error text
257
true
true
0
14
83
113
57
56
null
null
mightybyte/cabal
cabal-install/Main.hs
bsd-3-clause
unpackAction :: GetFlags -> [String] -> GlobalFlags -> IO () unpackAction getFlags extraArgs globalFlags = do getAction getFlags extraArgs globalFlags
152
unpackAction :: GetFlags -> [String] -> GlobalFlags -> IO () unpackAction getFlags extraArgs globalFlags = do getAction getFlags extraArgs globalFlags
152
unpackAction getFlags extraArgs globalFlags = do getAction getFlags extraArgs globalFlags
91
false
true
0
9
21
48
23
25
null
null
henrytill/hecate
src/Hecate/Backend/JSON/AppState.hs
apache-2.0
queryFolder q d es acc | Just True <- descMatches = filterEntries idenMatches es ++ acc | otherwise = acc where descMatches = descIsInfixOf <$> queryDescription q <*> pure d idenMatches = idenMatcher (queryIdentity q)
246
queryFolder q d es acc | Just True <- descMatches = filterEntries idenMatches es ++ acc | otherwise = acc where descMatches = descIsInfixOf <$> queryDescription q <*> pure d idenMatches = idenMatcher (queryIdentity q)
246
queryFolder q d es acc | Just True <- descMatches = filterEntries idenMatches es ++ acc | otherwise = acc where descMatches = descIsInfixOf <$> queryDescription q <*> pure d idenMatches = idenMatcher (queryIdentity q)
246
false
false
1
9
63
82
37
45
null
null
spechub/Hets
CSL/GenericInterpreter.hs
gpl-2.0
transDef :: MonadState (ASState s) as => AssDefinition -> as AssDefinition transDef (FunDef l e) = liftM (uncurry FunDef) $ transExprWithVars l e
145
transDef :: MonadState (ASState s) as => AssDefinition -> as AssDefinition transDef (FunDef l e) = liftM (uncurry FunDef) $ transExprWithVars l e
145
transDef (FunDef l e) = liftM (uncurry FunDef) $ transExprWithVars l e
70
false
true
0
10
22
66
30
36
null
null
brendanhay/gogol
gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs
mpl-2.0
-- | Creates a value of 'Link' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'lURI' link :: Link link = Link' {_lURI = Nothing}
218
link :: Link link = Link' {_lURI = Nothing}
47
link = Link' {_lURI = Nothing}
30
true
true
0
7
46
34
18
16
null
null
mahrz/xxp
core/lib-src/XXP/PostProcessing/Logs.hs
mit
ssh HPCConfig{..} f = "ssh " ++ userName ++ "@" ++ headnodeServer ++ " '" ++ f ++ "'"
103
ssh HPCConfig{..} f = "ssh " ++ userName ++ "@" ++ headnodeServer ++ " '" ++ f ++ "'"
103
ssh HPCConfig{..} f = "ssh " ++ userName ++ "@" ++ headnodeServer ++ " '" ++ f ++ "'"
103
false
false
1
12
36
48
21
27
null
null
tcsavage/lazy-compiler
src/STG/ViaC.hs
mit
buildPrimCall self prim [a1, a2@(AtomVar a2var)] = do buildAtomPush self a2 buildEvalAtomPush self a1 $ do popVar a2var tempName <- ("temp_"++) <$> genUnique pushReg tempName IntReturn buildEvalAtomPush self a2 $ do tempName2 <- ("temp_"++) <$> genUnique pushReg tempName2 IntReturn append $ Code $ printf "JUMP(%s)" $ primMap prim -- | Simple mapping of primops to entry code names.
460
buildPrimCall self prim [a1, a2@(AtomVar a2var)] = do buildAtomPush self a2 buildEvalAtomPush self a1 $ do popVar a2var tempName <- ("temp_"++) <$> genUnique pushReg tempName IntReturn buildEvalAtomPush self a2 $ do tempName2 <- ("temp_"++) <$> genUnique pushReg tempName2 IntReturn append $ Code $ printf "JUMP(%s)" $ primMap prim -- | Simple mapping of primops to entry code names.
460
buildPrimCall self prim [a1, a2@(AtomVar a2var)] = do buildAtomPush self a2 buildEvalAtomPush self a1 $ do popVar a2var tempName <- ("temp_"++) <$> genUnique pushReg tempName IntReturn buildEvalAtomPush self a2 $ do tempName2 <- ("temp_"++) <$> genUnique pushReg tempName2 IntReturn append $ Code $ printf "JUMP(%s)" $ primMap prim -- | Simple mapping of primops to entry code names.
460
false
false
0
15
134
134
62
72
null
null
wskplho/stack
src/Stack/Setup.hs
bsd-3-clause
getSystemGHC :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> m (Maybe (Version, Arch)) getSystemGHC menv = do exists <- doesExecutableExist menv "ghc" if exists then do eres <- tryProcessStdout Nothing menv "ghc" ["--info"] return $ do Right bs <- Just eres pairs <- readMay $ S8.unpack bs :: Maybe [(String, String)] version <- lookup "Project version" pairs >>= parseVersionFromString arch <- lookup "Target platform" pairs >>= simpleParse . takeWhile (/= '-') Just (version, arch) else return Nothing
668
getSystemGHC :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m) => EnvOverride -> m (Maybe (Version, Arch)) getSystemGHC menv = do exists <- doesExecutableExist menv "ghc" if exists then do eres <- tryProcessStdout Nothing menv "ghc" ["--info"] return $ do Right bs <- Just eres pairs <- readMay $ S8.unpack bs :: Maybe [(String, String)] version <- lookup "Project version" pairs >>= parseVersionFromString arch <- lookup "Target platform" pairs >>= simpleParse . takeWhile (/= '-') Just (version, arch) else return Nothing
668
getSystemGHC menv = do exists <- doesExecutableExist menv "ghc" if exists then do eres <- tryProcessStdout Nothing menv "ghc" ["--info"] return $ do Right bs <- Just eres pairs <- readMay $ S8.unpack bs :: Maybe [(String, String)] version <- lookup "Project version" pairs >>= parseVersionFromString arch <- lookup "Target platform" pairs >>= simpleParse . takeWhile (/= '-') Just (version, arch) else return Nothing
544
false
true
0
16
209
213
103
110
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | The experiment used to generate this read group. reaExperiment :: Lens' ReadGroup (Maybe Experiment) reaExperiment = lens _reaExperiment (\ s a -> s{_reaExperiment = a})
182
reaExperiment :: Lens' ReadGroup (Maybe Experiment) reaExperiment = lens _reaExperiment (\ s a -> s{_reaExperiment = a})
128
reaExperiment = lens _reaExperiment (\ s a -> s{_reaExperiment = a})
76
true
true
0
9
34
48
25
23
null
null
mpickering/hlint
src/Util.hs
bsd-3-clause
readFileEncoding :: Encoding -> FilePath -> IO String readFileEncoding enc file = do h <- if file == "-" then return stdin else openFile file ReadMode useEncoding h enc hGetContents h -- | Create an encoding from a string, or throw an error if the encoding is not known. -- Accepts many encodings including @locale@, @utf-8@ and all those supported by the -- GHC @mkTextEncoding@ function.
407
readFileEncoding :: Encoding -> FilePath -> IO String readFileEncoding enc file = do h <- if file == "-" then return stdin else openFile file ReadMode useEncoding h enc hGetContents h -- | Create an encoding from a string, or throw an error if the encoding is not known. -- Accepts many encodings including @locale@, @utf-8@ and all those supported by the -- GHC @mkTextEncoding@ function.
407
readFileEncoding enc file = do h <- if file == "-" then return stdin else openFile file ReadMode useEncoding h enc hGetContents h -- | Create an encoding from a string, or throw an error if the encoding is not known. -- Accepts many encodings including @locale@, @utf-8@ and all those supported by the -- GHC @mkTextEncoding@ function.
353
false
true
0
10
83
76
35
41
null
null
chrisdotcode/hackage-server
Distribution/Server/Framework/BackupRestore.hs
bsd-3-clause
lookupBlobWritten :: String -> Import (Maybe BlobId) lookupBlobWritten blobidstr = gets (Map.lookup blobidstr . importBlobsWritten)
131
lookupBlobWritten :: String -> Import (Maybe BlobId) lookupBlobWritten blobidstr = gets (Map.lookup blobidstr . importBlobsWritten)
131
lookupBlobWritten blobidstr = gets (Map.lookup blobidstr . importBlobsWritten)
78
false
true
0
9
14
42
20
22
null
null
athanclark/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
showDeclImp o (PTy _ _ _ _ _ n _ t) = text "tydecl" <+> text (showCG n) <+> colon <+> prettyImp o t
99
showDeclImp o (PTy _ _ _ _ _ n _ t) = text "tydecl" <+> text (showCG n) <+> colon <+> prettyImp o t
99
showDeclImp o (PTy _ _ _ _ _ n _ t) = text "tydecl" <+> text (showCG n) <+> colon <+> prettyImp o t
99
false
false
0
10
23
62
28
34
null
null
dmcclean/HaTeX
Text/LaTeX/Base/Parser.hs
bsd-3-clause
envBody :: String -> Parser LaTeX envBody n = mconcat <$> (bodyBlock n) `manyTill` endenv where endenv = try $ string ("\\end") >> spaces >> string ("{" <> n <> "}")
167
envBody :: String -> Parser LaTeX envBody n = mconcat <$> (bodyBlock n) `manyTill` endenv where endenv = try $ string ("\\end") >> spaces >> string ("{" <> n <> "}")
167
envBody n = mconcat <$> (bodyBlock n) `manyTill` endenv where endenv = try $ string ("\\end") >> spaces >> string ("{" <> n <> "}")
133
false
true
0
9
32
77
39
38
null
null
karamellpelle/grid
source/Game/GUI/Widget/Output.hs
gpl-3.0
useTex :: GUIData -> GUIState -> GLuint -> IO () useTex gd gs tex = do glUniform1i (guiShadeUniUseTex $ guistateGUIShade gs) $ fI gl_TRUE glActiveTexture gl_TEXTURE0 glBindTexture gl_TEXTURE_2D tex
209
useTex :: GUIData -> GUIState -> GLuint -> IO () useTex gd gs tex = do glUniform1i (guiShadeUniUseTex $ guistateGUIShade gs) $ fI gl_TRUE glActiveTexture gl_TEXTURE0 glBindTexture gl_TEXTURE_2D tex
209
useTex gd gs tex = do glUniform1i (guiShadeUniUseTex $ guistateGUIShade gs) $ fI gl_TRUE glActiveTexture gl_TEXTURE0 glBindTexture gl_TEXTURE_2D tex
160
false
true
0
11
40
72
32
40
null
null
ojw/relaxation
src/Main.hs
mit
exhaleTo = 20
13
exhaleTo = 20
13
exhaleTo = 20
13
false
false
1
5
2
10
3
7
null
null
frontrowed/stratosphere
library-gen/Stratosphere/ResourceProperties/CloudFrontStreamingDistributionStreamingDistributionConfig.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-aliases cfsdsdcAliases :: Lens' CloudFrontStreamingDistributionStreamingDistributionConfig (Maybe (ValList Text)) cfsdsdcAliases = lens _cloudFrontStreamingDistributionStreamingDistributionConfigAliases (\s a -> s { _cloudFrontStreamingDistributionStreamingDistributionConfigAliases = a })
502
cfsdsdcAliases :: Lens' CloudFrontStreamingDistributionStreamingDistributionConfig (Maybe (ValList Text)) cfsdsdcAliases = lens _cloudFrontStreamingDistributionStreamingDistributionConfigAliases (\s a -> s { _cloudFrontStreamingDistributionStreamingDistributionConfigAliases = a })
281
cfsdsdcAliases = lens _cloudFrontStreamingDistributionStreamingDistributionConfigAliases (\s a -> s { _cloudFrontStreamingDistributionStreamingDistributionConfigAliases = a })
175
true
true
0
9
22
52
28
24
null
null
wavewave/hxournal
lib/Application/HXournal/ModelAction/Select.hs
bsd-2-clause
isSame _ = False
16
isSame _ = False
16
isSame _ = False
16
false
false
0
5
3
9
4
5
null
null
technogeeky/d-A
include/containers-0.5.0.0/Data/IntMap/Strict.hs
gpl-3.0
{-------------------------------------------------------------------- MergeWithKey --------------------------------------------------------------------} -- | /O(n+m)/. A high-performance universal combining function. Using -- 'mergeWithKey', all combining functions can be defined without any loss of -- efficiency (with exception of 'union', 'difference' and 'intersection', -- where sharing of some nodes is lost with 'mergeWithKey'). -- -- Please make sure you know what is going on when using 'mergeWithKey', -- otherwise you can be surprised by unexpected code growth or even -- corruption of the data structure. -- -- When 'mergeWithKey' is given three arguments, it is inlined to the call -- site. You should therefore use 'mergeWithKey' only to define your custom -- combining functions. For example, you could define 'unionWithKey', -- 'differenceWithKey' and 'intersectionWithKey' as -- -- > myUnionWithKey f m1 m2 = mergeWithKey (\k x1 x2 -> Just (f k x1 x2)) id id m1 m2 -- > myDifferenceWithKey f m1 m2 = mergeWithKey f id (const empty) m1 m2 -- > myIntersectionWithKey f m1 m2 = mergeWithKey (\k x1 x2 -> Just (f k x1 x2)) (const empty) (const empty) m1 m2 -- -- When calling @'mergeWithKey' combine only1 only2@, a function combining two -- 'IntMap's is created, such that -- -- * if a key is present in both maps, it is passed with both corresponding -- values to the @combine@ function. Depending on the result, the key is either -- present in the result with specified value, or is left out; -- -- * a nonempty subtree present only in the first map is passed to @only1@ and -- the output is added to the result; -- -- * a nonempty subtree present only in the second map is passed to @only2@ and -- the output is added to the result. -- -- The @only1@ and @only2@ methods /must return a map with a subset (possibly empty) of the keys of the given map/. -- The values can be modified arbitrarily. Most common variants of @only1@ and -- @only2@ are 'id' and @'const' 'empty'@, but for example @'map' f@ or -- @'filterWithKey' f@ could be used for any @f@. mergeWithKey :: (Key -> a -> b -> Maybe c) -> (IntMap a -> IntMap c) -> (IntMap b -> IntMap c) -> IntMap a -> IntMap b -> IntMap c mergeWithKey f g1 g2 = mergeWithKey' bin combine g1 g2 where -- We use the lambda form to avoid non-exhaustive pattern matches warning. combine = \(Tip k1 x1) (Tip _k2 x2) -> case f k1 x1 x2 of Nothing -> Nil Just x -> x `seq` Tip k1 x {-# INLINE combine #-}
2,571
mergeWithKey :: (Key -> a -> b -> Maybe c) -> (IntMap a -> IntMap c) -> (IntMap b -> IntMap c) -> IntMap a -> IntMap b -> IntMap c mergeWithKey f g1 g2 = mergeWithKey' bin combine g1 g2 where -- We use the lambda form to avoid non-exhaustive pattern matches warning. combine = \(Tip k1 x1) (Tip _k2 x2) -> case f k1 x1 x2 of Nothing -> Nil Just x -> x `seq` Tip k1 x {-# INLINE combine #-}
487
mergeWithKey f g1 g2 = mergeWithKey' bin combine g1 g2 where -- We use the lambda form to avoid non-exhaustive pattern matches warning. combine = \(Tip k1 x1) (Tip _k2 x2) -> case f k1 x1 x2 of Nothing -> Nil Just x -> x `seq` Tip k1 x {-# INLINE combine #-}
343
true
true
0
10
537
206
119
87
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
620 = 619
9
620 = 619
9
620 = 619
9
false
false
1
5
2
10
3
7
null
null
elginer/shpider
Network/Shpider/Curl/Opts.hs
mit
baseLong :: Int baseLong = 0
28
baseLong :: Int baseLong = 0
28
baseLong = 0
12
false
true
0
4
5
11
6
5
null
null
futtetennista/IntroductionToFunctionalProgramming
RWH/src/Ch22/PodParser.hs
mit
channel :: CFilter a channel = tag "rss" /> tag "channel"
59
channel :: CFilter a channel = tag "rss" /> tag "channel"
59
channel = tag "rss" /> tag "channel"
38
false
true
0
6
12
24
11
13
null
null
jbracker/supermonad-plugin
src/Control/Super/Monad/Constrained/Functions.hs
bsd-3-clause
- | When the condition is true do the given action. whenA :: ( Return n, ReturnCts n () , Applicative m n n, ApplicativeCtsR m n n () () ) => Bool -> m () -> n () whenA True s = voidA s
205
whenA :: ( Return n, ReturnCts n () , Applicative m n n, ApplicativeCtsR m n n () () ) => Bool -> m () -> n () whenA True s = voidA s
152
whenA True s = voidA s
23
true
true
5
12
64
120
55
65
null
null
izgzhen/hadrian
src/Settings.hs
mit
getDestDir :: Action FilePath getDestDir = fromMaybe "" <$> cmdInstallDestDir
77
getDestDir :: Action FilePath getDestDir = fromMaybe "" <$> cmdInstallDestDir
77
getDestDir = fromMaybe "" <$> cmdInstallDestDir
47
false
true
0
6
9
27
11
16
null
null
erochest/orchestrate
src/Database/Orchestrate/KeyValue.hs
apache-2.0
putV :: OrchestrateData v => v -- ^ The data to store in the database. -> IfMatch -- ^ If specified, this operation only succeeds -- if the ref specified matches the -- currently stored ref for this data. -> OrchestrateIO Location -- ^ Returns the location of the data. putV v = putKV (dataKey v) v
431
putV :: OrchestrateData v => v -- ^ The data to store in the database. -> IfMatch -- ^ If specified, this operation only succeeds -- if the ref specified matches the -- currently stored ref for this data. -> OrchestrateIO Location putV v = putKV (dataKey v) v
388
putV v = putKV (dataKey v) v
28
true
true
0
8
189
48
25
23
null
null
gergoerdi/brainfuck
language-registermachine/src/Language/RegisterMachine/Parser.hs
bsd-3-clause
whiteSpace :: Parser () whiteSpace = skipMany inlineSpace
57
whiteSpace :: Parser () whiteSpace = skipMany inlineSpace
57
whiteSpace = skipMany inlineSpace
33
false
true
0
6
7
19
9
10
null
null