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
christiaanb/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
sYSTEM_IO = mkBaseModule (fsLit "System.IO")
50
sYSTEM_IO = mkBaseModule (fsLit "System.IO")
50
sYSTEM_IO = mkBaseModule (fsLit "System.IO")
50
false
false
0
7
10
15
7
8
null
null
sdiehl/ghc
testsuite/tests/pmcheck/should_compile/T15884.hs
bsd-3-clause
f :: Maybe a -> Bool f (id->Nothing) = False
45
f :: Maybe a -> Bool f (id->Nothing) = False
45
f (id->Nothing) = False
24
false
true
0
6
10
32
15
17
null
null
fffej/HS-Poker
LookupPatternMatch.hs
bsd-3-clause
getValueFromProduct 2062306 = 3829
34
getValueFromProduct 2062306 = 3829
34
getValueFromProduct 2062306 = 3829
34
false
false
0
5
3
9
4
5
null
null
jyp/MarXup
MarXupParser.hs
gpl-2.0
pArg :: String -> Parser [Haskell] pArg [open,close] = char open *> pHask <* char close
88
pArg :: String -> Parser [Haskell] pArg [open,close] = char open *> pHask <* char close
88
pArg [open,close] = char open *> pHask <* char close
53
false
true
0
7
16
44
22
22
null
null
sdiehl/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- | Set or unset a 'LangExt.Extension', unless it has been explicitly -- set or unset before. xopt_set_unlessExplSpec :: LangExt.Extension -> (DynFlags -> LangExt.Extension -> DynFlags) -> DynFlags -> DynFlags xopt_set_unlessExplSpec ext setUnset dflags = let referedExts = stripOnOff <$> ...
477
xopt_set_unlessExplSpec :: LangExt.Extension -> (DynFlags -> LangExt.Extension -> DynFlags) -> DynFlags -> DynFlags xopt_set_unlessExplSpec ext setUnset dflags = let referedExts = stripOnOff <$> extensions dflags stripOnOff (On x) = x stripOnOff (Off x) = x in if...
380
xopt_set_unlessExplSpec ext setUnset dflags = let referedExts = stripOnOff <$> extensions dflags stripOnOff (On x) = x stripOnOff (Off x) = x in if ext `elem` referedExts then dflags else setUnset dflags ext
240
true
true
0
11
121
117
59
58
null
null
philopon/apiary
tests/Application.hs
mit
queryTest :: TestTree queryTest = testGroup "query" [ queryFirstTest , queryOneTest , queryOptionTest , queryOptionalTest , queryManyTest , querySomeTest , switchQueryTest ]
205
queryTest :: TestTree queryTest = testGroup "query" [ queryFirstTest , queryOneTest , queryOptionTest , queryOptionalTest , queryManyTest , querySomeTest , switchQueryTest ]
205
queryTest = testGroup "query" [ queryFirstTest , queryOneTest , queryOptionTest , queryOptionalTest , queryManyTest , querySomeTest , switchQueryTest ]
183
false
true
0
6
53
44
23
21
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | ID of the placement to be assigned. This is a required field. paPlacementId :: Lens' PlacementAssignment (Maybe Int64) paPlacementId = lens _paPlacementId (\ s a -> s{_paPlacementId = a}) . mapping _Coerce
224
paPlacementId :: Lens' PlacementAssignment (Maybe Int64) paPlacementId = lens _paPlacementId (\ s a -> s{_paPlacementId = a}) . mapping _Coerce
157
paPlacementId = lens _paPlacementId (\ s a -> s{_paPlacementId = a}) . mapping _Coerce
100
true
true
2
8
47
59
28
31
null
null
gridaphobe/target
src/Test/Target/Expr.hs
mit
-- prop :: Symbolic a => a -> Expr -- prop = PBexp . EVar . symbol prop :: Expr -> Expr prop = id
97
prop :: Expr -> Expr prop = id
30
prop = id
9
true
true
0
7
24
24
11
13
null
null
michaelt/streaming-bytestring
Data/ByteString/Streaming/Char8.hs
bsd-3-clause
unfoldr :: (a -> Either r (Char, a)) -> a -> ByteString m r unfoldr step = R.unfoldr (either Left (\(c,a) -> Right (c2w c,a)) . step)
133
unfoldr :: (a -> Either r (Char, a)) -> a -> ByteString m r unfoldr step = R.unfoldr (either Left (\(c,a) -> Right (c2w c,a)) . step)
133
unfoldr step = R.unfoldr (either Left (\(c,a) -> Right (c2w c,a)) . step)
73
false
true
0
13
26
88
46
42
null
null
rimmington/cabal
Cabal/tests/PackageTests/DeterministicAr/Check.hs
bsd-3-clause
ghcPkg_field1 :: SuiteConfig -> String -> String -> IO FilePath ghcPkg_field1 config libraryName fieldName = do fields <- ghcPkg_field config libraryName fieldName case fields of [field] -> return field _ -> assertFailure' $ "Command ghc-pkg field failed: " ++ "output not a single li...
423
ghcPkg_field1 :: SuiteConfig -> String -> String -> IO FilePath ghcPkg_field1 config libraryName fieldName = do fields <- ghcPkg_field config libraryName fieldName case fields of [field] -> return field _ -> assertFailure' $ "Command ghc-pkg field failed: " ++ "output not a single li...
423
ghcPkg_field1 config libraryName fieldName = do fields <- ghcPkg_field config libraryName fieldName case fields of [field] -> return field _ -> assertFailure' $ "Command ghc-pkg field failed: " ++ "output not a single line.\noutput: " ++ show fields ---------------------------------...
359
false
true
0
12
85
88
42
46
null
null
keithodulaigh/Hets
SoftFOL/Sign.hs
gpl-2.0
toLiteral :: Monad m => SPTerm -> m SPLiteral toLiteral t = case t of SPComplexTerm SPNot [SPComplexTerm arg []] -> return $ SPLiteral False arg SPComplexTerm arg [] -> return $ SPLiteral True arg _ -> fail "expected literal" {- | SPASS Quantifier Symbols. -}
290
toLiteral :: Monad m => SPTerm -> m SPLiteral toLiteral t = case t of SPComplexTerm SPNot [SPComplexTerm arg []] -> return $ SPLiteral False arg SPComplexTerm arg [] -> return $ SPLiteral True arg _ -> fail "expected literal" {- | SPASS Quantifier Symbols. -}
290
toLiteral t = case t of SPComplexTerm SPNot [SPComplexTerm arg []] -> return $ SPLiteral False arg SPComplexTerm arg [] -> return $ SPLiteral True arg _ -> fail "expected literal" {- | SPASS Quantifier Symbols. -}
244
false
true
0
11
76
98
45
53
null
null
sboosali/haddock
haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
bsd-2-clause
renderMeta _ _ = noHtml
23
renderMeta _ _ = noHtml
23
renderMeta _ _ = noHtml
23
false
false
0
5
4
11
5
6
null
null
hanshoglund/hamid
src/System/Win32/MIDI.hs
bsd-3-clause
- |Eumerates the MIDI sources. enumerateSources :: IO [Source] enumerateSources = do n <- c_midiInGetNumDevs return $ if n>0 then [ Source i | i<-[0..n-1] ] else [] -- n is unsigned! -- |Eumerates the MIDI destinations.
230
enumerateSources :: IO [Source] enumerateSources = do n <- c_midiInGetNumDevs return $ if n>0 then [ Source i | i<-[0..n-1] ] else [] -- n is unsigned! -- |Eumerates the MIDI destinations.
198
enumerateSources = do n <- c_midiInGetNumDevs return $ if n>0 then [ Source i | i<-[0..n-1] ] else [] -- n is unsigned! -- |Eumerates the MIDI destinations.
166
true
true
1
14
47
85
44
41
null
null
craffit/flexdb
src/Data/Traversable1.hs
bsd-3-clause
mkTraversable1' :: Dec -> Q [Dec] mkTraversable1' (DataD _ tnm pars cons _) = do names <- mapM newName $ map (('v':) . show) [1..(30 :: Int)] let (ps, f) = (\(x: xs) -> (reverse xs, x)) $ reverse $ map getTV pars funcName = mkName "f" mkCons c = let (cnm, tps) = getCons c ...
1,244
mkTraversable1' :: Dec -> Q [Dec] mkTraversable1' (DataD _ tnm pars cons _) = do names <- mapM newName $ map (('v':) . show) [1..(30 :: Int)] let (ps, f) = (\(x: xs) -> (reverse xs, x)) $ reverse $ map getTV pars funcName = mkName "f" mkCons c = let (cnm, tps) = getCons c ...
1,244
mkTraversable1' (DataD _ tnm pars cons _) = do names <- mapM newName $ map (('v':) . show) [1..(30 :: Int)] let (ps, f) = (\(x: xs) -> (reverse xs, x)) $ reverse $ map getTV pars funcName = mkName "f" mkCons c = let (cnm, tps) = getCons c (insts, exps) = unzip $ zipWit...
1,210
false
true
0
22
455
571
290
281
null
null
vincenthz/cryptonite
Crypto/Internal/WordArray.hs
bsd-3-clause
-- | Create a Mutable Array of Word32 of specific size from a list of Word32 mutableArray32 :: Int -> [Word32] -> IO MutableArray32 mutableArray32 (I# n) l = IO $ \s -> case newAlignedPinnedByteArray# (n *# 4#) 4# s of (# s', mbarr #) -> loop 0# s' mbarr l where loop _ st mb [] = (# st, MutableArr...
616
mutableArray32 :: Int -> [Word32] -> IO MutableArray32 mutableArray32 (I# n) l = IO $ \s -> case newAlignedPinnedByteArray# (n *# 4#) 4# s of (# s', mbarr #) -> loop 0# s' mbarr l where loop _ st mb [] = (# st, MutableArray32 mb #) loop i st mb ((W32# x):xs) | booleanPrim (i ==...
539
mutableArray32 (I# n) l = IO $ \s -> case newAlignedPinnedByteArray# (n *# 4#) 4# s of (# s', mbarr #) -> loop 0# s' mbarr l where loop _ st mb [] = (# st, MutableArray32 mb #) loop i st mb ((W32# x):xs) | booleanPrim (i ==# n) = (# st, MutableArray32 mb #) | otherw...
484
true
true
4
10
198
206
103
103
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
dtsBlock :: FrozenSet String dtsBlock = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
135
dtsBlock :: FrozenSet String dtsBlock = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
135
dtsBlock = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
106
false
true
0
7
18
42
23
19
null
null
esmolanka/simple-pi
src/Language/SimplePi/Pretty.hs
bsd-3-clause
ppExprF :: Int -> ExprF Expr -> Doc ppExprF p expr = case expr of App _ a b rest -> pParen (p >= 8) $ group $ nest 2 $ vsep $ map (ppExpr 8) (a : b : rest) Pi _ bnd e -> pParen (p >= 5) $ group $ nest 2 $ ppBnd' bnd </> text "→" <+> ppExpr 3 e Arrow _ a b rest -> let (lst, bdy) = (las...
913
ppExprF :: Int -> ExprF Expr -> Doc ppExprF p expr = case expr of App _ a b rest -> pParen (p >= 8) $ group $ nest 2 $ vsep $ map (ppExpr 8) (a : b : rest) Pi _ bnd e -> pParen (p >= 5) $ group $ nest 2 $ ppBnd' bnd </> text "→" <+> ppExpr 3 e Arrow _ a b rest -> let (lst, bdy) = (las...
913
ppExprF p expr = case expr of App _ a b rest -> pParen (p >= 8) $ group $ nest 2 $ vsep $ map (ppExpr 8) (a : b : rest) Pi _ bnd e -> pParen (p >= 5) $ group $ nest 2 $ ppBnd' bnd </> text "→" <+> ppExpr 3 e Arrow _ a b rest -> let (lst, bdy) = (last &&& init) (a : b : rest) in ...
877
false
true
0
15
320
459
220
239
null
null
jjingram/satori
src/Codegen.hs
bsd-3-clause
alloca :: AST.Type -> Codegen Operand alloca t = instr t $ Alloca t Nothing 0 []
80
alloca :: AST.Type -> Codegen Operand alloca t = instr t $ Alloca t Nothing 0 []
80
alloca t = instr t $ Alloca t Nothing 0 []
42
false
true
0
7
16
41
19
22
null
null
spacekitteh/smcghc
compiler/codeGen/StgCmmUtils.hs
bsd-3-clause
newUnboxedTupleRegs :: Type -> FCode ([LocalReg], [ForeignHint]) -- Choose suitable local regs to use for the components -- of an unboxed tuple that we are about to return to -- the Sequel. If the Sequel is a join point, using the -- regs it wants will save later assignments. newUnboxedTupleRegs res_ty = ASSERT( isU...
1,022
newUnboxedTupleRegs :: Type -> FCode ([LocalReg], [ForeignHint]) newUnboxedTupleRegs res_ty = ASSERT( isUnboxedTupleType res_ty ) do { dflags <- getDynFlags ; sequel <- getSequel ; regs <- choose_regs dflags sequel ; ASSERT( regs `equalLength` reps ) return (regs, map primRepFor...
809
newUnboxedTupleRegs res_ty = ASSERT( isUnboxedTupleType res_ty ) do { dflags <- getDynFlags ; sequel <- getSequel ; regs <- choose_regs dflags sequel ; ASSERT( regs `equalLength` reps ) return (regs, map primRepForeignHint reps) } where UbxTupleRep ty_args = repType res_ty...
744
true
true
2
10
241
225
112
113
null
null
siddhanathan/ghc
compiler/prelude/THNames.hs
bsd-3-clause
listTName = libFun (fsLit "listT") listTIdKey
64
listTName = libFun (fsLit "listT") listTIdKey
64
listTName = libFun (fsLit "listT") listTIdKey
64
false
false
0
7
24
17
8
9
null
null
ezyang/ghc
testsuite/tests/gadt/rw.hs
bsd-3-clause
main = do tt (La undefined) ref <- newIORef undefined writeInt (La undefined) ref readBool (La undefined) ref
141
main = do tt (La undefined) ref <- newIORef undefined writeInt (La undefined) ref readBool (La undefined) ref
141
main = do tt (La undefined) ref <- newIORef undefined writeInt (La undefined) ref readBool (La undefined) ref
141
false
false
1
10
49
60
24
36
null
null
BeautifulDestinations/fb
src/Facebook/Object/Marketing/AdAccount.hs
bsd-3-clause
unBusinessZip_ :: BusinessZip_ -> Text unBusinessZip_ (BusinessZip_ x) = x
74
unBusinessZip_ :: BusinessZip_ -> Text unBusinessZip_ (BusinessZip_ x) = x
74
unBusinessZip_ (BusinessZip_ x) = x
35
false
true
0
6
9
28
13
15
null
null
mariefarrell/Hets
Common/Doc.hs
gpl-2.0
hcat :: [Doc] -> Doc -- ^List version of '<>' hcat = Cat Horiz . rmEmpties
83
hcat :: [Doc] -> Doc hcat = Cat Horiz . rmEmpties
49
hcat = Cat Horiz . rmEmpties
28
true
true
0
7
24
32
15
17
null
null
green-haskell/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
hsExprNeedsParens (HsBracket {}) = False
45
hsExprNeedsParens (HsBracket {}) = False
45
hsExprNeedsParens (HsBracket {}) = False
45
false
false
0
6
9
17
8
9
null
null
ardumont/snake
deps/gloss-rendering/Graphics/Gloss/Internals/Data/Picture.hs
bsd-3-clause
bitmapOfForeignPtr :: Int -> Int -> ForeignPtr Word8 -> Bool -> Picture bitmapOfForeignPtr width height fptr cacheMe = let len = width * height * 4 bdata = BitmapData len fptr in Bitmap width height bdata cacheMe
233
bitmapOfForeignPtr :: Int -> Int -> ForeignPtr Word8 -> Bool -> Picture bitmapOfForeignPtr width height fptr cacheMe = let len = width * height * 4 bdata = BitmapData len fptr in Bitmap width height bdata cacheMe
233
bitmapOfForeignPtr width height fptr cacheMe = let len = width * height * 4 bdata = BitmapData len fptr in Bitmap width height bdata cacheMe
161
false
true
0
10
57
77
37
40
null
null
ryantrinkle/ghcjs
src/Gen2/Prim.hs
mit
genPrim _ _ TraceMarkerOp [] [ed,eo] = PrimInline [j| h$traceMarker(`ed`, `eo`); |]
83
genPrim _ _ TraceMarkerOp [] [ed,eo] = PrimInline [j| h$traceMarker(`ed`, `eo`); |]
83
genPrim _ _ TraceMarkerOp [] [ed,eo] = PrimInline [j| h$traceMarker(`ed`, `eo`); |]
83
false
false
3
6
11
33
18
15
null
null
aelve/json-x
lib/Json/Internal/JsonParser.hs
bsd-3-clause
-- $lazy -- -- The 'json' parser decouples identification from -- conversion. Identification occurs immediately (so that an invalid -- JSON document can be rejected as early as possible), but conversion -- to a Haskell value is deferred until that value is needed. -- -- This decoupling can be time-efficient if only a ...
882
jsonEOF :: Parser Json jsonEOF = json <* skipSpace <* endOfInput
64
jsonEOF = json <* skipSpace <* endOfInput
41
true
true
0
6
155
41
30
11
null
null
jtapolczai/wumpus
World/Utils.hs
apache-2.0
shortestPaths :: World -> CellInd -> CellInd -> [[CellInd]] shortestPaths world cur t = if cur == t then return [cur] else do next <- adjacentTilesToward (world ^. graph) cur t guard $ M.member next (world ^. cellData) rest <- shortestPaths world next t ...
544
shortestPaths :: World -> CellInd -> CellInd -> [[CellInd]] shortestPaths world cur t = if cur == t then return [cur] else do next <- adjacentTilesToward (world ^. graph) cur t guard $ M.member next (world ^. cellData) rest <- shortestPaths world next t ...
544
shortestPaths world cur t = if cur == t then return [cur] else do next <- adjacentTilesToward (world ^. graph) cur t guard $ M.member next (world ^. cellData) rest <- shortestPaths world next t return (cur : rest) -- |Searches all p...
484
false
true
0
11
173
126
64
62
null
null
UBMLtonGroup/timberc
src/Env.hs
bsd-3-clause
findWG (RInv _ Pos i) (env,_) = concatWG reflWG (findAbove env i)
75
findWG (RInv _ Pos i) (env,_) = concatWG reflWG (findAbove env i)
75
findWG (RInv _ Pos i) (env,_) = concatWG reflWG (findAbove env i)
75
false
false
0
7
21
40
20
20
null
null
kim/amazonka
amazonka-sts/gen/Network/AWS/STS/AssumeRoleWithSAML.hs
mpl-2.0
-- | 'AssumeRoleWithSAMLResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'arwsamlrAssumedRoleUser' @::@ 'Maybe' 'AssumedRoleUser' -- -- * 'arwsamlrAudience' @::@ 'Maybe' 'Text' -- -- * 'arwsamlrCredentials' @::@ 'Maybe' 'Credentials' -- -- * 'arwsamlrIssuer' @::@ 'Maybe' 'Tex...
986
assumeRoleWithSAMLResponse :: AssumeRoleWithSAMLResponse assumeRoleWithSAMLResponse = AssumeRoleWithSAMLResponse { _arwsamlrCredentials = Nothing , _arwsamlrAssumedRoleUser = Nothing , _arwsamlrPackedPolicySize = Nothing , _arwsamlrSubject = Nothing , _arwsamlrSubjectType = Nothi...
454
assumeRoleWithSAMLResponse = AssumeRoleWithSAMLResponse { _arwsamlrCredentials = Nothing , _arwsamlrAssumedRoleUser = Nothing , _arwsamlrPackedPolicySize = Nothing , _arwsamlrSubject = Nothing , _arwsamlrSubjectType = Nothing , _arwsamlrIssuer = Nothing , _arwsa...
397
true
true
0
7
185
85
60
25
null
null
exbb2/BlastItWithPiss
src/GtkBlast/GtkUtils.hs
gpl-3.0
windowToggle :: Window -> IO () windowToggle window = ifM (get window widgetVisible) (widgetHide window) (windowPopup window)
145
windowToggle :: Window -> IO () windowToggle window = ifM (get window widgetVisible) (widgetHide window) (windowPopup window)
145
windowToggle window = ifM (get window widgetVisible) (widgetHide window) (windowPopup window)
113
false
true
0
7
36
50
24
26
null
null
oldmanmike/ghc
compiler/hsSyn/HsUtils.hs
bsd-3-clause
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc = if omitPatSyn then acc else ps : acc
109
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc = if omitPatSyn then acc else ps : acc
109
collect_bind omitPatSyn (PatSynBind (PSB { psb_id = L _ ps })) acc = if omitPatSyn then acc else ps : acc
109
false
false
0
12
24
49
25
24
null
null
yoo-e/hs-tar-conduit
Codec/Archive/Tar/Check.hs
bsd-3-clause
showFileNameError :: Maybe PortabilityPlatform -> FileNameError -> String showFileNameError mb_plat err = case err of InvalidFileName path -> "Invalid" ++ plat ++ " file name in tar archive: " ++ show path AbsoluteFileName path -> "Absolute" ++ plat ++ " file name in tar archive: " ++ show path where plat =...
893
showFileNameError :: Maybe PortabilityPlatform -> FileNameError -> String showFileNameError mb_plat err = case err of InvalidFileName path -> "Invalid" ++ plat ++ " file name in tar archive: " ++ show path AbsoluteFileName path -> "Absolute" ++ plat ++ " file name in tar archive: " ++ show path where plat =...
893
showFileNameError mb_plat err = case err of InvalidFileName path -> "Invalid" ++ plat ++ " file name in tar archive: " ++ show path AbsoluteFileName path -> "Absolute" ++ plat ++ " file name in tar archive: " ++ show path where plat = maybe "" (' ':) mb_plat -------------------------- -- Tarbombs -- -- |...
819
false
true
7
6
158
94
59
35
null
null
dmjio/miso
src/Miso/Svg/Attribute.hs
bsd-3-clause
-- | <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/y2> y2_ :: MisoString -> Attribute action y2_ = attr "y2"
123
y2_ :: MisoString -> Attribute action y2_ = attr "y2"
54
y2_ = attr "y2"
15
true
true
0
7
13
27
12
15
null
null
dmalkr/fp-course-2015
game.hs
mit
showRank R10 = "10"
21
showRank R10 = "10"
21
showRank R10 = "10"
21
false
false
1
5
5
13
4
9
null
null
leshchevds/ganeti
src/Ganeti/Locking/Locks.hs
bsd-2-clause
lockName NetworkLockSet = "network/[lockset]"
45
lockName NetworkLockSet = "network/[lockset]"
45
lockName NetworkLockSet = "network/[lockset]"
45
false
false
0
5
3
9
4
5
null
null
tolysz/postgresql-simple
src/Database/PostgreSQL/Simple/Internal.hs
bsd-3-clause
oid2int :: Oid -> Int oid2int (Oid x) = fromIntegral x
54
oid2int :: Oid -> Int oid2int (Oid x) = fromIntegral x
54
oid2int (Oid x) = fromIntegral x
32
false
true
0
7
10
27
13
14
null
null
conal/monomorph
test/Examples.hs
bsd-3-clause
sumT (B (u :# v)) = sumT u + sumT v
35
sumT (B (u :# v)) = sumT u + sumT v
35
sumT (B (u :# v)) = sumT u + sumT v
35
false
false
2
8
10
35
15
20
null
null
portnov/localize
hgettext.hs
bsd-3-clause
process :: Options -> [String] -> IO () process Options{printVersion = True} _ = putStrLn $ "hgettext, version " ++ (showVersion version)
142
process :: Options -> [String] -> IO () process Options{printVersion = True} _ = putStrLn $ "hgettext, version " ++ (showVersion version)
142
process Options{printVersion = True} _ = putStrLn $ "hgettext, version " ++ (showVersion version)
102
false
true
0
8
26
55
28
27
null
null
yliu120/K3
src/Language/K3/Analysis/SEffects/Inference.hs
apache-2.0
fiexteM :: Identifier -> K3 Effect -> FInfM () fiexteM n f = get >>= \env -> return (fiexte env n f) >>= put
108
fiexteM :: Identifier -> K3 Effect -> FInfM () fiexteM n f = get >>= \env -> return (fiexte env n f) >>= put
108
fiexteM n f = get >>= \env -> return (fiexte env n f) >>= put
61
false
true
0
10
23
58
28
30
null
null
fmapfmapfmap/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/Types/Product.hs
mpl-2.0
-- | The origin protocol policy to apply to your origin. cocOriginProtocolPolicy :: Lens' CustomOriginConfig OriginProtocolPolicy cocOriginProtocolPolicy = lens _cocOriginProtocolPolicy (\ s a -> s{_cocOriginProtocolPolicy = a})
228
cocOriginProtocolPolicy :: Lens' CustomOriginConfig OriginProtocolPolicy cocOriginProtocolPolicy = lens _cocOriginProtocolPolicy (\ s a -> s{_cocOriginProtocolPolicy = a})
171
cocOriginProtocolPolicy = lens _cocOriginProtocolPolicy (\ s a -> s{_cocOriginProtocolPolicy = a})
98
true
true
0
9
26
40
22
18
null
null
peterokagey/haskellOEIS
src/Helpers/GridLabeling.hs
apache-2.0
-- Check if the slope of any two tuples is equal. -- e.g. (3, 7), (1, 6), (7, 9): -- (3 - 1, 7 - 6) = (2, 1) -- (1 - 7, 6 - 9) = (-6, -3) onALine :: Integral a => (a, a) -> (a, a) -> (a, a) -> Bool onALine (a_0, b_0) (a_1, b_1) (a_2, b_2) | b_0 == b_1 && b_0 == b_2 = True | b_0 == b_1 || b_0 == b_2 = False | ...
386
onALine :: Integral a => (a, a) -> (a, a) -> (a, a) -> Bool onALine (a_0, b_0) (a_1, b_1) (a_2, b_2) | b_0 == b_1 && b_0 == b_2 = True | b_0 == b_1 || b_0 == b_2 = False | otherwise = (a_0 - a_1) % (b_0 - b_1) == (a_0 - a_2) % (b_0 - b_2)
244
onALine (a_0, b_0) (a_1, b_1) (a_2, b_2) | b_0 == b_1 && b_0 == b_2 = True | b_0 == b_1 || b_0 == b_2 = False | otherwise = (a_0 - a_1) % (b_0 - b_1) == (a_0 - a_2) % (b_0 - b_2)
184
true
true
1
10
108
166
91
75
null
null
teuffy/interactive-brokers
library/API/IB/Builder.hs
bsd-3-clause
-- -------------------------------------------------------------------------- -- Orders marketOrder :: Int -> Int -> IBOrderAction -> Int -> IBOrder marketOrder order_id client_id action quantity = newIBOrder { _orderId = order_id , _orderClientId = client_id , _orderAction = action , _orderTotalQuantity = qua...
379
marketOrder :: Int -> Int -> IBOrderAction -> Int -> IBOrder marketOrder order_id client_id action quantity = newIBOrder { _orderId = order_id , _orderClientId = client_id , _orderAction = action , _orderTotalQuantity = quantity , _orderType = Market , _orderTransmit = True }
290
marketOrder order_id client_id action quantity = newIBOrder { _orderId = order_id , _orderClientId = client_id , _orderAction = action , _orderTotalQuantity = quantity , _orderType = Market , _orderTransmit = True }
229
true
true
0
8
61
80
46
34
null
null
melted/idris-java
src/IRTS/Java/JTypes.hs
bsd-3-clause
sourceTypes (LPar) = [objectType]
33
sourceTypes (LPar) = [objectType]
33
sourceTypes (LPar) = [objectType]
33
false
false
0
5
3
16
8
8
null
null
rahulmutt/ghcvm
compiler/Eta/Prelude/PrimOp.hs
bsd-3-clause
primOpInfo SizeofMutableArrayArrayOp = mkGenPrimOp (fsLit "sizeofMutableArrayArray#") [deltaTyVar] [mkMutableArrayArrayPrimTy deltaTy] (intPrimTy)
147
primOpInfo SizeofMutableArrayArrayOp = mkGenPrimOp (fsLit "sizeofMutableArrayArray#") [deltaTyVar] [mkMutableArrayArrayPrimTy deltaTy] (intPrimTy)
147
primOpInfo SizeofMutableArrayArrayOp = mkGenPrimOp (fsLit "sizeofMutableArrayArray#") [deltaTyVar] [mkMutableArrayArrayPrimTy deltaTy] (intPrimTy)
147
false
false
0
7
10
36
18
18
null
null
brendanhay/gogol
gogol-iam/gen/Network/Google/IAM/Types/Product.hs
mpl-2.0
-- | Output only. The resource name of the pool. wlipName :: Lens' WorkLoadIdentityPool (Maybe Text) wlipName = lens _wlipName (\ s a -> s{_wlipName = a})
154
wlipName :: Lens' WorkLoadIdentityPool (Maybe Text) wlipName = lens _wlipName (\ s a -> s{_wlipName = a})
105
wlipName = lens _wlipName (\ s a -> s{_wlipName = a})
53
true
true
1
9
26
50
25
25
null
null
foreverbell/project-euler-solutions
src/378.hs
bsd-3-clause
main = print $ solve 60000000
29
main = print $ solve 60000000
29
main = print $ solve 60000000
29
false
false
3
5
5
17
6
11
null
null
creichert/persistent
persistent-template/Database/Persist/TH.hs
mit
degen x = x
11
degen x = x
11
degen x = x
11
false
false
1
5
3
13
4
9
null
null
benweitzman/PhoBuddies
src/Config.hs
mit
run :: ScottyT Failure ConfigM () -> Config -> IO () run application c = do o <- getOptions (environment c) let r m = runReaderT (runConfigM m) c scottyOptsT o r r application
181
run :: ScottyT Failure ConfigM () -> Config -> IO () run application c = do o <- getOptions (environment c) let r m = runReaderT (runConfigM m) c scottyOptsT o r r application
181
run application c = do o <- getOptions (environment c) let r m = runReaderT (runConfigM m) c scottyOptsT o r r application
128
false
true
0
13
39
94
41
53
null
null
vizziv/qsim
src/Simulate.hs
bsd-3-clause
ifActive :: IsJob job => JobType -> Simulation job (Maybe a) -> Simulation job (Maybe a) ifActive jt x = do jtq <- use jtqActive if Just jt == jtq then x else return Nothing
185
ifActive :: IsJob job => JobType -> Simulation job (Maybe a) -> Simulation job (Maybe a) ifActive jt x = do jtq <- use jtqActive if Just jt == jtq then x else return Nothing
185
ifActive jt x = do jtq <- use jtqActive if Just jt == jtq then x else return Nothing
88
false
true
0
10
46
84
39
45
null
null
mfine/hs-talks
src/Libv11.hs
bsd-3-clause
rankingsParser :: Parser [Ranking] rankingsParser = many1 rankingParser
71
rankingsParser :: Parser [Ranking] rankingsParser = many1 rankingParser
71
rankingsParser = many1 rankingParser
36
false
true
0
6
7
20
10
10
null
null
philopon/atomos
Text/Atomos/Lens.hs
mit
_XHtmlText :: Prism' A.TextElement [Tag S.ByteString] _XHtmlText = prism A.XHtmlText to where to (A.XHtmlText b) = Right b to x = Left x
154
_XHtmlText :: Prism' A.TextElement [Tag S.ByteString] _XHtmlText = prism A.XHtmlText to where to (A.XHtmlText b) = Right b to x = Left x
154
_XHtmlText = prism A.XHtmlText to where to (A.XHtmlText b) = Right b to x = Left x
100
false
true
2
8
40
74
31
43
null
null
martinvlk/cis194-homeworks
tests/HW07/MainT.hs
gpl-3.0
prop_indexJ :: Int -> (JoinList Size Int) -> Bool prop_indexJ i jl = (indexJ i jl) == (jlToList jl !!? i)
105
prop_indexJ :: Int -> (JoinList Size Int) -> Bool prop_indexJ i jl = (indexJ i jl) == (jlToList jl !!? i)
105
prop_indexJ i jl = (indexJ i jl) == (jlToList jl !!? i)
55
false
true
0
8
20
54
27
27
null
null
Melvar/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
constDocs (I i) = "A fixed-precision integer"
72
constDocs (I i) = "A fixed-precision integer"
72
constDocs (I i) = "A fixed-precision integer"
72
false
false
0
6
33
16
7
9
null
null
NickAger/LearningHaskell
ParallelConcurrent/2-BankAccount.hsproj/Account7.hs
mit
limitedWithdraw2 :: Account -> Account -> Int -> STM () -- (limitedWithdraw2 acc1 acc2 amt) withdraws amt from acc1, -- if acc1 has enough money, otherwise from acc2. -- If neither has enough, it retries. limitedWithdraw2 acc1 acc2 amt = orElse (limitedWithdraw acc1 amt) (limitedWithdraw acc2 amt)
300
limitedWithdraw2 :: Account -> Account -> Int -> STM () limitedWithdraw2 acc1 acc2 amt = orElse (limitedWithdraw acc1 amt) (limitedWithdraw acc2 amt)
151
limitedWithdraw2 acc1 acc2 amt = orElse (limitedWithdraw acc1 amt) (limitedWithdraw acc2 amt)
95
true
true
0
9
48
65
31
34
null
null
YoEight/spellcheck
lib/Data/Spellcheck/HolbrookCorpus.hs
mit
parser :: Parser Sentence parser = takeWhile isAlphaNum >>= go where go xs | T.null xs = do end <- atEnd if end then return [SEnd] else peekChar' >>= loop | otherwise = do cOpt <- peekChar case cOpt of Nothing -> return [mkDatum xs, S...
662
parser :: Parser Sentence parser = takeWhile isAlphaNum >>= go where go xs | T.null xs = do end <- atEnd if end then return [SEnd] else peekChar' >>= loop | otherwise = do cOpt <- peekChar case cOpt of Nothing -> return [mkDatum xs, S...
662
parser = takeWhile isAlphaNum >>= go where go xs | T.null xs = do end <- atEnd if end then return [SEnd] else peekChar' >>= loop | otherwise = do cOpt <- peekChar case cOpt of Nothing -> return [mkDatum xs, SEnd] Just ...
636
false
true
5
12
256
254
120
134
null
null
SaneApp/hedis-simple
src/Database/Redis/Simple.hs
mit
decrBy :: (R.RedisCtx mi r, WrappedRedis m mi r) => ByteString -> Integer -> m Integer decrBy k = wrap . R.decrby k
115
decrBy :: (R.RedisCtx mi r, WrappedRedis m mi r) => ByteString -> Integer -> m Integer decrBy k = wrap . R.decrby k
115
decrBy k = wrap . R.decrby k
28
false
true
0
8
22
57
28
29
null
null
HacklabJKL/telepulssi-arduino
tools/Telepulssi.hs
agpl-3.0
-- |Converts grayscale image to serial format. telepulssify :: Image Pixel8 -> Either String B.ByteString telepulssify img = case (imageWidth img, imageHeight img) of -- Generate raw binary 2-bit grayscale data and produce final serial -- data. (40, 7) -> let binaryImg = runPut $ runBitPut $ pixelFoldM binarize (...
415
telepulssify :: Image Pixel8 -> Either String B.ByteString telepulssify img = case (imageWidth img, imageHeight img) of -- Generate raw binary 2-bit grayscale data and produce final serial -- data. (40, 7) -> let binaryImg = runPut $ runBitPut $ pixelFoldM binarize () img in Right $ "~F" `B.append` e...
368
telepulssify img = case (imageWidth img, imageHeight img) of -- Generate raw binary 2-bit grayscale data and produce final serial -- data. (40, 7) -> let binaryImg = runPut $ runBitPut $ pixelFoldM binarize () img in Right $ "~F" `B.append` escape binaryImg _ -> Left "Image must be 40×7"
309
true
true
0
14
85
115
57
58
null
null
MysterionRise/octo-shell
src/Utils/Helpers.hs
mit
greetHardcodedUser = putStrLn $ defaultGreeting
47
greetHardcodedUser = putStrLn $ defaultGreeting
47
greetHardcodedUser = putStrLn $ defaultGreeting
47
false
false
0
5
4
10
5
5
null
null
NICTA/tickle
src/Data/Tickle/Get.hs
bsd-3-clause
lookAheadM :: Get e (Maybe a) -> Get e (Maybe a) lookAheadM g = let g' = fmap (maybe (Left ()) Right) g in fmap (either (return Nothing) Just) (lookAheadE g')
166
lookAheadM :: Get e (Maybe a) -> Get e (Maybe a) lookAheadM g = let g' = fmap (maybe (Left ()) Right) g in fmap (either (return Nothing) Just) (lookAheadE g')
166
lookAheadM g = let g' = fmap (maybe (Left ()) Right) g in fmap (either (return Nothing) Just) (lookAheadE g')
113
false
true
0
14
38
98
46
52
null
null
mgsloan/quasi-extras
examples/Example1.hs
bsd-3-clause
app l r = traceShow (typeOf r) (l r)
36
app l r = traceShow (typeOf r) (l r)
36
app l r = traceShow (typeOf r) (l r)
36
false
false
0
7
8
28
13
15
null
null
lynnard/cocos2d-hs
src/Graphics/UI/Cocos2d/Widget.hs
bsd-3-clause
widgetEventCallback_new :: (M2.Ref -> HoppyP.Int -> HoppyP.IO ()) -> HoppyP.IO (HoppyFHR.CCallback (HoppyF.Ptr M2.Ref -> HoppyFC.CInt -> HoppyP.IO ())) widgetEventCallback_new f'hs = do f'p <- widgetEventCallback_newFunPtr f'hs widgetEventCallback_new'newCallback f'p HoppyFHR.freeHaskellFunPtrFunPtr HoppyP.False
317
widgetEventCallback_new :: (M2.Ref -> HoppyP.Int -> HoppyP.IO ()) -> HoppyP.IO (HoppyFHR.CCallback (HoppyF.Ptr M2.Ref -> HoppyFC.CInt -> HoppyP.IO ())) widgetEventCallback_new f'hs = do f'p <- widgetEventCallback_newFunPtr f'hs widgetEventCallback_new'newCallback f'p HoppyFHR.freeHaskellFunPtrFunPtr HoppyP.False
317
widgetEventCallback_new f'hs = do f'p <- widgetEventCallback_newFunPtr f'hs widgetEventCallback_new'newCallback f'p HoppyFHR.freeHaskellFunPtrFunPtr HoppyP.False
165
false
true
0
13
33
104
49
55
null
null
mariefarrell/Hets
Maude/PreComorphism.hs
gpl-2.0
getTop :: MSign.SubsortRel -> MSym.Symbol -> [MSym.Symbol] getTop r tok = case succs of [] -> [tok] toks@(_ : _) -> concatMap (getTop r) toks where succs = Set.toList $ Rel.succs r tok -- | delete from the list of sorts those in the same kind that the parameter
290
getTop :: MSign.SubsortRel -> MSym.Symbol -> [MSym.Symbol] getTop r tok = case succs of [] -> [tok] toks@(_ : _) -> concatMap (getTop r) toks where succs = Set.toList $ Rel.succs r tok -- | delete from the list of sorts those in the same kind that the parameter
290
getTop r tok = case succs of [] -> [tok] toks@(_ : _) -> concatMap (getTop r) toks where succs = Set.toList $ Rel.succs r tok -- | delete from the list of sorts those in the same kind that the parameter
231
false
true
0
10
77
102
51
51
null
null
schell/odin
odin-engine/test/Spec.hs
mit
fourComp :: (Member (Writer [String]) r, Member (State Int) r, Member Next r) => Eff r () fourComp = do tell ["i4"] fix $ \loop -> do n :: Int <- get tell ["r4-" ++ show n] put $ n + 1 when (n < 4) $ next loop tell ["d4"]
243
fourComp :: (Member (Writer [String]) r, Member (State Int) r, Member Next r) => Eff r () fourComp = do tell ["i4"] fix $ \loop -> do n :: Int <- get tell ["r4-" ++ show n] put $ n + 1 when (n < 4) $ next loop tell ["d4"]
243
fourComp = do tell ["i4"] fix $ \loop -> do n :: Int <- get tell ["r4-" ++ show n] put $ n + 1 when (n < 4) $ next loop tell ["d4"]
153
false
true
0
14
72
148
71
77
null
null
quchen/prettyprinter
prettyprinter-ansi-terminal/src/Prettyprinter/Render/Terminal/Internal.hs
bsd-2-clause
modifyIORef' :: IORef a -> (a -> a) -> IO () modifyIORef' ref f = do x <- readIORef ref let x' = f x x' `seq` writeIORef ref x' #endif -- $setup -- -- (Definitions for the doctests) -- -- >>> :set -XOverloadedStrings -- >>> import qualified Data.Text.Lazy.IO as TL -- >>> import qualified Data.Text.Lazy as ...
402
modifyIORef' :: IORef a -> (a -> a) -> IO () modifyIORef' ref f = do x <- readIORef ref let x' = f x x' `seq` writeIORef ref x' #endif -- $setup -- -- (Definitions for the doctests) -- -- >>> :set -XOverloadedStrings -- >>> import qualified Data.Text.Lazy.IO as TL -- >>> import qualified Data.Text.Lazy as ...
402
modifyIORef' ref f = do x <- readIORef ref let x' = f x x' `seq` writeIORef ref x' #endif -- $setup -- -- (Definitions for the doctests) -- -- >>> :set -XOverloadedStrings -- >>> import qualified Data.Text.Lazy.IO as TL -- >>> import qualified Data.Text.Lazy as TL -- >>> import Prettyprinter.Render.Termina...
357
false
true
0
10
84
85
45
40
null
null
SimSaladin/rnfssp
rnfssp-util/Utils.hs
bsd-3-clause
cssMyTransition :: Mixin cssMyTransition = [luciusMixin| -webkit-transition: opacity .4s ease-in-out; -moz-transition: opacity .4s ease-in-out; -ms-transition: opacity .4s ease-in-out; -o-transition: opacity .4s ease-in-out; transition: opacity .4s ease-in-out; |]
268
cssMyTransition :: Mixin cssMyTransition = [luciusMixin| -webkit-transition: opacity .4s ease-in-out; -moz-transition: opacity .4s ease-in-out; -ms-transition: opacity .4s ease-in-out; -o-transition: opacity .4s ease-in-out; transition: opacity .4s ease-in-out; |]
268
cssMyTransition = [luciusMixin| -webkit-transition: opacity .4s ease-in-out; -moz-transition: opacity .4s ease-in-out; -ms-transition: opacity .4s ease-in-out; -o-transition: opacity .4s ease-in-out; transition: opacity .4s ease-in-out; |]
243
false
true
0
4
30
15
10
5
null
null
szehk/Haskell-Carbonara-Library
src/Data/Carbonara/Writer.hs
bsd-3-clause
-- 2 to 62 composeTupleToList :: Int -> String composeTupleToList i = concat [ "\n", "tupleToList", istr, " :: ", incrementWord "(Show x)" i , "\n => ", incrementWord "(x)" i, " -> [Maybe String]" , "\n", "tupleToList", istr, " ", incrementWord ...
492
composeTupleToList :: Int -> String composeTupleToList i = concat [ "\n", "tupleToList", istr, " :: ", incrementWord "(Show x)" i , "\n => ", incrementWord "(x)" i, " -> [Maybe String]" , "\n", "tupleToList", istr, " ", incrementWord "(x)" i, " =" ...
478
composeTupleToList i = concat [ "\n", "tupleToList", istr, " :: ", incrementWord "(Show x)" i , "\n => ", incrementWord "(x)" i, " -> [Maybe String]" , "\n", "tupleToList", istr, " ", incrementWord "(x)" i, " =" , "\n", ...
442
true
true
0
7
223
106
60
46
null
null
spacekitteh/smcghc
libraries/base/Control/Monad/ST/Lazy/Imp.hs
bsd-3-clause
unsafeIOToST :: IO a -> ST s a unsafeIOToST = strictToLazyST . ST.unsafeIOToST
78
unsafeIOToST :: IO a -> ST s a unsafeIOToST = strictToLazyST . ST.unsafeIOToST
78
unsafeIOToST = strictToLazyST . ST.unsafeIOToST
47
false
true
0
7
12
35
15
20
null
null
olsner/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLbl (CaseLabel u CaseReturnInfo) = hcat [pprUnique u, text "_info"]
73
pprCLbl (CaseLabel u CaseReturnInfo) = hcat [pprUnique u, text "_info"]
73
pprCLbl (CaseLabel u CaseReturnInfo) = hcat [pprUnique u, text "_info"]
73
false
false
0
6
11
33
15
18
null
null
querqueq/netwire01
src/Lib.hs
bsd-3-clause
move :: Point -> Point -> Point move (xo,yo) (x,y) = (xo+x,yo+y)
64
move :: Point -> Point -> Point move (xo,yo) (x,y) = (xo+x,yo+y)
64
move (xo,yo) (x,y) = (xo+x,yo+y)
32
false
true
0
9
11
56
29
27
null
null
airt/Haskell-99
src/NinetyNine/P6X.hs
mit
stringToTree :: String -> Maybe (BTree Char) stringToTree = snd . parseTree where parseTree :: String -> (String, Maybe (BTree Char)) parseTree (',' : s) = (s, Just Empty) parseTree (')' : s) = (s, Just Empty) parseTree (x : ',' : s) = (s, Just $ Branch x Empty Empty) parseTree (x : ')' : s) = (s,...
1,632
stringToTree :: String -> Maybe (BTree Char) stringToTree = snd . parseTree where parseTree :: String -> (String, Maybe (BTree Char)) parseTree (',' : s) = (s, Just Empty) parseTree (')' : s) = (s, Just Empty) parseTree (x : ',' : s) = (s, Just $ Branch x Empty Empty) parseTree (x : ')' : s) = (s,...
1,632
stringToTree = snd . parseTree where parseTree :: String -> (String, Maybe (BTree Char)) parseTree (',' : s) = (s, Just Empty) parseTree (')' : s) = (s, Just Empty) parseTree (x : ',' : s) = (s, Just $ Branch x Empty Empty) parseTree (x : ')' : s) = (s, Just $ Branch x Empty Empty) parseTree (...
1,587
false
true
1
11
363
279
140
139
null
null
chrra/iCalendar
Text/ICalendar/Printer.hs
bsd-3-clause
foldLine :: ContentPrinter () foldLine = tell (Bu.byteString "\r\n ") >> put 1
78
foldLine :: ContentPrinter () foldLine = tell (Bu.byteString "\r\n ") >> put 1
78
foldLine = tell (Bu.byteString "\r\n ") >> put 1
48
false
true
1
8
12
37
16
21
null
null
entropia/tip-toi-reveng
src/Commands.hs
mit
writeImagesForCodes :: Bool -> Conf -> [Word16] -> IO () writeImagesForCodes False conf codes = forM_ codes $ \c -> do let format = fromMaybe PNG (cImageFormat conf) let filename = printf "oid-%d.%s" c (suffixOf format) let title = printf "code %d" c let url = printf "%d" c ...
364
writeImagesForCodes :: Bool -> Conf -> [Word16] -> IO () writeImagesForCodes False conf codes = forM_ codes $ \c -> do let format = fromMaybe PNG (cImageFormat conf) let filename = printf "oid-%d.%s" c (suffixOf format) let title = printf "code %d" c let url = printf "%d" c ...
364
writeImagesForCodes False conf codes = forM_ codes $ \c -> do let format = fromMaybe PNG (cImageFormat conf) let filename = printf "oid-%d.%s" c (suffixOf format) let title = printf "code %d" c let url = printf "%d" c writeImage format conf title url c filename
307
false
true
0
14
101
136
63
73
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/paper/haroldcarr/2014-02-23-concrete-monads-0-motivating-example/concrete-monads-0-motivating-example.hs
unlicense
eval0 env (Plus e1 e2) = let IntVal i1 = eval0 env e1 IntVal i2 = eval0 env e2 in IntVal (i1 + i2)
156
eval0 env (Plus e1 e2) = let IntVal i1 = eval0 env e1 IntVal i2 = eval0 env e2 in IntVal (i1 + i2)
156
eval0 env (Plus e1 e2) = let IntVal i1 = eval0 env e1 IntVal i2 = eval0 env e2 in IntVal (i1 + i2)
156
false
false
0
9
81
63
28
35
null
null
polux/snippets
AbstractInterpreter.hs
apache-2.0
evalInstr :: Instr -> Store -> Store evalInstr (Assign x e) s = M.insert x (evalExpr e s) s
91
evalInstr :: Instr -> Store -> Store evalInstr (Assign x e) s = M.insert x (evalExpr e s) s
91
evalInstr (Assign x e) s = M.insert x (evalExpr e s) s
54
false
true
0
10
18
54
25
29
null
null
kyagrd/micronax
src/Parser.hs
bsd-2-clause
tm2Term (S.Var nm) = Var (LIdent $ show nm)
43
tm2Term (S.Var nm) = Var (LIdent $ show nm)
43
tm2Term (S.Var nm) = Var (LIdent $ show nm)
43
false
false
0
8
8
30
14
16
null
null
zachsully/hakaru
haskell/Language/Hakaru/Syntax/Command.hs
bsd-3-clause
commandIsType Summarize x = x
29
commandIsType Summarize x = x
29
commandIsType Summarize x = x
29
false
false
1
5
4
16
5
11
null
null
amccausl/Swish
Swish/HaskellRDF/GraphTest.hs
lgpl-2.1
mgeq04 = testGraphEq "g104-g204" False g104 g204
48
mgeq04 = testGraphEq "g104-g204" False g104 g204
48
mgeq04 = testGraphEq "g104-g204" False g104 g204
48
false
false
0
5
6
15
7
8
null
null
Oregu/featherweight
src/MicroKanren.hs
mit
runMany ∷ Eq α ⇒ Int → Logic (LVar α) -> [LVar α] runMany n = take n . run
74
runMany ∷ Eq α ⇒ Int → Logic (LVar α) -> [LVar α] runMany n = take n . run
74
runMany n = take n . run
24
false
true
1
11
19
58
25
33
null
null
input-output-hk/cardano-sl
faucet/server/Main.hs
apache-2.0
options :: Parser (FilePath, EkgParams) options = (,) <$> configOption <*> ekgParamsOption
90
options :: Parser (FilePath, EkgParams) options = (,) <$> configOption <*> ekgParamsOption
90
options = (,) <$> configOption <*> ekgParamsOption
50
false
true
0
7
11
31
17
14
null
null
m00nlight/99-problems
haskell/p-82.hs
bsd-3-clause
cycles :: (Eq a) => a -> [(a, a)] -> [[a]] cycles source edges | edges == [] = [] | otherwise = [[source] ++ p | edge <- edges, (fst edge) == source, p <- (paths (snd edge) source [e | e <- edges, e /= edge]) ]
274
cycles :: (Eq a) => a -> [(a, a)] -> [[a]] cycles source edges | edges == [] = [] | otherwise = [[source] ++ p | edge <- edges, (fst edge) == source, p <- (paths (snd edge) source [e | e <- edges, e /= edge]) ]
274
cycles source edges | edges == [] = [] | otherwise = [[source] ++ p | edge <- edges, (fst edge) == source, p <- (paths (snd edge) source [e | e <- edges, e /= edge]) ]
231
false
true
0
14
112
154
78
76
null
null
drbean/pdrt-sandbox
src/Data/DRS/LambdaCalculus.hs
apache-2.0
renameRefs :: [DRSRef] -> [(DRSRef,DRSRef)] -> [DRSRef] renameRefs u rs = map (`renameVar` rs) u
96
renameRefs :: [DRSRef] -> [(DRSRef,DRSRef)] -> [DRSRef] renameRefs u rs = map (`renameVar` rs) u
96
renameRefs u rs = map (`renameVar` rs) u
40
false
true
0
8
14
50
29
21
null
null
shlevy/ghc
compiler/llvmGen/Llvm/Types.hs
bsd-3-clause
getVarType (LMNLocalVar _ y ) = y
40
getVarType (LMNLocalVar _ y ) = y
40
getVarType (LMNLocalVar _ y ) = y
40
false
false
0
7
13
17
8
9
null
null
mpickering/hackage-server
Distribution/Server/Pages/Index.hs
bsd-3-clause
unPackageName :: PackageName -> String unPackageName (PackageName name) = name
78
unPackageName :: PackageName -> String unPackageName (PackageName name) = name
78
unPackageName (PackageName name) = name
39
false
true
0
7
9
24
12
12
null
null
orchid-hybrid/absint-study
Ch1_Sign.hs
gpl-2.0
m Pos Num = Num
15
m Pos Num = Num
15
m Pos Num = Num
15
false
false
0
5
4
13
5
8
null
null
nh2/haskell-ordnub
listDifference.hs
mit
listDifference3 :: (Ord a) => [a] -> [a] -> [a] listDifference3 a b = go initHist a where initHist = Map.fromListWith (+) [ (x, 1 :: Int) | x <- b ] go _ [] = [] go hist (x:xs) = case Map.lookup x hist of Just n | n > 0 -> go (Map.insert x (n-1) hist) xs _ -> x : go hi...
346
listDifference3 :: (Ord a) => [a] -> [a] -> [a] listDifference3 a b = go initHist a where initHist = Map.fromListWith (+) [ (x, 1 :: Int) | x <- b ] go _ [] = [] go hist (x:xs) = case Map.lookup x hist of Just n | n > 0 -> go (Map.insert x (n-1) hist) xs _ -> x : go hi...
346
listDifference3 a b = go initHist a where initHist = Map.fromListWith (+) [ (x, 1 :: Int) | x <- b ] go _ [] = [] go hist (x:xs) = case Map.lookup x hist of Just n | n > 0 -> go (Map.insert x (n-1) hist) xs _ -> x : go hist xs
298
false
true
1
13
137
197
96
101
null
null
marangisto/karakul
src/Internal/Program.hs
bsd-3-clause
programmer (Just Uno) mcu hex = do port <- fmap (fromMaybe "COM3") $ liftIO $ findPort 0x2341 0x43 port <- fmap (fromMaybe port) $ getPort return ("avrdude", \_ -> [ "-c" ++ "arduino" , "-C" ++ avrdudeConf , "-p" ++ mcuStr mcu , "-P" ++ port , "-b" ++ "115200" ...
376
programmer (Just Uno) mcu hex = do port <- fmap (fromMaybe "COM3") $ liftIO $ findPort 0x2341 0x43 port <- fmap (fromMaybe port) $ getPort return ("avrdude", \_ -> [ "-c" ++ "arduino" , "-C" ++ avrdudeConf , "-p" ++ mcuStr mcu , "-P" ++ port , "-b" ++ "115200" ...
376
programmer (Just Uno) mcu hex = do port <- fmap (fromMaybe "COM3") $ liftIO $ findPort 0x2341 0x43 port <- fmap (fromMaybe port) $ getPort return ("avrdude", \_ -> [ "-c" ++ "arduino" , "-C" ++ avrdudeConf , "-p" ++ mcuStr mcu , "-P" ++ port , "-b" ++ "115200" ...
376
false
false
0
12
134
137
69
68
null
null
acharal/hopes
src/prover/Derive.hs
gpl-2.0
notExists vs es = Not $ exists vs $ foldAnd es
47
notExists vs es = Not $ exists vs $ foldAnd es
47
notExists vs es = Not $ exists vs $ foldAnd es
47
false
false
0
7
11
25
11
14
null
null
iu-parfunc/containers
Data/Set/Base.hs
bsd-3-clause
hedgeDiff :: Ord a => MaybeS a -> MaybeS a -> Set a -> Set a -> Set a hedgeDiff _ _ Tip _ = Tip
109
hedgeDiff :: Ord a => MaybeS a -> MaybeS a -> Set a -> Set a -> Set a hedgeDiff _ _ Tip _ = Tip
109
hedgeDiff _ _ Tip _ = Tip
39
false
true
0
11
39
63
27
36
null
null
jml/graphql-api
src/GraphQL/Internal/Syntax/Encoder.hs
bsd-3-clause
type_ (AST.TypeList x) = listType x
35
type_ (AST.TypeList x) = listType x
35
type_ (AST.TypeList x) = listType x
35
false
false
0
8
5
20
9
11
null
null
yiannist/ganeti
src/Ganeti/UDSServer.hs
bsd-2-clause
isRisky :: RecvResult -> Bool isRisky msg = case msg of RecvOk payload -> any (`isInfixOf` payload) privateParametersBlacklist _ -> False -- | Reads a request, passes it to a handler and sends a response back to the -- client.
231
isRisky :: RecvResult -> Bool isRisky msg = case msg of RecvOk payload -> any (`isInfixOf` payload) privateParametersBlacklist _ -> False -- | Reads a request, passes it to a handler and sends a response back to the -- client.
231
isRisky msg = case msg of RecvOk payload -> any (`isInfixOf` payload) privateParametersBlacklist _ -> False -- | Reads a request, passes it to a handler and sends a response back to the -- client.
201
false
true
0
9
44
50
27
23
null
null
ncdulo/xmonad
xmonad.hs
gpl-2.0
myWorkspaces = ["1:home","2:term","3:irc","4:dev","5:im", "6:media", "7:*", "8:*", "9:*"]
100
myWorkspaces = ["1:home","2:term","3:irc","4:dev","5:im", "6:media", "7:*", "8:*", "9:*"]
100
myWorkspaces = ["1:home","2:term","3:irc","4:dev","5:im", "6:media", "7:*", "8:*", "9:*"]
100
false
false
0
5
17
33
21
12
null
null
DanielSchiavini/ampersand
src/Database/Design/Ampersand/FSpec/ToFSpec/Calc.hs
gpl-3.0
commaNLPandoc' :: Inlines -> [Inlines] -> Inlines commaNLPandoc' s [a,b] = a <> space <> s <> space <> b
105
commaNLPandoc' :: Inlines -> [Inlines] -> Inlines commaNLPandoc' s [a,b] = a <> space <> s <> space <> b
105
commaNLPandoc' s [a,b] = a <> space <> s <> space <> b
55
false
true
0
8
20
49
26
23
null
null
facebook/Haxl
tests/OutgoneFetchesTests.hs
bsd-3-clause
tests :: Test tests = TestList [ outgoneFetchesTest "finished" 0 $ do -- test that a completed datasource fetch doesn't show up in Env _ <- sleep 1 -- finished _ <- sleep 1 -- cached/finished _ <- sleep 1 -- cached/finished wombats , outgoneFetchesTest "unfinished" 2 $ do -- t...
1,108
tests :: Test tests = TestList [ outgoneFetchesTest "finished" 0 $ do -- test that a completed datasource fetch doesn't show up in Env _ <- sleep 1 -- finished _ <- sleep 1 -- cached/finished _ <- sleep 1 -- cached/finished wombats , outgoneFetchesTest "unfinished" 2 $ do -- t...
1,108
tests = TestList [ outgoneFetchesTest "finished" 0 $ do -- test that a completed datasource fetch doesn't show up in Env _ <- sleep 1 -- finished _ <- sleep 1 -- cached/finished _ <- sleep 1 -- cached/finished wombats , outgoneFetchesTest "unfinished" 2 $ do -- test that unfin...
1,094
false
true
0
11
326
250
116
134
null
null
ocharles/opaleye-tf
test/Tests.hs
bsd-3-clause
leftJoinMonadic :: TestTree leftJoinMonadic = testCase "Monadic left join" $ let query :: Query s (Table (Expr s), Table (Compose (Expr s) 'Nullable)) query = do t1 <- queryTable t2 <- leftJoinTableOn (\t2 -> tableFoo t2 ==. tableFoo t1) return (t1, t2) in shouldTypecheck (\pg -> sele...
383
leftJoinMonadic :: TestTree leftJoinMonadic = testCase "Monadic left join" $ let query :: Query s (Table (Expr s), Table (Compose (Expr s) 'Nullable)) query = do t1 <- queryTable t2 <- leftJoinTableOn (\t2 -> tableFoo t2 ==. tableFoo t1) return (t1, t2) in shouldTypecheck (\pg -> sele...
383
leftJoinMonadic = testCase "Monadic left join" $ let query :: Query s (Table (Expr s), Table (Compose (Expr s) 'Nullable)) query = do t1 <- queryTable t2 <- leftJoinTableOn (\t2 -> tableFoo t2 ==. tableFoo t1) return (t1, t2) in shouldTypecheck (\pg -> select pg query :: IO [(Table In...
355
false
true
0
17
90
163
80
83
null
null
jff/TeLLer
src/CausalityGraphQueries.hs
gpl-3.0
--- Parser def = emptyDef{ commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~|&=<" , opLetter = oneOf "~|=&<>" , reservedOpNames = ["~","||", "&&", "==", "<=>", "=>", "<=", "link"...
382
def = emptyDef{ commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~|&=<" , opLetter = oneOf "~|=&<>" , reservedOpNames = ["~","||", "&&", "==", "<=>", "=>", "<=", "link", "exists"]...
371
def = emptyDef{ commentStart = "{-" , commentEnd = "-}" , identStart = letter , identLetter = alphaNum , opStart = oneOf "~|&=<" , opLetter = oneOf "~|=&<>" , reservedOpNames = ["~","||", "&&", "==", "<=>", "=>", "<=", "link", "exists"]...
371
true
false
0
7
157
92
58
34
null
null
eigengrau/hlint
data/Default.hs
bsd-3-clause
error "Evaluate" = scanr1 f [] ==> []
37
error "Evaluate" = scanr1 f [] ==> []
37
error "Evaluate" = scanr1 f [] ==> []
37
false
false
2
6
7
30
11
19
null
null
martomi/AI-Reversi
Reversi_AI.hs
mit
placeChip :: Coordinates -> State -> Tile -> State placeChip coord board chip = board // [(coord, chip)]
104
placeChip :: Coordinates -> State -> Tile -> State placeChip coord board chip = board // [(coord, chip)]
104
placeChip coord board chip = board // [(coord, chip)]
53
false
true
0
9
17
49
24
25
null
null
amoerie/labyrinth
Labyrinth/Parser.hs
mit
cards :: Parser Cards cards = many natural
42
cards :: Parser Cards cards = many natural
42
cards = many natural
20
false
true
0
6
7
23
9
14
null
null
ant1441/stack
src/Stack/Build/Source.hs
bsd-3-clause
getLocalPackageViews :: (MonadThrow m, MonadIO m, MonadReader env m, HasEnvConfig env) => m (Map PackageName (LocalPackageView, GenericPackageDescription)) getLocalPackageViews = do econfig <- asks getEnvConfig locals <- forM (Map.toList $ envConfigPackages econfig) $ \(dir, validWanted) ->...
1,359
getLocalPackageViews :: (MonadThrow m, MonadIO m, MonadReader env m, HasEnvConfig env) => m (Map PackageName (LocalPackageView, GenericPackageDescription)) getLocalPackageViews = do econfig <- asks getEnvConfig locals <- forM (Map.toList $ envConfigPackages econfig) $ \(dir, validWanted) ->...
1,359
getLocalPackageViews = do econfig <- asks getEnvConfig locals <- forM (Map.toList $ envConfigPackages econfig) $ \(dir, validWanted) -> do cabalfp <- getCabalFileName dir gpkg <- readPackageUnresolved cabalfp let cabalID = package $ packageDescription gpkg name = fromCabalPac...
1,182
false
true
0
18
413
367
183
184
null
null