Search is not available for this dataset
repo_name
string
path
string
license
string
full_code
string
full_size
int64
uncommented_code
string
uncommented_size
int64
function_only_code
string
function_only_size
int64
is_commented
bool
is_signatured
bool
n_ast_errors
int64
ast_max_depth
int64
n_whitespaces
int64
n_ast_nodes
int64
n_ast_terminals
int64
n_ast_nonterminals
int64
loc
int64
cycloplexity
int64
ezyang/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
showParen_Expr :: LHsExpr GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs showParen_Expr e1 e2 = nlHsApp (nlHsApp (nlHsVar showParen_RDR) e1) e2
153
showParen_Expr :: LHsExpr GhcPs -> LHsExpr GhcPs -> LHsExpr GhcPs showParen_Expr e1 e2 = nlHsApp (nlHsApp (nlHsVar showParen_RDR) e1) e2
152
showParen_Expr e1 e2 = nlHsApp (nlHsApp (nlHsVar showParen_RDR) e1) e2
70
false
true
0
9
36
52
24
28
null
null
uuhan/Idris-dev
src/Idris/ElabDecls.hs
bsd-3-clause
elabDecl' what info (PImplementation doc argDocs s f cs pnames acc fnopts n nfc ps pextra t expn ds) = do logElab 1 $ "Elaborating implementation " ++ show n elabImplementation info s doc argDocs what f cs pnames acc fnopts n nfc ps pextra t expn ds
262
elabDecl' what info (PImplementation doc argDocs s f cs pnames acc fnopts n nfc ps pextra t expn ds) = do logElab 1 $ "Elaborating implementation " ++ show n elabImplementation info s doc argDocs what f cs pnames acc fnopts n nfc ps pextra t expn ds
262
elabDecl' what info (PImplementation doc argDocs s f cs pnames acc fnopts n nfc ps pextra t expn ds) = do logElab 1 $ "Elaborating implementation " ++ show n elabImplementation info s doc argDocs what f cs pnames acc fnopts n nfc ps pextra t expn ds
262
false
false
0
9
60
105
48
57
null
null
sdiehl/picologic
src/Picologic/Tseitin.hs
mit
dropTseitinVars :: [Expr] -> [Expr] dropTseitinVars = filter (\x -> not $ isTseitinLiteral x)
93
dropTseitinVars :: [Expr] -> [Expr] dropTseitinVars = filter (\x -> not $ isTseitinLiteral x)
93
dropTseitinVars = filter (\x -> not $ isTseitinLiteral x)
57
false
true
0
9
13
39
21
18
null
null
zalora/Angel
src/Angel/Process.hs
bsd-3-clause
withPid :: (ProcessID -> IO a) -> ProcessHandle -> IO (Maybe a) withPid action ph = withProcessHandle ph callback where callback (ClosedHandle _) = return Nothing callback (OpenHandle pid) = do res <- action pid return (Just res)
278
withPid :: (ProcessID -> IO a) -> ProcessHandle -> IO (Maybe a) withPid action ph = withProcessHandle ph callback where callback (ClosedHandle _) = return Nothing callback (OpenHandle pid) = do res <- action pid return (Just res)
278
withPid action ph = withProcessHandle ph callback where callback (ClosedHandle _) = return Nothing callback (OpenHandle pid) = do res <- action pid return (Just res)
214
false
true
1
10
86
103
48
55
null
null
thoughtpolice/cabal
Cabal/Distribution/Simple/Command.hs
bsd-3-clause
noExtraFlags :: [String] -> IO () noExtraFlags [] = return ()
61
noExtraFlags :: [String] -> IO () noExtraFlags [] = return ()
61
noExtraFlags [] = return ()
27
false
true
0
8
10
38
17
21
null
null
jfischoff/tuple-lenses
src/Data/Tuple/Lens/TH.hs
bsd-3-clause
tl :: [Int] -> Q Exp tl = mkLens
32
tl :: [Int] -> Q Exp tl = mkLens
32
tl = mkLens
11
false
true
0
7
8
27
12
15
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
obsequiously = id
17
obsequiously = id
17
obsequiously = id
17
false
false
0
4
2
6
3
3
null
null
mankyKitty/TypePlay
src/TypePlay/Infer/HM.hs
mit
tUnit = typeConst "()" Star
30
tUnit = typeConst "()" Star
30
tUnit = typeConst "()" Star
30
false
false
0
5
7
11
5
6
null
null
smobs/elblog
server/psgen/Main.hs
bsd-3-clause
commandTypes :: [SumType 'Haskell] commandTypes = [ mkSumType (Proxy :: Proxy GameCommand) , mkSumType (Proxy :: Proxy Direction) , mkSumType (Proxy :: Proxy ConfigurationCommand)]
210
commandTypes :: [SumType 'Haskell] commandTypes = [ mkSumType (Proxy :: Proxy GameCommand) , mkSumType (Proxy :: Proxy Direction) , mkSumType (Proxy :: Proxy ConfigurationCommand)]
210
commandTypes = [ mkSumType (Proxy :: Proxy GameCommand) , mkSumType (Proxy :: Proxy Direction) , mkSumType (Proxy :: Proxy ConfigurationCommand)]
175
false
true
0
8
53
64
34
30
null
null
quyse/flaw
flaw-oil/Flaw/Oil/ClientRepo.hs
mit
changeKeyItemRevisionValue :: ClientRepo -> ItemId -> Revision -> B.ByteString -> IO () changeKeyItemRevisionValue ClientRepo { clientRepoStmtChangeKeyItemRevValue = stmtChangeKeyItemRevValue } itemId newRevision newValue = sqliteQuery stmtChangeKeyItemRevValue $ \query -> do sqliteBind query 1 itemId sqliteBin...
440
changeKeyItemRevisionValue :: ClientRepo -> ItemId -> Revision -> B.ByteString -> IO () changeKeyItemRevisionValue ClientRepo { clientRepoStmtChangeKeyItemRevValue = stmtChangeKeyItemRevValue } itemId newRevision newValue = sqliteQuery stmtChangeKeyItemRevValue $ \query -> do sqliteBind query 1 itemId sqliteBin...
440
changeKeyItemRevisionValue ClientRepo { clientRepoStmtChangeKeyItemRevValue = stmtChangeKeyItemRevValue } itemId newRevision newValue = sqliteQuery stmtChangeKeyItemRevValue $ \query -> do sqliteBind query 1 itemId sqliteBind query 2 newRevision sqliteBind query 3 newValue sqliteFinalStep query -- | Collec...
352
false
true
0
10
64
101
47
54
null
null
rvion/ride
jetpack/src/System/Console/ANSI/AsAnsi.hs
bsd-3-clause
-- ansi_cursorBackwardCode :: Int -> String ansi_cursorBackwardCode = I.cursorBackwardCode
90
ansi_cursorBackwardCode = I.cursorBackwardCode
46
ansi_cursorBackwardCode = I.cursorBackwardCode
46
true
false
1
6
8
13
5
8
null
null
begriffs/graph-rtce
src/Server.hs
mit
app :: IO Application app = scottyApp $ do middleware logStdoutDev middleware (gzip def) get "/js/app.js" $ js "js/app.js" get "/" $ blaze Pages.Index.render where blaze = html . renderHtml js f = file f >> setHeader "content-type" "text/javascript" --css f = file f >> setH...
388
app :: IO Application app = scottyApp $ do middleware logStdoutDev middleware (gzip def) get "/js/app.js" $ js "js/app.js" get "/" $ blaze Pages.Index.render where blaze = html . renderHtml js f = file f >> setHeader "content-type" "text/javascript" --css f = file f >> setH...
388
app = scottyApp $ do middleware logStdoutDev middleware (gzip def) get "/js/app.js" $ js "js/app.js" get "/" $ blaze Pages.Index.render where blaze = html . renderHtml js f = file f >> setHeader "content-type" "text/javascript" --css f = file f >> setHeader "content-type" "...
366
false
true
2
10
99
102
45
57
null
null
ezyang/ghc
libraries/base/Foreign/Marshal/Alloc.hs
bsd-3-clause
malloc :: Storable a => IO (Ptr a) malloc = doMalloc undefined where doMalloc :: Storable b => b -> IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) -- |Like 'malloc' but memory is filled with bytes of value zero. --
242
malloc :: Storable a => IO (Ptr a) malloc = doMalloc undefined where doMalloc :: Storable b => b -> IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) -- |Like 'malloc' but memory is filled with bytes of value zero. --
242
malloc = doMalloc undefined where doMalloc :: Storable b => b -> IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy) -- |Like 'malloc' but memory is filled with bytes of value zero. --
207
false
true
3
8
61
75
37
38
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmExtCode.hs
bsd-3-clause
emitStore :: CmmExpr -> CmmExpr -> CmmParse () emitStore l r = code (F.emitStore l r)
86
emitStore :: CmmExpr -> CmmExpr -> CmmParse () emitStore l r = code (F.emitStore l r)
86
emitStore l r = code (F.emitStore l r)
38
false
true
0
9
16
46
21
25
null
null
mcschroeder/ghc
compiler/coreSyn/PprCore.hs
bsd-3-clause
pprCoreExpr expr = ppr_expr noParens expr
43
pprCoreExpr expr = ppr_expr noParens expr
43
pprCoreExpr expr = ppr_expr noParens expr
43
false
false
0
5
7
14
6
8
null
null
andorp/file-persist
src/Database/Persist/File/SelectOpts.hs
bsd-3-clause
-- Drops the first d elements of the list offsetBy :: Int -> Selector record offsetBy d = wrap . drop d
103
offsetBy :: Int -> Selector record offsetBy d = wrap . drop d
61
offsetBy d = wrap . drop d
26
true
true
0
6
21
29
14
15
null
null
typelead/epm
Cabal/Distribution/PackageDescription/Check.hs
bsd-3-clause
checkCPPOptions :: PackageDescription -> [PackageCheck] checkCPPOptions pkg = catMaybes [ checkAlternatives "cpp-options" "include-dirs" [ (flag, dir) | flag@('-':'I':dir) <- all_cppOptions] ] where all_cppOptions = [ opts | bi <- allBuildInfo pkg , opts <- cppOptions b...
323
checkCPPOptions :: PackageDescription -> [PackageCheck] checkCPPOptions pkg = catMaybes [ checkAlternatives "cpp-options" "include-dirs" [ (flag, dir) | flag@('-':'I':dir) <- all_cppOptions] ] where all_cppOptions = [ opts | bi <- allBuildInfo pkg , opts <- cppOptions b...
323
checkCPPOptions pkg = catMaybes [ checkAlternatives "cpp-options" "include-dirs" [ (flag, dir) | flag@('-':'I':dir) <- all_cppOptions] ] where all_cppOptions = [ opts | bi <- allBuildInfo pkg , opts <- cppOptions bi ]
267
false
true
0
14
86
98
51
47
null
null
ksaveljev/hake-2
src/Constants.hs
bsd-3-clause
moveStopEpsilon = 0.1 :: Float
30
moveStopEpsilon = 0.1 :: Float
30
moveStopEpsilon = 0.1 :: Float
30
false
false
0
4
4
9
5
4
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
1939 = 1938
11
1939 = 1938
11
1939 = 1938
11
false
false
1
5
2
10
3
7
null
null
bgamari/pandoc
src/Text/Pandoc/Writers/ICML.hs
gpl-2.0
codeBlockName = "CodeBlock"
31
codeBlockName = "CodeBlock"
31
codeBlockName = "CodeBlock"
31
false
false
0
4
6
6
3
3
null
null
fibsifan/pandoc
src/Text/Pandoc/Readers/Docx/Parse.hs
gpl-2.0
archiveToNotes :: Archive -> Notes archiveToNotes zf = let fnElem = findEntryByPath "word/footnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) enElem = findEntryByPath "word/endnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) fn_namespaces = case...
679
archiveToNotes :: Archive -> Notes archiveToNotes zf = let fnElem = findEntryByPath "word/footnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) enElem = findEntryByPath "word/endnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) fn_namespaces = case...
679
archiveToNotes zf = let fnElem = findEntryByPath "word/footnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) enElem = findEntryByPath "word/endnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) fn_namespaces = case fnElem of Just e -> elemTo...
644
false
true
0
13
193
209
104
105
null
null
GRACeFUL-project/haskelzinc
src/Interfaces/MZAST.hs
bsd-3-clause
decideWhere (Just e1) (Just e2) = Just $ Bi (Op (Simpl "/\\")) e1 e2
68
decideWhere (Just e1) (Just e2) = Just $ Bi (Op (Simpl "/\\")) e1 e2
68
decideWhere (Just e1) (Just e2) = Just $ Bi (Op (Simpl "/\\")) e1 e2
68
false
false
0
10
13
46
22
24
null
null
mcmaniac/ghc
compiler/nativeGen/X86/Regs.hs
bsd-3-clause
fake3 = regSingle 19
20
fake3 = regSingle 19
20
fake3 = regSingle 19
20
false
false
1
5
3
13
4
9
null
null
JackKiefer/herms
app/AddCLI.hs
gpl-3.0
initialState :: String -> String -> String -> String -> String -> String -> String -> String -> String -> St initialState name desc serving amounts units ingrs attrs dirs tags = St (F.focusRing [RecipeName, Description, ServingSize, IngrAmount, IngrUnit, IngrName, IngrAttr, Directions, Tags]) (E.editor Recipe...
652
initialState :: String -> String -> String -> String -> String -> String -> String -> String -> String -> St initialState name desc serving amounts units ingrs attrs dirs tags = St (F.focusRing [RecipeName, Description, ServingSize, IngrAmount, IngrUnit, IngrName, IngrAttr, Directions, Tags]) (E.editor Recipe...
652
initialState name desc serving amounts units ingrs attrs dirs tags = St (F.focusRing [RecipeName, Description, ServingSize, IngrAmount, IngrUnit, IngrName, IngrAttr, Directions, Tags]) (E.editor RecipeName (Just 1) name) (E.editor Description Nothing desc) (E.editor ServingSize (Just 1) serving) (...
543
false
true
0
13
123
248
128
120
null
null
SKA-ScienceDataProcessor/RC
MS1/dna/DNA/Compiler/CH.hs
apache-2.0
-- | Get type of haskell scalar variable typeOfVar :: IsValue a => a -> HS.Type typeOfVar a = case reifyValue a of ValScalar -> case reifyScalar a of DoubleDict -> [ty| Double |] IntDict -> [ty| Int |] UnitDict -> [ty| () |] ValShape -> case reify...
456
typeOfVar :: IsValue a => a -> HS.Type typeOfVar a = case reifyValue a of ValScalar -> case reifyScalar a of DoubleDict -> [ty| Double |] IntDict -> [ty| Int |] UnitDict -> [ty| () |] ValShape -> case reifyShape a of ShShape -> ...
415
typeOfVar a = case reifyValue a of ValScalar -> case reifyScalar a of DoubleDict -> [ty| Double |] IntDict -> [ty| Int |] UnitDict -> [ty| () |] ValShape -> case reifyShape a of ShShape -> [ty| Shape |] ShSlic...
376
true
true
0
10
179
125
69
56
null
null
adnelson/error-tools
src/Control/Exception/ErrorList.hs
mit
assert False msg = throwError1 msg
34
assert False msg = throwError1 msg
34
assert False msg = throwError1 msg
34
false
false
0
5
5
14
6
8
null
null
conal/GtkTV
src/Interface/TV/Gtk2.hs
bsd-3-clause
boxer :: BoxClass box => (a -> b -> IO box) -> (a -> b -> IO Box) boxer = (result.result.fmap) toBox
100
boxer :: BoxClass box => (a -> b -> IO box) -> (a -> b -> IO Box) boxer = (result.result.fmap) toBox
100
boxer = (result.result.fmap) toBox
34
false
true
0
10
21
60
30
30
null
null
lally/libmet
src/Ppt/Agent/Command.hs
bsd-3-clause
combine :: String -> [Flag] -> Maybe Execution combine desc flags = let pId = tryLens (preview pid) flags filename = tryLens (preview fileName) flags timeoffset = tryLens (preview timeOffset) flags bufname = tryLens (preview bufName) flags counters = L.concatMap breakCsv $ catMaybes $ map (preview ...
1,391
combine :: String -> [Flag] -> Maybe Execution combine desc flags = let pId = tryLens (preview pid) flags filename = tryLens (preview fileName) flags timeoffset = tryLens (preview timeOffset) flags bufname = tryLens (preview bufName) flags counters = L.concatMap breakCsv $ catMaybes $ map (preview ...
1,391
combine desc flags = let pId = tryLens (preview pid) flags filename = tryLens (preview fileName) flags timeoffset = tryLens (preview timeOffset) flags bufname = tryLens (preview bufName) flags counters = L.concatMap breakCsv $ catMaybes $ map (preview counter) flags remainders = catMaybes $ ma...
1,344
false
true
0
20
453
551
258
293
null
null
peterbecich/haskell-programming-first-principles
src/LearnParsers.hs
bsd-3-clause
-- type Parser a = String -> Maybe (a, String) -- ^ token type -- ^ input String -- ^ remainder of string, assuming parsing hasn't failed -- ^ token oneTwo = char '1' >> char '2'
281
oneTwo = char '1' >> char '2'
29
oneTwo = char '1' >> char '2'
29
true
false
0
6
139
21
12
9
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Prolog.hs
gpl-2.0
regex_'5b0'2d9'5d'2b'5c'2e'5b0'2d9'5d'2b = compileRegex True "[0-9]+\\.[0-9]+"
78
regex_'5b0'2d9'5d'2b'5c'2e'5b0'2d9'5d'2b = compileRegex True "[0-9]+\\.[0-9]+"
78
regex_'5b0'2d9'5d'2b'5c'2e'5b0'2d9'5d'2b = compileRegex True "[0-9]+\\.[0-9]+"
78
false
false
0
5
4
11
5
6
null
null
jsavatgy/hatupist
code/helperCanvas.hs
gpl-2.0
drawKeyrowsCanvas gsRef canvas _evt = do gs <- readIORef gsRef writeIORef gsRef gs { lastLetter = nextLetter gs } let c = nextLetter gs selected = [toUpper c] dupl = toUpper c == toUpper (lastLetter gs) keymap = [keyrow1 (s gs), keyrow2 (s gs), keyrow3 (s gs)] leK y = length (keyma...
605
drawKeyrowsCanvas gsRef canvas _evt = do gs <- readIORef gsRef writeIORef gsRef gs { lastLetter = nextLetter gs } let c = nextLetter gs selected = [toUpper c] dupl = toUpper c == toUpper (lastLetter gs) keymap = [keyrow1 (s gs), keyrow2 (s gs), keyrow3 (s gs)] leK y = length (keyma...
605
drawKeyrowsCanvas gsRef canvas _evt = do gs <- readIORef gsRef writeIORef gsRef gs { lastLetter = nextLetter gs } let c = nextLetter gs selected = [toUpper c] dupl = toUpper c == toUpper (lastLetter gs) keymap = [keyrow1 (s gs), keyrow2 (s gs), keyrow3 (s gs)] leK y = length (keyma...
605
false
false
0
18
169
311
155
156
null
null
crzysdrs/griddle
test/InterpString/Test.hs
gpl-2.0
genInterpPlain :: Gen String genInterpPlain = do e <- listOf1 $ elements $ ['a'..'z'] ++ ['A'..'Z'] brackets <- listOf1 $ elements ["\\}", "\\{"] shuffled <- shuffle (map (\x -> [x]) e ++ brackets) return $ concat shuffled
230
genInterpPlain :: Gen String genInterpPlain = do e <- listOf1 $ elements $ ['a'..'z'] ++ ['A'..'Z'] brackets <- listOf1 $ elements ["\\}", "\\{"] shuffled <- shuffle (map (\x -> [x]) e ++ brackets) return $ concat shuffled
230
genInterpPlain = do e <- listOf1 $ elements $ ['a'..'z'] ++ ['A'..'Z'] brackets <- listOf1 $ elements ["\\}", "\\{"] shuffled <- shuffle (map (\x -> [x]) e ++ brackets) return $ concat shuffled
201
false
true
0
15
44
112
54
58
null
null
khajavi/pandoc
src/Text/Pandoc/Writers/MediaWiki.hs
gpl-2.0
blockToMediaWiki opts x@(DefinitionList items) = do oldUseTags <- get >>= return . stUseTags let useTags = oldUseTags || not (isSimpleList x) if useTags then do modify $ \s -> s { stUseTags = True } contents <- mapM (definitionListItemToMediaWiki opts) items modify $ \s -> s { stUseTa...
739
blockToMediaWiki opts x@(DefinitionList items) = do oldUseTags <- get >>= return . stUseTags let useTags = oldUseTags || not (isSimpleList x) if useTags then do modify $ \s -> s { stUseTags = True } contents <- mapM (definitionListItemToMediaWiki opts) items modify $ \s -> s { stUseTa...
739
blockToMediaWiki opts x@(DefinitionList items) = do oldUseTags <- get >>= return . stUseTags let useTags = oldUseTags || not (isSimpleList x) if useTags then do modify $ \s -> s { stUseTags = True } contents <- mapM (definitionListItemToMediaWiki opts) items modify $ \s -> s { stUseTa...
739
false
false
0
16
194
234
116
118
null
null
mcschroeder/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
-- | Union two ImportAvails -- -- This function is a key part of Import handling, basically -- for each import we create a separate ImportAvails structure -- and then union them all together with this function. plusImportAvails :: ImportAvails -> ImportAvails -> ImportAvails plusImportAvails (ImportAvails { imp_mo...
1,905
plusImportAvails :: ImportAvails -> ImportAvails -> ImportAvails plusImportAvails (ImportAvails { imp_mods = mods1, imp_dep_mods = dmods1, imp_dep_pkgs = dpkgs1, imp_trust_pkgs = tpkgs1, imp_trust_own_pkg = tself1, imp_orphs = orphs1, imp_finsts = finsts1 }) ...
1,694
plusImportAvails (ImportAvails { imp_mods = mods1, imp_dep_mods = dmods1, imp_dep_pkgs = dpkgs1, imp_trust_pkgs = tpkgs1, imp_trust_own_pkg = tself1, imp_orphs = orphs1, imp_finsts = finsts1 }) (ImportAvails { imp_mods = mods2, imp_dep_mods = d...
1,626
true
true
0
10
646
302
182
120
null
null
shlevy/ghc
compiler/codeGen/StgCmmProf.hs
bsd-3-clause
zero64 :: CmmLit zero64 = CmmInt 0 W64
38
zero64 :: CmmLit zero64 = CmmInt 0 W64
38
zero64 = CmmInt 0 W64
21
false
true
0
5
7
16
8
8
null
null
eborden/redeux
todo-mvc/Main.hs
bsd-3-clause
filters :: Filter -> (Text, Bool) -> Bool filters f (_, complete) = case f of All -> True Complete -> complete Active -> not complete
139
filters :: Filter -> (Text, Bool) -> Bool filters f (_, complete) = case f of All -> True Complete -> complete Active -> not complete
139
filters f (_, complete) = case f of All -> True Complete -> complete Active -> not complete
97
false
true
3
7
31
65
32
33
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Gen2/Prim.hs
mit
genPrim _ _ IndexOffAddrOp_Word64 [c1,c2] [a,o,i] = PrimInline [j| `c1` = `a`.dv.getInt32(`o`+(`i`<<3),true); `c2` = `a`.dv.getInt32(`o`+(`i`<<3)+4,true); |]
194
genPrim _ _ IndexOffAddrOp_Word64 [c1,c2] [a,o,i] = PrimInline [j| `c1` = `a`.dv.getInt32(`o`+(`i`<<3),true); `c2` = `a`.dv.getInt32(`o`+(`i`<<3)+4,true); |]
194
genPrim _ _ IndexOffAddrOp_Word64 [c1,c2] [a,o,i] = PrimInline [j| `c1` = `a`.dv.getInt32(`o`+(`i`<<3),true); `c2` = `a`.dv.getInt32(`o`+(`i`<<3)+4,true); |]
194
false
false
0
6
52
39
23
16
null
null
Helium4Haskell/helium
lib/List.hs
gpl-3.0
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] deleteBy eq x [] = []
92
deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] deleteBy eq x [] = []
92
deleteBy eq x [] = []
29
false
true
0
8
41
54
27
27
null
null
leshchevds/ganeti
test/hs/Test/Ganeti/TestCommon.hs
bsd-2-clause
genOpCodesTagName :: TagKind -> Gen (Maybe String) genOpCodesTagName TagKindCluster = return Nothing
100
genOpCodesTagName :: TagKind -> Gen (Maybe String) genOpCodesTagName TagKindCluster = return Nothing
100
genOpCodesTagName TagKindCluster = return Nothing
49
false
true
0
8
11
30
14
16
null
null
ComputationWithBoundedResources/ara-inference
src/Data/Rewriting/ARA/ByInferenceRules/ConstraintSolver/SMT/ConvertToSMTProblem.hs
mit
addRetEqZeroConstraints :: (Num a, Ord a, Show a, MonadState SMTProblem m) => Int -> [ADatatype t a] -> m () addRetEqZeroConstraints vecLen eqZero = do let vs = concatMap (fromADatatype vecLen) eqZero mapM_ (addVars . fromADatatype vecLen) e...
371
addRetEqZeroConstraints :: (Num a, Ord a, Show a, MonadState SMTProblem m) => Int -> [ADatatype t a] -> m () addRetEqZeroConstraints vecLen eqZero = do let vs = concatMap (fromADatatype vecLen) eqZero mapM_ (addVars . fromADatatype vecLen) e...
371
addRetEqZeroConstraints vecLen eqZero = do let vs = concatMap (fromADatatype vecLen) eqZero mapM_ (addVars . fromADatatype vecLen) eqZero mapM_ (\x -> addConstraint (x, Eq, "0")) vs
187
false
true
0
12
126
132
65
67
null
null
thiagoarrais/gtk2hs
demo/profileviewer/ParseProfile.hs
lgpl-2.1
parseProfileFile :: String -> IO Profile parseProfileFile filename = do content <- readFile filename let (titleLine:_:commandLine:_:timeLine:allocLine:theRest) = lines content profileDetail = dropWhile (\line -> take 4 line /= "MAIN") theRest return $ Profile { title = dropWhile isSpace titleLine, ...
547
parseProfileFile :: String -> IO Profile parseProfileFile filename = do content <- readFile filename let (titleLine:_:commandLine:_:timeLine:allocLine:theRest) = lines content profileDetail = dropWhile (\line -> take 4 line /= "MAIN") theRest return $ Profile { title = dropWhile isSpace titleLine, ...
547
parseProfileFile filename = do content <- readFile filename let (titleLine:_:commandLine:_:timeLine:allocLine:theRest) = lines content profileDetail = dropWhile (\line -> take 4 line /= "MAIN") theRest return $ Profile { title = dropWhile isSpace titleLine, command = dropWhile isSpace commandLin...
506
false
true
0
16
117
189
94
95
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x04DE' = "\x0417\x0308"
39
decomposeChar '\x04DE' = "\x0417\x0308"
39
decomposeChar '\x04DE' = "\x0417\x0308"
39
false
false
1
5
3
13
4
9
null
null
grpc/grpc-haskell
src/Network/Grpc/CompletionQueue.hs
apache-2.0
eventIdFromTag :: Tag -> EventId eventIdFromTag tag = tag `minusPtr` nullPtr
76
eventIdFromTag :: Tag -> EventId eventIdFromTag tag = tag `minusPtr` nullPtr
76
eventIdFromTag tag = tag `minusPtr` nullPtr
43
false
true
0
5
10
24
13
11
null
null
Noeda/adeonbot
bot/src/Bot/NetHack/WordTools.hs
mit
stripMonsterPrefixes :: T.Text -> T.Text stripMonsterPrefixes = stripInvisible . stripAThe
90
stripMonsterPrefixes :: T.Text -> T.Text stripMonsterPrefixes = stripInvisible . stripAThe
90
stripMonsterPrefixes = stripInvisible . stripAThe
49
false
true
0
6
9
23
12
11
null
null
pgj/bead
src/Bead/Persistence/NoSQLDir.hs
bsd-3-clause
objectOrError msg subdir keyConstructor isValidDir sourceKey = do m <- objectIn subdir keyConstructor isValidDir sourceKey case m of Nothing -> throwEx . userError $ msg ++ show sourceKey Just x -> return x
219
objectOrError msg subdir keyConstructor isValidDir sourceKey = do m <- objectIn subdir keyConstructor isValidDir sourceKey case m of Nothing -> throwEx . userError $ msg ++ show sourceKey Just x -> return x
219
objectOrError msg subdir keyConstructor isValidDir sourceKey = do m <- objectIn subdir keyConstructor isValidDir sourceKey case m of Nothing -> throwEx . userError $ msg ++ show sourceKey Just x -> return x
219
false
false
0
12
45
73
33
40
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
getPartFairingStreamReq :: KRPCHS.SpaceCenter.Part -> KRPCStreamReq (KRPCHS.SpaceCenter.Fairing) getPartFairingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Part_get_Fairing" [makeArgument 0 thisArg] in makeStream req
237
getPartFairingStreamReq :: KRPCHS.SpaceCenter.Part -> KRPCStreamReq (KRPCHS.SpaceCenter.Fairing) getPartFairingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Part_get_Fairing" [makeArgument 0 thisArg] in makeStream req
237
getPartFairingStreamReq thisArg = let req = makeRequest "SpaceCenter" "Part_get_Fairing" [makeArgument 0 thisArg] in makeStream req
140
false
true
0
11
29
64
30
34
null
null
zhensydow/ljcsandbox
lang/haskell/spoj/FCTRL.hs
gpl-3.0
count2_5 [] val = val
21
count2_5 [] val = val
21
count2_5 [] val = val
21
false
false
0
6
4
13
6
7
null
null
shangaslammi/haskell-iter
src/Data/Iter/State.hs
mit
tryNext :: IState a (Maybe a) tryNext = do i <- get n <- liftIO $ nextIO i case n of Nothing -> return Nothing Just (a,i') -> do put i' return $ Just a
203
tryNext :: IState a (Maybe a) tryNext = do i <- get n <- liftIO $ nextIO i case n of Nothing -> return Nothing Just (a,i') -> do put i' return $ Just a
203
tryNext = do i <- get n <- liftIO $ nextIO i case n of Nothing -> return Nothing Just (a,i') -> do put i' return $ Just a
173
false
true
0
13
86
90
41
49
null
null
wilbowma/accelerate
Data/Array/Accelerate/CUDA/Array/Data.hs
bsd-3-clause
arena :: (DevicePtrs e ~ CUDA.DevicePtr b, Typeable b) => AD.ArrayData e -> MemoryEntry -> CUDA.DevicePtr b arena _ (MemoryEntry _ p) | Just ptr <- gcast p = ptr | otherwise = INTERNAL_ERROR(error) "arena" "type mismatch"
253
arena :: (DevicePtrs e ~ CUDA.DevicePtr b, Typeable b) => AD.ArrayData e -> MemoryEntry -> CUDA.DevicePtr b arena _ (MemoryEntry _ p) | Just ptr <- gcast p = ptr | otherwise = INTERNAL_ERROR(error) "arena" "type mismatch"
253
arena _ (MemoryEntry _ p) | Just ptr <- gcast p = ptr | otherwise = INTERNAL_ERROR(error) "arena" "type mismatch"
127
false
true
1
9
68
100
47
53
null
null
ryantrinkle/ghcjs
test/nofib/spectral/puzzle/Main.hs
mit
finalState = State RightBank RightBank RightBank RightBank
58
finalState = State RightBank RightBank RightBank RightBank
58
finalState = State RightBank RightBank RightBank RightBank
58
false
false
1
5
6
20
7
13
null
null
saxsoares/PARADIGMAS
HASKELL/ex_aula.hs
gpl-2.0
insere' s (x:xs) | s == x = (x:xs) | otherwise = (x:insere' s xs)
73
insere' s (x:xs) | s == x = (x:xs) | otherwise = (x:insere' s xs)
73
insere' s (x:xs) | s == x = (x:xs) | otherwise = (x:insere' s xs)
73
false
false
1
8
22
56
27
29
null
null
urbanslug/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp _ (VecRemOp IntVec n w) = Just (MO_VS_Rem n w)
60
translateOp _ (VecRemOp IntVec n w) = Just (MO_VS_Rem n w)
60
translateOp _ (VecRemOp IntVec n w) = Just (MO_VS_Rem n w)
60
false
false
1
7
12
34
15
19
null
null
tattsun/ploto
src/Ploto/CoreRuntime.hs
bsd-3-clause
exec :: [Core] -> IO () exec cores = flip evalStateT newCoreRuntime $ unCoreRuntimeT $ do mapM_ (\(name, primfunc) -> registerFunc (SymbolValue name) (PrimFunc primfunc) ) primFuncs preprocess cores eval (FuncCall (SymbolValue "main") []) return () -----------------------------------------...
349
exec :: [Core] -> IO () exec cores = flip evalStateT newCoreRuntime $ unCoreRuntimeT $ do mapM_ (\(name, primfunc) -> registerFunc (SymbolValue name) (PrimFunc primfunc) ) primFuncs preprocess cores eval (FuncCall (SymbolValue "main") []) return () -----------------------------------------...
349
exec cores = flip evalStateT newCoreRuntime $ unCoreRuntimeT $ do mapM_ (\(name, primfunc) -> registerFunc (SymbolValue name) (PrimFunc primfunc) ) primFuncs preprocess cores eval (FuncCall (SymbolValue "main") []) return () -----------------------------------------------------------------...
325
false
true
0
13
66
115
55
60
null
null
stepcut/plugins
testsuite/dynload/poly/api/API.hs
lgpl-2.1
plugin :: Interface plugin = Interface { equals = (==) }
57
plugin :: Interface plugin = Interface { equals = (==) }
57
plugin = Interface { equals = (==) }
37
false
true
0
7
11
31
15
16
null
null
limansky/wbxml
src/Wbxml/SAX.hs
bsd-3-clause
parsePublicId = do id <- anyMultiByteWord if id /= 0 then return $ KnownPublicId id else anyMultiByteWord >>= return . StringPublicId -- version = u_int8 containing WBXML version number
214
parsePublicId = do id <- anyMultiByteWord if id /= 0 then return $ KnownPublicId id else anyMultiByteWord >>= return . StringPublicId -- version = u_int8 containing WBXML version number
214
parsePublicId = do id <- anyMultiByteWord if id /= 0 then return $ KnownPublicId id else anyMultiByteWord >>= return . StringPublicId -- version = u_int8 containing WBXML version number
214
false
false
0
9
57
44
22
22
null
null
abhin4v/combinatorrent
src/Process/ChokeMgr.hs
bsd-2-clause
advancePeerChain :: ChokeMgrProcess () advancePeerChain = do peers <- gets chain rd <- gets rateMap let (front, back) = break (breakPoint rd) peers modify (\db -> db { chain = back ++ front }) where breakPoint rd peer = case M.lookup (pThreadId peer) rd of Nothing -> True -- Re...
420
advancePeerChain :: ChokeMgrProcess () advancePeerChain = do peers <- gets chain rd <- gets rateMap let (front, back) = break (breakPoint rd) peers modify (\db -> db { chain = back ++ front }) where breakPoint rd peer = case M.lookup (pThreadId peer) rd of Nothing -> True -- Re...
420
advancePeerChain = do peers <- gets chain rd <- gets rateMap let (front, back) = break (breakPoint rd) peers modify (\db -> db { chain = back ++ front }) where breakPoint rd peer = case M.lookup (pThreadId peer) rd of Nothing -> True -- Really new peer, give it the chance :) ...
381
false
true
0
12
119
151
73
78
null
null
bartoszw/elca
LoanOutput.hs
gpl-2.0
showValue :: (PrettyShow a) => a -> String showValue = showWithLen 10
70
showValue :: (PrettyShow a) => a -> String showValue = showWithLen 10
69
showValue = showWithLen 10
26
false
true
0
6
12
27
14
13
null
null
kylcarte/lnfunctors
src/Data/LnFunctor/Apply.hs
bsd-3-clause
-- | NB: If intermediate types @h@ and @m@ are not uniquely determined by -- @i@, @j@, @k@, and @l@, the types of 'lliftA3' will be uninferrable. lliftA3 :: forall f a b c d h i j k l m n o p q. (LnApply f,Link f i j k l h m,Link f h m n o p q) => (a -> b -> c -> d) -> f i j a -> f k l b -> f n o c -> f p q d lli...
438
lliftA3 :: forall f a b c d h i j k l m n o p q. (LnApply f,Link f i j k l h m,Link f h m n o p q) => (a -> b -> c -> d) -> f i j a -> f k l b -> f n o c -> f p q d lliftA3 f a b c = fab <**> c where fa :: f i j (b -> c -> d) fa = f <$> a fab :: f h m (c -> d) fab = fa <**> b
292
lliftA3 f a b c = fab <**> c where fa :: f i j (b -> c -> d) fa = f <$> a fab :: f h m (c -> d) fab = fa <**> b
121
true
true
4
12
142
223
116
107
null
null
tgdavies/codeworld
codeworld-prediction/src/CodeWorld/Prediction.hs
apache-2.0
replayPending :: StepFun s -> AnimationRate -> Future s -> Future s replayPending step rate f = f {current = current'} where current' = timePassesBigStep step rate (lastQuery f) $ handleNextEvents step rate (pending f) $ committed f -- | Takes into account all future event that happen before the ...
543
replayPending :: StepFun s -> AnimationRate -> Future s -> Future s replayPending step rate f = f {current = current'} where current' = timePassesBigStep step rate (lastQuery f) $ handleNextEvents step rate (pending f) $ committed f -- | Takes into account all future event that happen before the ...
543
replayPending step rate f = f {current = current'} where current' = timePassesBigStep step rate (lastQuery f) $ handleNextEvents step rate (pending f) $ committed f -- | Takes into account all future event that happen before the given 'Timestamp' -- Does not have to call 'replayPending', as we ...
475
false
true
0
9
115
96
48
48
null
null
mathfur/grep-tree
src/TreeGenerator.hs
mit
convertToOutputTree :: [Tree] -> IO [OutputTree] convertToOutputTree trees = evalRandIO $ mapM toOutputTree trees
113
convertToOutputTree :: [Tree] -> IO [OutputTree] convertToOutputTree trees = evalRandIO $ mapM toOutputTree trees
113
convertToOutputTree trees = evalRandIO $ mapM toOutputTree trees
64
false
true
0
7
13
36
18
18
null
null
kim/amazonka
amazonka-glacier/gen/Network/AWS/Glacier/DescribeJob.hs
mpl-2.0
-- | 'DescribeJobResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'djrAction' @::@ 'Maybe' 'ActionCode' -- -- * 'djrArchiveId' @::@ 'Maybe' 'Text' -- -- * 'djrArchiveSHA256TreeHash' @::@ 'Maybe' 'Text' -- -- * 'djrArchiveSizeInBytes' @::@ 'Maybe' 'Integer' -- -- * 'djrComplet...
1,879
describeJobResponse :: DescribeJobResponse describeJobResponse = DescribeJobResponse { _djrJobId = Nothing , _djrJobDescription = Nothing , _djrAction = Nothing , _djrArchiveId = Nothing , _djrVaultARN ...
923
describeJobResponse = DescribeJobResponse { _djrJobId = Nothing , _djrJobDescription = Nothing , _djrAction = Nothing , _djrArchiveId = Nothing , _djrVaultARN = Nothing , _djrCreationDate ...
880
true
true
0
7
528
157
114
43
null
null
davmre/matrizer
src/Matrizer/Optimization.hs
gpl-2.0
variablesUsed (Branch2 _ a b) vs = variablesUsed b (variablesUsed a vs)
71
variablesUsed (Branch2 _ a b) vs = variablesUsed b (variablesUsed a vs)
71
variablesUsed (Branch2 _ a b) vs = variablesUsed b (variablesUsed a vs)
71
false
false
0
7
11
34
16
18
null
null
AmpersandTarski/ampersand
src/Ampersand/Input/Parsing.hs
gpl-3.0
parse :: AmpParser a -> FilePath -> [Token] -> Guarded a parse p fn ts = -- runP :: Parsec s u a -> u -> FilePath -> s -> Either ParseError a case runP p pos' fn ts of --TODO: Add language support to the parser errors Left err -> Errors $ parseErrors English err Right a -> pure a w...
441
parse :: AmpParser a -> FilePath -> [Token] -> Guarded a parse p fn ts = -- runP :: Parsec s u a -> u -> FilePath -> s -> Either ParseError a case runP p pos' fn ts of --TODO: Add language support to the parser errors Left err -> Errors $ parseErrors English err Right a -> pure a w...
441
parse p fn ts = -- runP :: Parsec s u a -> u -> FilePath -> s -> Either ParseError a case runP p pos' fn ts of --TODO: Add language support to the parser errors Left err -> Errors $ parseErrors English err Right a -> pure a where pos' | null ts = initPos fn | other...
384
false
true
2
9
138
124
58
66
null
null
fugyk/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
registerCommand :: CommandUI RegisterFlags registerCommand = CommandUI { commandName = "register" , commandSynopsis = "Register this package with the compiler." , commandDescription = Nothing , commandNotes = Nothing , commandUsage = \pname -> "Usage: " ++ pname ++ " reg...
2,212
registerCommand :: CommandUI RegisterFlags registerCommand = CommandUI { commandName = "register" , commandSynopsis = "Register this package with the compiler." , commandDescription = Nothing , commandNotes = Nothing , commandUsage = \pname -> "Usage: " ++ pname ++ " reg...
2,212
registerCommand = CommandUI { commandName = "register" , commandSynopsis = "Register this package with the compiler." , commandDescription = Nothing , commandNotes = Nothing , commandUsage = \pname -> "Usage: " ++ pname ++ " register [FLAGS]\n" , commandDefaultFlags = ...
2,169
false
true
0
16
674
467
268
199
null
null
philopon/apiary
src/Control/Monad/Apiary/Filter/Internal/Capture/TH.hs
mit
preCap p = splitPath p
28
preCap p = splitPath p
28
preCap p = splitPath p
28
false
false
0
5
10
12
5
7
null
null
spechub/Hets
CommonLogic/Parse_KIF.hs
gpl-2.0
plainAtom :: CharParser st ATOM plainAtom = do t <- pToken (word <|> variable) <?> "word" return $ Atom (Name_term t) []
124
plainAtom :: CharParser st ATOM plainAtom = do t <- pToken (word <|> variable) <?> "word" return $ Atom (Name_term t) []
124
plainAtom = do t <- pToken (word <|> variable) <?> "word" return $ Atom (Name_term t) []
92
false
true
0
11
25
57
27
30
null
null
alemedeiros/json-to-xml
Main.hs
bsd-3-clause
-- Create the filepath for output xml file generateFilePath :: String -> FilePath generateFilePath jsonFileName = replaceDirectory (replaceExtension jsonFileName "xml") "./xml/"
185
generateFilePath :: String -> FilePath generateFilePath jsonFileName = replaceDirectory (replaceExtension jsonFileName "xml") "./xml/"
142
generateFilePath jsonFileName = replaceDirectory (replaceExtension jsonFileName "xml") "./xml/"
103
true
true
0
7
28
32
16
16
null
null
pgavin/secdh
lib/Language/Slambda/Read.hs
bsd-3-clause
varT :: ReadP Term varT = do liftM VarT var
45
varT :: ReadP Term varT = do liftM VarT var
45
varT = do liftM VarT var
26
false
true
0
8
11
28
11
17
null
null
alexander-b/react-tutorial-haskell-server
server.hs
agpl-3.0
presentComments :: Maybe [Comment] -> ActionM () presentComments cs = do setHeader "Cache-Control" "no-cache" setHeader "Access-Control-Allow-Origin" "*" json cs
181
presentComments :: Maybe [Comment] -> ActionM () presentComments cs = do setHeader "Cache-Control" "no-cache" setHeader "Access-Control-Allow-Origin" "*" json cs
181
presentComments cs = do setHeader "Cache-Control" "no-cache" setHeader "Access-Control-Allow-Origin" "*" json cs
132
false
true
0
8
38
55
23
32
null
null
plow-technologies/keter-node
test/Keter/Node/ConfigurationSpec.hs
bsd-3-clause
tKHost = KeterNodeHost "localhost"
34
tKHost = KeterNodeHost "localhost"
34
tKHost = KeterNodeHost "localhost"
34
false
false
0
5
3
9
4
5
null
null
ganeti/ganeti
src/Ganeti/HTools/Backend/Luxi.hs
bsd-2-clause
-- | Wraper over 'callMethod' doing node query. queryNodes :: L.Client -> IO (Result JSValue) queryNodes = liftM errToResult . L.callMethod queryNodesMsg
153
queryNodes :: L.Client -> IO (Result JSValue) queryNodes = liftM errToResult . L.callMethod queryNodesMsg
105
queryNodes = liftM errToResult . L.callMethod queryNodesMsg
59
true
true
1
9
21
45
20
25
null
null
kuribas/cubicbezier
Geom2D.hs
bsd-3-clause
-- | The unit vector with the same direction. normVector :: Floating a => Point a -> Point a normVector p@(Point x y) = Point (x/l) (y/l) where l = vectorMag p
162
normVector :: Floating a => Point a -> Point a normVector p@(Point x y) = Point (x/l) (y/l) where l = vectorMag p
116
normVector p@(Point x y) = Point (x/l) (y/l) where l = vectorMag p
69
true
true
2
8
34
83
37
46
null
null
mzini/termlib
Termlib/TermGraph.hs
gpl-3.0
rename :: TermGraph -> Node -> Node -> TermGraph rename tg node newNode = TermGraph (maybeReplace $ root tg) edges' where maybeReplace n | n == node = newNode | otherwise = n edges' = Map.foldWithKey f Map.empty (edges tg) f n e = Map.insert (maybe...
449
rename :: TermGraph -> Node -> Node -> TermGraph rename tg node newNode = TermGraph (maybeReplace $ root tg) edges' where maybeReplace n | n == node = newNode | otherwise = n edges' = Map.foldWithKey f Map.empty (edges tg) f n e = Map.insert (maybe...
449
rename tg node newNode = TermGraph (maybeReplace $ root tg) edges' where maybeReplace n | n == node = newNode | otherwise = n edges' = Map.foldWithKey f Map.empty (edges tg) f n e = Map.insert (maybeReplace n) e{target = maybeR...
400
false
true
2
10
172
166
76
90
null
null
laszlopandy/elm-compiler
src/Parse/Helpers.hs
bsd-3-clause
lineComment :: IParser String lineComment = do try (string "--") comment <- anyUntil $ simpleNewline <|> (eof >> return "\n") return ("--" ++ comment)
165
lineComment :: IParser String lineComment = do try (string "--") comment <- anyUntil $ simpleNewline <|> (eof >> return "\n") return ("--" ++ comment)
165
lineComment = do try (string "--") comment <- anyUntil $ simpleNewline <|> (eof >> return "\n") return ("--" ++ comment)
135
false
true
0
11
38
64
30
34
null
null
synsem/texhs
src/Text/TeX/Lexer/TokenParser/State.hs
gpl-3.0
-- | Test whether the meaning of a control sequence equals a certain primitive. meansPrimitive :: LexerState -> MacroCmdKey -> Primitive -> Bool meansPrimitive l k p = isPrimitive p $ getMacroMeaning l k
203
meansPrimitive :: LexerState -> MacroCmdKey -> Primitive -> Bool meansPrimitive l k p = isPrimitive p $ getMacroMeaning l k
123
meansPrimitive l k p = isPrimitive p $ getMacroMeaning l k
58
true
true
0
9
33
48
22
26
null
null
phischu/fragnix
tests/packages/scotty/Data.Set.Internal.hs
bsd-3-clause
take i0 m0 = go i0 m0 where go i !_ | i <= 0 = Tip go !_ Tip = Tip go i (Bin _ x l r) = case compare i sizeL of LT -> go i l GT -> link x l (go (i - sizeL - 1) r) EQ -> l where sizeL = size l -- | Drop a given number of elements in order, beginning -- with the smallest...
406
take i0 m0 = go i0 m0 where go i !_ | i <= 0 = Tip go !_ Tip = Tip go i (Bin _ x l r) = case compare i sizeL of LT -> go i l GT -> link x l (go (i - sizeL - 1) r) EQ -> l where sizeL = size l -- | Drop a given number of elements in order, beginning -- with the smallest...
406
take i0 m0 = go i0 m0 where go i !_ | i <= 0 = Tip go !_ Tip = Tip go i (Bin _ x l r) = case compare i sizeL of LT -> go i l GT -> link x l (go (i - sizeL - 1) r) EQ -> l where sizeL = size l -- | Drop a given number of elements in order, beginning -- with the smallest...
406
false
false
2
16
141
149
73
76
null
null
djudd/blokus
GameState.hs
gpl-3.0
getPlacementsAt !(TerritoryCorner _ cornerType _) = getPlacementsFor cornerType
79
getPlacementsAt !(TerritoryCorner _ cornerType _) = getPlacementsFor cornerType
79
getPlacementsAt !(TerritoryCorner _ cornerType _) = getPlacementsFor cornerType
79
false
false
0
8
7
23
10
13
null
null
wz1000/haskell-lsp
lsp/src/Language/LSP/Server/Processing.hs
mit
initializeRequestHandler :: ServerDefinition config -> VFS -> (FromServerMessage -> IO ()) -> Message Initialize -> IO (Maybe (LanguageContextEnv config)) initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do let sendResp = sendFunc . FromServerRsp SInitialize handleErr (Left err) = do ...
2,943
initializeRequestHandler :: ServerDefinition config -> VFS -> (FromServerMessage -> IO ()) -> Message Initialize -> IO (Maybe (LanguageContextEnv config)) initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do let sendResp = sendFunc . FromServerRsp SInitialize handleErr (Left err) = do ...
2,943
initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do let sendResp = sendFunc . FromServerRsp SInitialize handleErr (Left err) = do sendResp $ makeResponseError (req ^. LSP.id) err pure Nothing handleErr (Right a) = pure $ Just a flip E.catch (initializeErrorHandler $ sendR...
2,778
false
true
69
11
719
704
370
334
null
null
ghc-android/ghc
compiler/main/Packages.hs
bsd-3-clause
-- A package named on the command line can either include the -- version, or just the name if it is unambiguous. matchingStr :: String -> PackageConfig -> Bool matchingStr str p = str == sourcePackageIdString p || str == packageNameString p
257
matchingStr :: String -> PackageConfig -> Bool matchingStr str p = str == sourcePackageIdString p || str == packageNameString p
144
matchingStr str p = str == sourcePackageIdString p || str == packageNameString p
97
true
true
0
8
58
44
22
22
null
null
naoto-ogawa/h-xproto-mysql
src/DataBase/MySQLX/Model.hs
mit
{- Projection -} mkProjection :: PEx.Expr -> String -> PP.Projection mkProjection expr alias = PP.Projection {PP.source = expr, PP.alias = Just $ PBH.uFromString alias}
168
mkProjection :: PEx.Expr -> String -> PP.Projection mkProjection expr alias = PP.Projection {PP.source = expr, PP.alias = Just $ PBH.uFromString alias}
151
mkProjection expr alias = PP.Projection {PP.source = expr, PP.alias = Just $ PBH.uFromString alias}
99
true
true
0
10
23
64
32
32
null
null
cocreature/leksah
src/IDE/Package.hs
gpl-2.0
myLibModules pd = case library pd of Nothing -> [] Just l -> moduleInfo libBuildInfo libModules l
137
myLibModules pd = case library pd of Nothing -> [] Just l -> moduleInfo libBuildInfo libModules l
137
myLibModules pd = case library pd of Nothing -> [] Just l -> moduleInfo libBuildInfo libModules l
137
false
false
0
8
56
40
18
22
null
null
expipiplus1/vulkan
generate-new/src/CType.hs
bsd-3-clause
typeQualifier :: HasErr r => C -> Sem r Qualifier typeQualifier = \case C.TypeSpecifier (C.Specifiers [] [] []) _ -> pure NonConst C.TypeSpecifier (C.Specifiers [] [C.CONST] []) _ -> pure Const C.TypeSpecifier (C.Specifiers [C.TYPEDEF] [] []) _ -> pure NonConst C.Ptr [] _ -> pure NonConst C.P...
510
typeQualifier :: HasErr r => C -> Sem r Qualifier typeQualifier = \case C.TypeSpecifier (C.Specifiers [] [] []) _ -> pure NonConst C.TypeSpecifier (C.Specifiers [] [C.CONST] []) _ -> pure Const C.TypeSpecifier (C.Specifiers [C.TYPEDEF] [] []) _ -> pure NonConst C.Ptr [] _ -> pure NonConst C.P...
510
typeQualifier = \case C.TypeSpecifier (C.Specifiers [] [] []) _ -> pure NonConst C.TypeSpecifier (C.Specifiers [] [C.CONST] []) _ -> pure Const C.TypeSpecifier (C.Specifiers [C.TYPEDEF] [] []) _ -> pure NonConst C.Ptr [] _ -> pure NonConst C.Ptr [C.CONST] _ -> pure Const C.Array ...
460
false
true
0
13
170
223
103
120
null
null
gcampax/ghc
compiler/types/TypeRep.hs
bsd-3-clause
pprThetaArrowTy [pred] = ppr_type TyOpPrec pred <+> darrow
58
pprThetaArrowTy [pred] = ppr_type TyOpPrec pred <+> darrow
58
pprThetaArrowTy [pred] = ppr_type TyOpPrec pred <+> darrow
58
false
false
0
6
7
21
10
11
null
null
rblaze/haskell-dbus
lib/DBus/Client.hs
apache-2.0
propertiesInterfaceName :: InterfaceName propertiesInterfaceName = fromString "org.freedesktop.DBus.Properties"
111
propertiesInterfaceName :: InterfaceName propertiesInterfaceName = fromString "org.freedesktop.DBus.Properties"
111
propertiesInterfaceName = fromString "org.freedesktop.DBus.Properties"
70
false
true
0
5
6
14
7
7
null
null
heyduck/pfds
src/Pfds/Ch02/Ex.hs
gpl-3.0
kvTree = insertMap (Key (-3)) (Val 0) $ insertMap (Key 5) (Val 12398127391823) $ insertMap (Key 10) (Val 11) $ insertMap (Key 3) (Val 4) $ insertMap (Key 1) (Val 2) Empty
170
kvTree = insertMap (Key (-3)) (Val 0) $ insertMap (Key 5) (Val 12398127391823) $ insertMap (Key 10) (Val 11) $ insertMap (Key 3) (Val 4) $ insertMap (Key 1) (Val 2) Empty
170
kvTree = insertMap (Key (-3)) (Val 0) $ insertMap (Key 5) (Val 12398127391823) $ insertMap (Key 10) (Val 11) $ insertMap (Key 3) (Val 4) $ insertMap (Key 1) (Val 2) Empty
170
false
false
0
13
31
114
55
59
null
null
akegalj/snowdrift
Handler/ProjectBlog.hs
agpl-3.0
getUnwatchBlogPostCommentR :: Text -> Text -> CommentId -> Handler Html getUnwatchBlogPostCommentR project_handle post_name comment_id = do (widget, _) <- makeBlogPostCommentActionWidget makeUnwatchCommentWidget project_handle post_name comment_id def getMaxDepth defaultLayout $ projectBlogDiscussionPage proje...
346
getUnwatchBlogPostCommentR :: Text -> Text -> CommentId -> Handler Html getUnwatchBlogPostCommentR project_handle post_name comment_id = do (widget, _) <- makeBlogPostCommentActionWidget makeUnwatchCommentWidget project_handle post_name comment_id def getMaxDepth defaultLayout $ projectBlogDiscussionPage proje...
346
getUnwatchBlogPostCommentR project_handle post_name comment_id = do (widget, _) <- makeBlogPostCommentActionWidget makeUnwatchCommentWidget project_handle post_name comment_id def getMaxDepth defaultLayout $ projectBlogDiscussionPage project_handle post_name widget
274
false
true
0
8
40
73
35
38
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/cmm/PprC.hs
bsd-3-clause
-- -------------------------------------------------------------------------- -- Top level pprCs :: DynFlags -> [RawCmmGroup] -> SDoc pprCs dflags cmms = pprCode CStyle (vcat $ map (\c -> split_marker $$ pprC c) cmms) where split_marker | gopt Opt_SplitObjs dflags = ptext (sLit "__STG_SPLIT_MARKER") | o...
352
pprCs :: DynFlags -> [RawCmmGroup] -> SDoc pprCs dflags cmms = pprCode CStyle (vcat $ map (\c -> split_marker $$ pprC c) cmms) where split_marker | gopt Opt_SplitObjs dflags = ptext (sLit "__STG_SPLIT_MARKER") | otherwise = empty
260
pprCs dflags cmms = pprCode CStyle (vcat $ map (\c -> split_marker $$ pprC c) cmms) where split_marker | gopt Opt_SplitObjs dflags = ptext (sLit "__STG_SPLIT_MARKER") | otherwise = empty
217
true
true
0
12
73
98
48
50
null
null
kim/ex-pool
Data/Pool.hs
bsd-3-clause
-------------------------------------------------------------------------------- -- Internal -- -------------------------------------------------------------------------------- reaper :: (a -> IO ()) -> NominalDiffTime -> Vector (LocalPool a) -> IO () r...
885
reaper :: (a -> IO ()) -> NominalDiffTime -> Vector (LocalPool a) -> IO () reaper destroy idleTime pools = forever $ do threadDelay (1 * 1000000) now <- getCurrentTime let isStale r = now `diffUTCTime` lastUse r > idleTime V.forM_ pools $ \ (LocalPool inUse resources _) -> do rs <- atomically $ ...
641
reaper destroy idleTime pools = forever $ do threadDelay (1 * 1000000) now <- getCurrentTime let isStale r = now `diffUTCTime` lastUse r > idleTime V.forM_ pools $ \ (LocalPool inUse resources _) -> do rs <- atomically $ do (stale,fresh) <- partition isStale <$> readTVar resources ...
566
true
true
0
24
260
255
118
137
null
null
hvr/cryptohash-sha1
src/Crypto/Hash/SHA1.hs
bsd-3-clause
-- | finalize the context into a digest bytestring (20 bytes) finalize :: Ctx -> ByteString finalize ctx | validCtx ctx = unsafeDoIO $ withCtxThrow ctx finalizeInternalIO | otherwise = error "SHA1.finalize: invalid Ctx"
226
finalize :: Ctx -> ByteString finalize ctx | validCtx ctx = unsafeDoIO $ withCtxThrow ctx finalizeInternalIO | otherwise = error "SHA1.finalize: invalid Ctx"
164
finalize ctx | validCtx ctx = unsafeDoIO $ withCtxThrow ctx finalizeInternalIO | otherwise = error "SHA1.finalize: invalid Ctx"
134
true
true
1
8
40
52
23
29
null
null
AlexeyRaga/eta
compiler/ETA/Utils/Encoding.hs
bsd-3-clause
maybe_tuple ('(' : '#' : cs) = case count_commas (0::Int) cs of (n, '#' : ')' : _) -> Just ('Z' : shows (n+1) "H") _ -> Nothing
210
maybe_tuple ('(' : '#' : cs) = case count_commas (0::Int) cs of (n, '#' : ')' : _) -> Just ('Z' : shows (n+1) "H") _ -> Nothing
210
maybe_tuple ('(' : '#' : cs) = case count_commas (0::Int) cs of (n, '#' : ')' : _) -> Just ('Z' : shows (n+1) "H") _ -> Nothing
210
false
false
0
13
110
83
43
40
null
null
gcampax/ghc
compiler/types/TypeRep.hs
bsd-3-clause
--------------- tidyType :: TidyEnv -> Type -> Type tidyType _ (LitTy n) = LitTy n
95
tidyType :: TidyEnv -> Type -> Type tidyType _ (LitTy n) = LitTy n
79
tidyType _ (LitTy n) = LitTy n
43
true
true
0
7
27
34
17
17
null
null
AlexanderPankiv/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (ExplicitPArr {}) = False
45
hsExprNeedsParens (ExplicitPArr {}) = False
45
hsExprNeedsParens (ExplicitPArr {}) = False
45
false
false
0
6
6
17
8
9
null
null
nevrenato/HyLoRes_Source
src/HyLoRes/Statistics.hs
gpl-2.0
nonFwSubsumedClausesGenerated :: IO UniqueMetric nonFwSubsumedClausesGenerated = mkUnique . liftM CG' $ newIORef 0
114
nonFwSubsumedClausesGenerated :: IO UniqueMetric nonFwSubsumedClausesGenerated = mkUnique . liftM CG' $ newIORef 0
114
nonFwSubsumedClausesGenerated = mkUnique . liftM CG' $ newIORef 0
65
false
true
0
7
12
28
13
15
null
null
DavidAlphaFox/darcs
src/Darcs/Patch/Match.hs
gpl-2.0
firstMatcher (OnePatch p:_) = strictJust $ patchmatch p
55
firstMatcher (OnePatch p:_) = strictJust $ patchmatch p
55
firstMatcher (OnePatch p:_) = strictJust $ patchmatch p
55
false
false
0
8
7
26
12
14
null
null
robdockins/edison
edison-core/src/Data/Edison/Seq/BraunSeq.hs
mit
reducer' = reducer'UsingReduce1'
32
reducer' = reducer'UsingReduce1'
32
reducer' = reducer'UsingReduce1'
32
false
false
0
4
2
6
3
3
null
null
ksaveljev/hake-2
src/Game/GameBase.hs
bsd-3-clause
clipVelocity :: V3 Float -> V3 Float -> Float -> (Int, V3 Float) clipVelocity v3in normal overbounce = let isBlocked = if | normal^._z > 0 -> 1 -- floor | normal^._z == 0 -> 2 -- step | otherwise -> 0 backoff = (dot v3in normal) * overbounce change = fm...
484
clipVelocity :: V3 Float -> V3 Float -> Float -> (Int, V3 Float) clipVelocity v3in normal overbounce = let isBlocked = if | normal^._z > 0 -> 1 -- floor | normal^._z == 0 -> 2 -- step | otherwise -> 0 backoff = (dot v3in normal) * overbounce change = fm...
484
clipVelocity :: V3 Float -> V3 Float -> Float -> (Int, V3 Float) clipVelocity v3in normal overbounce = let isBlocked = if | normal^._z > 0 -> 1 -- floor | normal^._z == 0 -> 2 -- step | otherwise -> 0 backoff = (dot v3in normal) * overbounce change = fm...
484
false
false
0
17
168
190
99
91
null
null
vTurbine/ghc
ghc/Main.hs
bsd-3-clause
showOptionsMode = mkPreStartupMode (ShowOptions False)
66
showOptionsMode = mkPreStartupMode (ShowOptions False)
66
showOptionsMode = mkPreStartupMode (ShowOptions False)
66
false
false
0
7
16
15
7
8
null
null
Mahdi89/eTeak
src/Latch.hs
bsd-3-clause
extraLatchesForLink :: NetworkIF network => Int -> NetworkLinkRef -> NetworkMonad network [(NetworkLinkRef, Int)] extraLatchesForLink finalDepth link = do currentDepth <- liftM latchingDepth $ nwGetLinkLatching link return [(link, max (finalDepth - currentDepth) 0)]
286
extraLatchesForLink :: NetworkIF network => Int -> NetworkLinkRef -> NetworkMonad network [(NetworkLinkRef, Int)] extraLatchesForLink finalDepth link = do currentDepth <- liftM latchingDepth $ nwGetLinkLatching link return [(link, max (finalDepth - currentDepth) 0)]
282
extraLatchesForLink finalDepth link = do currentDepth <- liftM latchingDepth $ nwGetLinkLatching link return [(link, max (finalDepth - currentDepth) 0)]
168
false
true
0
13
51
93
45
48
null
null
delta2323/NNOp
NN/Network.hs
bsd-3-clause
split :: (INetwork nn) => nn d1 (d1, d1) split = fromFunc $ \x -> (x, x)
72
split :: (INetwork nn) => nn d1 (d1, d1) split = fromFunc $ \x -> (x, x)
72
split = fromFunc $ \x -> (x, x)
31
false
true
0
7
16
46
26
20
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x2F92A' = "\x3EAC"
34
decomposeChar '\x2F92A' = "\x3EAC"
34
decomposeChar '\x2F92A' = "\x3EAC"
34
false
false
0
5
3
9
4
5
null
null