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
haskell-distributed/distributed-process-demos
src/MapReduce/KMeans.hs
bsd-3-clause
localKMeans :: Array Int Point -> [Cluster] -> Int -> Map Cluster ([Point], Point) localKMeans points cs iterations = go (iterations - 1) where mr :: [Cluster] -> Map Cluster ([Point], Point) mr = localMapReduce (kmeans points) . trivialSegmentation go :: Int -> Map Cl...
540
localKMeans :: Array Int Point -> [Cluster] -> Int -> Map Cluster ([Point], Point) localKMeans points cs iterations = go (iterations - 1) where mr :: [Cluster] -> Map Cluster ([Point], Point) mr = localMapReduce (kmeans points) . trivialSegmentation go :: Int -> Map Cl...
540
localKMeans points cs iterations = go (iterations - 1) where mr :: [Cluster] -> Map Cluster ([Point], Point) mr = localMapReduce (kmeans points) . trivialSegmentation go :: Int -> Map Cluster ([Point], Point) go 0 = mr cs go n = mr . map snd . Map.elems . go $ n - 1 trivialSegmentation :: [C...
421
false
true
7
11
149
252
123
129
null
null
cmc-haskell-2016/checkers
src/GraphicsProcessing.hs
bsd-3-clause
eventHandler pool (EventKey (SpecialKey KeyEnter) Down _ _) (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 4 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
eventHandler pool (EventKey (SpecialKey KeyEnter) Down _ _) (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 4 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
eventHandler pool (EventKey (SpecialKey KeyEnter) Down _ _) (WorldObject players checkers (State 16 checkerChosen posToMoveChosen checkerIsChosen) alertMessage) = (WorldObject players checkers (State 4 checkerChosen posToMoveChosen checkerIsChosen) alertMessage)
264
false
false
0
9
28
79
39
40
null
null
bartavelle/manglingrules
Mangling.hs
gpl-3.0
hashcatrules :: Char -> Parser [Rule] hashcatrules c = case c of 'z' -> (return . H . DuplicateFirstN) <$> numeric 'Z' -> (return . H . DuplicateLastN) <$> numeric '+' -> (return . H . AsciiIncrement) <$> numeric 'k' -> return [H SwapFront] 'K' -> return [H SwapBack] '*' ...
475
hashcatrules :: Char -> Parser [Rule] hashcatrules c = case c of 'z' -> (return . H . DuplicateFirstN) <$> numeric 'Z' -> (return . H . DuplicateLastN) <$> numeric '+' -> (return . H . AsciiIncrement) <$> numeric 'k' -> return [H SwapFront] 'K' -> return [H SwapBack] '*' ...
475
hashcatrules c = case c of 'z' -> (return . H . DuplicateFirstN) <$> numeric 'Z' -> (return . H . DuplicateLastN) <$> numeric '+' -> (return . H . AsciiIncrement) <$> numeric 'k' -> return [H SwapFront] 'K' -> return [H SwapBack] '*' -> (return . H) <$> (Swap <$> numeric ...
437
false
true
0
11
140
186
93
93
null
null
elieux/ghc
libraries/base/Text/ParserCombinators/ReadPrec.hs
bsd-3-clause
prec :: Prec -> ReadPrec a -> ReadPrec a -- ^ @(prec n p)@ checks whether the precedence context is -- less than or equal to @n@, and -- -- * if not, fails -- -- * if so, parses @p@ in context @n@. prec n (P f) = P (\c -> if c <= n then f n else ReadP.pfail)
264
prec :: Prec -> ReadPrec a -> ReadPrec a prec n (P f) = P (\c -> if c <= n then f n else ReadP.pfail)
101
prec n (P f) = P (\c -> if c <= n then f n else ReadP.pfail)
60
true
true
0
9
66
70
38
32
null
null
elieux/ghc
compiler/utils/Outputable.hs
bsd-3-clause
speakNth :: Int -> SDoc speakNth 1 = ptext (sLit "first")
57
speakNth :: Int -> SDoc speakNth 1 = ptext (sLit "first")
57
speakNth 1 = ptext (sLit "first")
33
false
true
0
7
10
27
13
14
null
null
sol2man2/Learn-You-A-Haskell-For-Great-Good
src/Geometry.hs
mit
cuboidArea :: Float -> Float -> Float -> Float cuboidArea a b c = rectArea a b*c
80
cuboidArea :: Float -> Float -> Float -> Float cuboidArea a b c = rectArea a b*c
80
cuboidArea a b c = rectArea a b*c
33
false
true
0
7
16
39
19
20
null
null
chwthewke/horbits
src/horbits/Horbits/UI/ShowDim.hs
bsd-3-clause
showQuantitySci :: (RealFloat a, ShowDim d) => Quantity d a -> String showQuantitySci = translateExponent . showQuantityWith [s|%e%s|]
134
showQuantitySci :: (RealFloat a, ShowDim d) => Quantity d a -> String showQuantitySci = translateExponent . showQuantityWith [s|%e%s|]
134
showQuantitySci = translateExponent . showQuantityWith [s|%e%s|]
64
false
true
0
7
17
46
25
21
null
null
bitemyapp/ghc
compiler/main/DynFlags.hs
bsd-3-clause
opt_windres :: DynFlags -> [String] opt_windres dflags = sOpt_windres (settings dflags)
97
opt_windres :: DynFlags -> [String] opt_windres dflags = sOpt_windres (settings dflags)
97
opt_windres dflags = sOpt_windres (settings dflags)
51
false
true
0
8
20
35
16
19
null
null
noinia/hsync-client
src/HSync/Client/Foundation.hs
bsd-3-clause
runMain :: Action () -> IO () runMain act = do (hc,sc) <- getConfigs sd <- getStateDir sc withAcids (Just sd) $ \acids' -> withSync hc sc acids' act
169
runMain :: Action () -> IO () runMain act = do (hc,sc) <- getConfigs sd <- getStateDir sc withAcids (Just sd) $ \acids' -> withSync hc sc acids' act
169
runMain act = do (hc,sc) <- getConfigs sd <- getStateDir sc withAcids (Just sd) $ \acids' -> withSync hc sc acids' act
135
false
true
0
10
49
81
38
43
null
null
AlexeyRaga/eta
compiler/ETA/TypeCheck/TcGenDeriv.hs
bsd-3-clause
gtChar_RDR = varQual_RDR gHC_PRIM (fsLit "gtChar#")
56
gtChar_RDR = varQual_RDR gHC_PRIM (fsLit "gtChar#")
56
gtChar_RDR = varQual_RDR gHC_PRIM (fsLit "gtChar#")
56
false
false
0
7
10
17
8
9
null
null
PipocaQuemada/ermine
src/Ermine/Inference/Type.hs
bsd-2-clause
inferHardType (Term.Tuple n) = do vs <- replicateM (fromIntegral n) $ pure <$> newMeta star Nothing return $ Witness [] (foldr (~>) (tup vs) vs) $ dataCon (replicate (fromIntegral n) (_Convention # C)) 0 (tupleg n)
231
inferHardType (Term.Tuple n) = do vs <- replicateM (fromIntegral n) $ pure <$> newMeta star Nothing return $ Witness [] (foldr (~>) (tup vs) vs) $ dataCon (replicate (fromIntegral n) (_Convention # C)) 0 (tupleg n)
231
inferHardType (Term.Tuple n) = do vs <- replicateM (fromIntegral n) $ pure <$> newMeta star Nothing return $ Witness [] (foldr (~>) (tup vs) vs) $ dataCon (replicate (fromIntegral n) (_Convention # C)) 0 (tupleg n)
231
false
false
0
13
52
116
56
60
null
null
fmthoma/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
-- Classes Generic and Generic1, Datatype, Constructor and Selector genClassName, gen1ClassName, datatypeClassName, constructorClassName, selectorClassName :: Name genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
233
genClassName, gen1ClassName, datatypeClassName, constructorClassName, selectorClassName :: Name genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
165
genClassName = clsQual gHC_GENERICS (fsLit "Generic") genClassKey
67
true
true
2
7
26
37
21
16
null
null
0gajun/mal
haskell/Types.hs
mpl-2.0
_equal_Q (MalSymbol a) (MalSymbol b) = a == b
45
_equal_Q (MalSymbol a) (MalSymbol b) = a == b
45
_equal_Q (MalSymbol a) (MalSymbol b) = a == b
45
false
false
0
6
8
29
13
16
null
null
beni55/text
tests/Tests/Properties.hs
bsd-2-clause
showFloat TB.Generic = showGFloat
34
showFloat TB.Generic = showGFloat
34
showFloat TB.Generic = showGFloat
34
false
false
0
6
4
11
5
6
null
null
diku-dk/futhark
unittests/Language/Futhark/SyntaxTests.hs
isc
pUniqueness :: Parser Uniqueness pUniqueness = choice [lexeme "*" $> Unique, pure Nonunique]
92
pUniqueness :: Parser Uniqueness pUniqueness = choice [lexeme "*" $> Unique, pure Nonunique]
92
pUniqueness = choice [lexeme "*" $> Unique, pure Nonunique]
59
false
true
0
8
12
33
16
17
null
null
DanielSchuessler/hstri
Math/GaussElim/Tests.hs
gpl-3.0
idRatMat :: f (f' Rational) -> f (f' Rational) idRatMat = id
60
idRatMat :: f (f' Rational) -> f (f' Rational) idRatMat = id
60
idRatMat = id
13
false
true
0
8
11
33
16
17
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/enumFrom_6.hs
mit
enumFromOrdering :: Ordering -> (List Ordering) enumFromOrdering x = enumFromToOrdering x GT
94
enumFromOrdering :: Ordering -> (List Ordering) enumFromOrdering x = enumFromToOrdering x GT
94
enumFromOrdering x = enumFromToOrdering x GT
44
false
true
0
9
13
34
15
19
null
null
ozgurakgun/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
intTyName (ITFixed sized) = "B" ++ show (nativeTyWidth sized)
61
false
false
0
8
8
29
13
16
null
null
david-caro/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkUncheckedCd5 = verifyTree checkUncheckedCd "if true; then cd foo; fi"
79
prop_checkUncheckedCd5 = verifyTree checkUncheckedCd "if true; then cd foo; fi"
79
prop_checkUncheckedCd5 = verifyTree checkUncheckedCd "if true; then cd foo; fi"
79
false
false
0
5
9
11
5
6
null
null
ribag/ganeti-experiments
src/Ganeti/Query/Instance.hs
gpl-2.0
-- | Gets an optional fillable NIC field. getOptionalIndexedNicField :: (J.JSON a) => (FilledNicParams -> Maybe a) -> Int -> FieldGetter Instance Runtime getOptionalIndexedNicField = getIndexedFieldWithDefault (map nicNicparams . ins...
372
getOptionalIndexedNicField :: (J.JSON a) => (FilledNicParams -> Maybe a) -> Int -> FieldGetter Instance Runtime getOptionalIndexedNicField = getIndexedFieldWithDefault (map nicNicparams . instNics) (\x _ -> getDefaultNicParams x) fil...
330
getOptionalIndexedNicField = getIndexedFieldWithDefault (map nicNicparams . instNics) (\x _ -> getDefaultNicParams x) fillNicParams
137
true
true
0
10
122
83
40
43
null
null
siddhanathan/ghc
compiler/utils/Outputable.hs
bsd-3-clause
fsep ds = SDoc $ \sty -> Pretty.fsep [runSDoc d sty | d <- ds]
62
fsep ds = SDoc $ \sty -> Pretty.fsep [runSDoc d sty | d <- ds]
62
fsep ds = SDoc $ \sty -> Pretty.fsep [runSDoc d sty | d <- ds]
62
false
false
0
10
14
39
19
20
null
null
fmapfmapfmap/amazonka
amazonka-ec2/gen/Network/AWS/EC2/CreateInternetGateway.hs
mpl-2.0
-- | Information about the Internet gateway. cigrsInternetGateway :: Lens' CreateInternetGatewayResponse (Maybe InternetGateway) cigrsInternetGateway = lens _cigrsInternetGateway (\ s a -> s{_cigrsInternetGateway = a})
218
cigrsInternetGateway :: Lens' CreateInternetGatewayResponse (Maybe InternetGateway) cigrsInternetGateway = lens _cigrsInternetGateway (\ s a -> s{_cigrsInternetGateway = a})
173
cigrsInternetGateway = lens _cigrsInternetGateway (\ s a -> s{_cigrsInternetGateway = a})
89
true
true
0
9
23
46
25
21
null
null
hguenther/smtlib2
Language/SMTLib2/Internals/Expression.hs
gpl-3.0
renderValue SMTRendering (IntValue v) = if v>=0 then showsPrec 0 v else showString "(- " . showsPrec 0 (negate v) . showChar ')'
152
renderValue SMTRendering (IntValue v) = if v>=0 then showsPrec 0 v else showString "(- " . showsPrec 0 (negate v) . showChar ')'
152
renderValue SMTRendering (IntValue v) = if v>=0 then showsPrec 0 v else showString "(- " . showsPrec 0 (negate v) . showChar ')'
152
false
false
0
8
46
62
28
34
null
null
asztal/transact-sql
Language/TransactSql/Types.hs
bsd-3-clause
precision SmallMoney = Just 10
30
precision SmallMoney = Just 10
30
precision SmallMoney = Just 10
30
false
false
0
5
4
12
5
7
null
null
dgonyeo/brandskell
Handler/EditEntry.hs
mit
applyNicks :: [(Int,T.Text,Maybe T.Text)] -> [(Int,T.Text)] applyNicks [] = []
105
applyNicks :: [(Int,T.Text,Maybe T.Text)] -> [(Int,T.Text)] applyNicks [] = []
105
applyNicks [] = []
45
false
true
0
9
36
52
29
23
null
null
flowbox-public/imagemagick
Graphics/ImageMagick/MagickWand/MagickWand.hs
apache-2.0
getColorspace :: (MonadResource m) => PMagickWand -> m ColorspaceType getColorspace = liftIO . F.magickGetColorspace
116
getColorspace :: (MonadResource m) => PMagickWand -> m ColorspaceType getColorspace = liftIO . F.magickGetColorspace
116
getColorspace = liftIO . F.magickGetColorspace
46
false
true
0
7
13
33
17
16
null
null
krattai/noo-ebs
docs/zeroMQ-guide2/examples/Haskell/syncpub.hs
bsd-2-clause
getSubs :: Int -> Socket a -> IO () getSubs num sock | num >= subscribersExpected = return () | otherwise = do msg <- receive sock [] send sock (pack "") [] getSubs (num + 1) sock
267
getSubs :: Int -> Socket a -> IO () getSubs num sock | num >= subscribersExpected = return () | otherwise = do msg <- receive sock [] send sock (pack "") [] getSubs (num + 1) sock
259
getSubs num sock | num >= subscribersExpected = return () | otherwise = do msg <- receive sock [] send sock (pack "") [] getSubs (num + 1) sock
223
false
true
0
10
125
103
46
57
null
null
ComputationWithBoundedResources/tct-trs
tct-trs/Main.hs
bsd-3-clause
args = (degreeArg `optional` 1, degreeArg `optional` 3)
55
args = (degreeArg `optional` 1, degreeArg `optional` 3)
55
args = (degreeArg `optional` 1, degreeArg `optional` 3)
55
false
false
1
7
7
28
15
13
null
null
mainland/dph
dph-examples/examples/smoke/sharing/Indices/Main.hs
bsd-3-clause
un "vectorised" count countMax | count > countMax = return () | otherwise = do let arr = P.fromList [0 .. count - 1] arr `seq` return () (arrResult, tElapsed) <- time $ let arr' = ID.indicesPA arr arr in P.nf arr' `seq` return arr' -- ...
617
run "vectorised" count countMax | count > countMax = return () | otherwise = do let arr = P.fromList [0 .. count - 1] arr `seq` return () (arrResult, tElapsed) <- time $ let arr' = ID.indicesPA arr arr in P.nf arr' `seq` return arr' -- ...
617
run "vectorised" count countMax | count > countMax = return () | otherwise = do let arr = P.fromList [0 .. count - 1] arr `seq` return () (arrResult, tElapsed) <- time $ let arr' = ID.indicesPA arr arr in P.nf arr' `seq` return arr' -- ...
617
false
false
0
15
235
185
90
95
null
null
DougBurke/swish
tests/GraphPartitionTest.hs
lgpl-2.1
p12 = toPF "s2" [ (LF "p21",PartObj (LF "o21")) , (LF "p22",PartObj (LF "o22")) ]
113
p12 = toPF "s2" [ (LF "p21",PartObj (LF "o21")) , (LF "p22",PartObj (LF "o22")) ]
113
p12 = toPF "s2" [ (LF "p21",PartObj (LF "o21")) , (LF "p22",PartObj (LF "o22")) ]
113
false
false
1
10
46
56
27
29
null
null
amccausl/Swish
Swish/HaskellRDF/GraphTest.hs
lgpl-2.1
as22 = map (makeScopedArc 2) as2
32
as22 = map (makeScopedArc 2) as2
32
as22 = map (makeScopedArc 2) as2
32
false
false
0
7
5
17
8
9
null
null
mydaum/cabal
cabal-testsuite/PackageTests/Backpack/Includes1/setup.test.hs
bsd-3-clause
main = setupAndCabalTest $ do skipUnless =<< ghcVersionIs (>= mkVersion [8,1]) setup "configure" [] r <- fails $ setup' "build" [] assertRegex "error should be in B.hs" "^B.hs:" r assertRegex "error should be \"Could not find module Data.Set\"" "(Could not find module|Failed to load ...
343
main = setupAndCabalTest $ do skipUnless =<< ghcVersionIs (>= mkVersion [8,1]) setup "configure" [] r <- fails $ setup' "build" [] assertRegex "error should be in B.hs" "^B.hs:" r assertRegex "error should be \"Could not find module Data.Set\"" "(Could not find module|Failed to load ...
343
main = setupAndCabalTest $ do skipUnless =<< ghcVersionIs (>= mkVersion [8,1]) setup "configure" [] r <- fails $ setup' "build" [] assertRegex "error should be in B.hs" "^B.hs:" r assertRegex "error should be \"Could not find module Data.Set\"" "(Could not find module|Failed to load ...
343
false
false
0
12
81
81
37
44
null
null
expipiplus1/vulkan
generate-new/src/Documentation/RunAsciiDoctor.hs
bsd-3-clause
replaceTag :: TL.Text -- ^ Tag name -> Maybe TL.Text -- ^ Optional attribute to search for -> TL.Text -- ^ Replacement -> TL.Text -- ^ Haystack -> TL.Text replaceTag needle maybeAttr replacement = let attr = maybe "" (" " <>) maybeAttr in TL.replace ("<" <> needle <> attr <> ">") ("<" <> replacem...
405
replaceTag :: TL.Text -- ^ Tag name -> Maybe TL.Text -- ^ Optional attribute to search for -> TL.Text -- ^ Replacement -> TL.Text -- ^ Haystack -> TL.Text replaceTag needle maybeAttr replacement = let attr = maybe "" (" " <>) maybeAttr in TL.replace ("<" <> needle <> attr <> ">") ("<" <> replacem...
405
replaceTag needle maybeAttr replacement = let attr = maybe "" (" " <>) maybeAttr in TL.replace ("<" <> needle <> attr <> ">") ("<" <> replacement <> ">") . TL.replace ("</" <> needle <> ">") ("</" <> replacement <> ">")
232
false
true
0
12
99
144
73
71
null
null
joelburget/haste-compiler
libraries/haste-lib/src/Haste/DOM/JSString.hs
bsd-3-clause
-- | Perform an IO action on an element. withElem :: MonadIO m => ElemID -> (Elem -> m a) -> m a withElem e act = do me' <- elemById e case me' of Just e' -> act e' _ -> error $ "No element with ID " ++ fromJSStr e ++ " found!" -- | Perform an IO action over several elements. Throws an error if some ...
355
withElem :: MonadIO m => ElemID -> (Elem -> m a) -> m a withElem e act = do me' <- elemById e case me' of Just e' -> act e' _ -> error $ "No element with ID " ++ fromJSStr e ++ " found!" -- | Perform an IO action over several elements. Throws an error if some of the -- elements are not found.
314
withElem e act = do me' <- elemById e case me' of Just e' -> act e' _ -> error $ "No element with ID " ++ fromJSStr e ++ " found!" -- | Perform an IO action over several elements. Throws an error if some of the -- elements are not found.
258
true
true
0
13
96
103
47
56
null
null
hsyl20/HViperVM
lib/ViperVM/VirtualPlatform/MetaObject.hs
lgpl-3.0
detachInstance :: MetaObject -> Object -> STM () detachInstance mo o = do TSet.delete o (objects mo) -- | Exchange an object instance between two shared objects
164
detachInstance :: MetaObject -> Object -> STM () detachInstance mo o = do TSet.delete o (objects mo) -- | Exchange an object instance between two shared objects
164
detachInstance mo o = do TSet.delete o (objects mo) -- | Exchange an object instance between two shared objects
115
false
true
0
9
30
46
22
24
null
null
janschulz/pandoc
src/Text/Pandoc/Writers/Markdown.hs
gpl-2.0
linkAttributes :: WriterOptions -> Attr -> Doc linkAttributes opts attr = if isEnabled Ext_link_attributes opts && attr /= nullAttr then attrsToMarkdown attr else empty
180
linkAttributes :: WriterOptions -> Attr -> Doc linkAttributes opts attr = if isEnabled Ext_link_attributes opts && attr /= nullAttr then attrsToMarkdown attr else empty
180
linkAttributes opts attr = if isEnabled Ext_link_attributes opts && attr /= nullAttr then attrsToMarkdown attr else empty
133
false
true
0
8
35
53
25
28
null
null
Solumin/ScriptNScribe
src/BreveEval.hs
mit
evalBinOp ParOp a b = Vpar (check a) (check b) where check v = case v of (Vnote{}) -> v (Vrest _) -> v (Vseq _ _) -> v (Vpar _ _) -> v _ -> error $ ":=: is undefined for argument " ++ show v -- Here's why we defined Eq Val the way we did.
287
evalBinOp ParOp a b = Vpar (check a) (check b) where check v = case v of (Vnote{}) -> v (Vrest _) -> v (Vseq _ _) -> v (Vpar _ _) -> v _ -> error $ ":=: is undefined for argument " ++ show v -- Here's why we defined Eq Val the way we did.
287
evalBinOp ParOp a b = Vpar (check a) (check b) where check v = case v of (Vnote{}) -> v (Vrest _) -> v (Vseq _ _) -> v (Vpar _ _) -> v _ -> error $ ":=: is undefined for argument " ++ show v -- Here's why we defined Eq Val the way we did.
287
false
false
0
9
106
116
57
59
null
null
mtlstats/mtlstats
test/Actions/NewGameSpec.hs
gpl-3.0
updateGameStatsSpec :: Spec updateGameStatsSpec = describe "updateGameStats" $ do let baseStats = newGameStats & gmsWins .~ 1 & gmsLosses .~ 1 & gmsOvertime .~ 1 & gmsGoalsFor .~ 1 & gmsGoalsAgainst .~ 1 s t h a o = newProgState & progMode.gameStateL...
3,212
updateGameStatsSpec :: Spec updateGameStatsSpec = describe "updateGameStats" $ do let baseStats = newGameStats & gmsWins .~ 1 & gmsLosses .~ 1 & gmsOvertime .~ 1 & gmsGoalsFor .~ 1 & gmsGoalsAgainst .~ 1 s t h a o = newProgState & progMode.gameStateL...
3,212
updateGameStatsSpec = describe "updateGameStats" $ do let baseStats = newGameStats & gmsWins .~ 1 & gmsLosses .~ 1 & gmsOvertime .~ 1 & gmsGoalsFor .~ 1 & gmsGoalsAgainst .~ 1 s t h a o = newProgState & progMode.gameStateL %~ (gameType .~...
3,184
false
true
0
23
1,099
1,277
626
651
null
null
mcmaniac/ghc
distrib/compare/compare.hs
bsd-3-clause
findWays :: [TarLine] -> Maybe Ways findWays tls = msum $ map f tls where f tl = case re regex (tlFileName tl) of Just [dashedWays] -> Just (unSepList '-' dashedWays) _ -> Nothing regex = "/libraries/base/dist-install/build/\\.depend-(.*)\\.haskell"
313
findWays :: [TarLine] -> Maybe Ways findWays tls = msum $ map f tls where f tl = case re regex (tlFileName tl) of Just [dashedWays] -> Just (unSepList '-' dashedWays) _ -> Nothing regex = "/libraries/base/dist-install/build/\\.depend-(.*)\\.haskell"
313
findWays tls = msum $ map f tls where f tl = case re regex (tlFileName tl) of Just [dashedWays] -> Just (unSepList '-' dashedWays) _ -> Nothing regex = "/libraries/base/dist-install/build/\\.depend-(.*)\\.haskell"
277
false
true
0
12
100
92
45
47
null
null
jwiegley/ghc-release
libraries/Cabal/cabal/tests/PackageTests/PackageTester.hs
gpl-3.0
run :: Maybe FilePath -> String -> [String] -> IO (String, ExitCode, String) run cwd path args = do verbosity <- getVerbosity -- path is relative to the current directory; canonicalizePath makes it -- absolute, so that runProcess will find it even when changing directory. path' <- do pathExists <- doesF...
1,119
run :: Maybe FilePath -> String -> [String] -> IO (String, ExitCode, String) run cwd path args = do verbosity <- getVerbosity -- path is relative to the current directory; canonicalizePath makes it -- absolute, so that runProcess will find it even when changing directory. path' <- do pathExists <- doesF...
1,119
run cwd path args = do verbosity <- getVerbosity -- path is relative to the current directory; canonicalizePath makes it -- absolute, so that runProcess will find it even when changing directory. path' <- do pathExists <- doesFileExist path canonicalizePath (if pathExists then path else ...
1,042
false
true
1
13
311
313
147
166
null
null
mimi1vx/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkUncheckedCd6 = verifyNotTree checkUncheckedCd "cd .."
63
prop_checkUncheckedCd6 = verifyNotTree checkUncheckedCd "cd .."
63
prop_checkUncheckedCd6 = verifyNotTree checkUncheckedCd "cd .."
63
false
false
0
5
5
11
5
6
null
null
dalaing/sdl2
src/SDL/Raw/Event.hs
bsd-3-clause
eventState :: MonadIO m => Word32 -> CInt -> m Word8 eventState v1 v2 = liftIO $ eventStateFFI v1 v2
100
eventState :: MonadIO m => Word32 -> CInt -> m Word8 eventState v1 v2 = liftIO $ eventStateFFI v1 v2
100
eventState v1 v2 = liftIO $ eventStateFFI v1 v2
47
false
true
0
8
19
43
20
23
null
null
phaul/chess
Data/ChessTypes.hs
bsd-3-clause
charToPiece 'n' = Knight
24
charToPiece 'n' = Knight
24
charToPiece 'n' = Knight
24
false
false
1
5
3
13
4
9
null
null
AccelerateHS/accelerate-buildbot
src/Main.hs
bsd-3-clause
modified :: Config -> Build Bool modified cfg = maybe' (configHistory cfg) (return True) $ \hist -> do buildT <- io $ read `fmap` readFile hist patchT <- (timestamp . head) `fmap` changesN (Just $ configGitRepo cfg) 1 return (buildT /= patchT) -- Run the complete fetch/build/test cycle once --
310
modified :: Config -> Build Bool modified cfg = maybe' (configHistory cfg) (return True) $ \hist -> do buildT <- io $ read `fmap` readFile hist patchT <- (timestamp . head) `fmap` changesN (Just $ configGitRepo cfg) 1 return (buildT /= patchT) -- Run the complete fetch/build/test cycle once --
310
modified cfg = maybe' (configHistory cfg) (return True) $ \hist -> do buildT <- io $ read `fmap` readFile hist patchT <- (timestamp . head) `fmap` changesN (Just $ configGitRepo cfg) 1 return (buildT /= patchT) -- Run the complete fetch/build/test cycle once --
277
false
true
0
14
65
117
59
58
null
null
NorfairKing/the-notes
src/Cryptography/ComputationalProblems/Games/BitGuessingProblems/Macro.hs
gpl-2.0
stopsym :: Note -> Note stopsym = (stopsym_ !:)
47
stopsym :: Note -> Note stopsym = (stopsym_ !:)
47
stopsym = (stopsym_ !:)
23
false
true
0
7
8
26
12
14
null
null
brendanhay/gogol
gogol-redis/gen/Network/Google/Redis/Types/Product.hs
mpl-2.0
-- | Creates a value of 'InstanceLabels' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'ilAddtional' instanceLabels :: HashMap Text Text -- ^ 'ilAddtional' -> InstanceLabels instanceLabels pIlAddtional_ = InstanceLabels' {_...
358
instanceLabels :: HashMap Text Text -- ^ 'ilAddtional' -> InstanceLabels instanceLabels pIlAddtional_ = InstanceLabels' {_ilAddtional = _Coerce # pIlAddtional_}
170
instanceLabels pIlAddtional_ = InstanceLabels' {_ilAddtional = _Coerce # pIlAddtional_}
89
true
true
0
8
62
50
26
24
null
null
pgj/bead
src/Bead/Persistence/NoSQLDir.hs
bsd-3-clause
-- * Feedback feedbackDirPath :: FeedbackKey -> FilePath feedbackDirPath = feedbackKey $ \k -> joinPath [feedbackDataDir, k]
125
feedbackDirPath :: FeedbackKey -> FilePath feedbackDirPath = feedbackKey $ \k -> joinPath [feedbackDataDir, k]
110
feedbackDirPath = feedbackKey $ \k -> joinPath [feedbackDataDir, k]
67
true
true
0
8
17
34
19
15
null
null
lifengsun/haskell-exercise
scheme/06/replparser.hs
gpl-3.0
primitives :: [(String, [LispVal] -> ThrowsError LispVal)] primitives = [("+", numericBinOp (+)), ("-", numericBinOp (-)), ("*", numericBinOp (*)), ("/", numericBinOp div), ("mod", numericBinOp mod), ("quoti...
1,203
primitives :: [(String, [LispVal] -> ThrowsError LispVal)] primitives = [("+", numericBinOp (+)), ("-", numericBinOp (-)), ("*", numericBinOp (*)), ("/", numericBinOp div), ("mod", numericBinOp mod), ("quoti...
1,203
primitives = [("+", numericBinOp (+)), ("-", numericBinOp (-)), ("*", numericBinOp (*)), ("/", numericBinOp div), ("mod", numericBinOp mod), ("quotient", numericBinOp quot), ("remainder", num...
1,144
false
true
0
10
577
349
217
132
null
null
mzini/qlogic
Qlogic/Formula.hs
gpl-3.0
pprintFormula (Maj a b c) = parens $ text "maj" <+> (pprintFormula a $$ pprintFormula b $$ pprintFormula c)
107
pprintFormula (Maj a b c) = parens $ text "maj" <+> (pprintFormula a $$ pprintFormula b $$ pprintFormula c)
107
pprintFormula (Maj a b c) = parens $ text "maj" <+> (pprintFormula a $$ pprintFormula b $$ pprintFormula c)
107
false
false
0
9
18
50
23
27
null
null
HJvT/hdirect
src/Parser.hs
bsd-3-clause
action_593 (68#) = happyGoto action_143
39
action_593 (68#) = happyGoto action_143
39
action_593 (68#) = happyGoto action_143
39
false
false
0
6
4
15
7
8
null
null
scturtle/fun.hs
prolog.hs
unlicense
solveSome :: Subs -> Rules -> [Term] -> _ -> _ -> _ solveSome env rules [] yes no entryno = no
94
solveSome :: Subs -> Rules -> [Term] -> _ -> _ -> _ solveSome env rules [] yes no entryno = no
94
solveSome env rules [] yes no entryno = no
42
false
true
0
12
21
55
26
29
null
null
bredelings/BAli-Phy
haskell/Bio/Alphabet.hs
gpl-2.0
aaWithStop = builtin_aaWithStop ()
34
aaWithStop = builtin_aaWithStop ()
34
aaWithStop = builtin_aaWithStop ()
34
false
false
0
6
3
11
5
6
null
null
spockwangs/scheme.in.haskell
list6.4.hs
unlicense
badArgList = throwError $ NumArgs 2 badArgList
46
badArgList = throwError $ NumArgs 2 badArgList
46
badArgList = throwError $ NumArgs 2 badArgList
46
false
false
1
6
6
18
7
11
null
null
ion1/rrdgraph-haskell
Data/RRDGraph/Tests/Fields.hs
isc
prop_asks :: Integer -> Bool prop_asks a = runField (asks id) a == Just a
73
prop_asks :: Integer -> Bool prop_asks a = runField (asks id) a == Just a
73
prop_asks a = runField (asks id) a == Just a
44
false
true
0
8
14
42
18
24
null
null
narrative/stack
src/Stack/Package.hs
bsd-3-clause
resolveFileOrWarn :: (MonadCatch m,MonadIO m,MonadLogger m,MonadReader (Path Abs File, Path Abs Dir) m) => FilePath.FilePath -> m (Maybe (Path Abs File)) resolveFileOrWarn = resolveOrWarn "File" f where f p x = forgivingAbsence (resolveFile p x) >>= rejectMissingFile -- | Resolve ...
404
resolveFileOrWarn :: (MonadCatch m,MonadIO m,MonadLogger m,MonadReader (Path Abs File, Path Abs Dir) m) => FilePath.FilePath -> m (Maybe (Path Abs File)) resolveFileOrWarn = resolveOrWarn "File" f where f p x = forgivingAbsence (resolveFile p x) >>= rejectMissingFile -- | Resolve ...
404
resolveFileOrWarn = resolveOrWarn "File" f where f p x = forgivingAbsence (resolveFile p x) >>= rejectMissingFile -- | Resolve the directory, if it can't be resolved, warn for the user -- (purely to be helpful).
214
false
true
0
11
94
113
57
56
null
null
mcschroeder/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLabel :: Platform -> CLabel -> SDoc pprCLabel platform (AsmTempLabel u) | cGhcWithNativeCodeGen == "YES" = getPprStyle $ \ sty -> if asmStyle sty then ptext (asmTempLabelPrefix platform) <> pprUnique u else char '_' <> pprUnique u
265
pprCLabel :: Platform -> CLabel -> SDoc pprCLabel platform (AsmTempLabel u) | cGhcWithNativeCodeGen == "YES" = getPprStyle $ \ sty -> if asmStyle sty then ptext (asmTempLabelPrefix platform) <> pprUnique u else char '_' <> pprUnique u
264
pprCLabel platform (AsmTempLabel u) | cGhcWithNativeCodeGen == "YES" = getPprStyle $ \ sty -> if asmStyle sty then ptext (asmTempLabelPrefix platform) <> pprUnique u else char '_' <> pprUnique u
224
false
true
4
10
67
94
42
52
null
null
frantisekfarka/ghc-dsi
compiler/cmm/CmmCommonBlockElim.hs
bsd-3-clause
eqLastWith :: (BlockId -> BlockId -> Bool) -> CmmNode O C -> CmmNode O C -> Bool eqLastWith eqBid (CmmBranch bid1) (CmmBranch bid2) = eqBid bid1 bid2
149
eqLastWith :: (BlockId -> BlockId -> Bool) -> CmmNode O C -> CmmNode O C -> Bool eqLastWith eqBid (CmmBranch bid1) (CmmBranch bid2) = eqBid bid1 bid2
149
eqLastWith eqBid (CmmBranch bid1) (CmmBranch bid2) = eqBid bid1 bid2
68
false
true
0
11
26
73
34
39
null
null
gcampax/ghc
compiler/llvmGen/LlvmCodeGen/Data.hs
bsd-3-clause
genStaticLit cmm@(CmmLabel l) = do var <- getGlobalPtr =<< strCLabel_llvm l dflags <- getDynFlags let ptr = LMStaticPointer var lmty = cmmToLlvmType $ cmmLitType dflags cmm return $ LMPtoI ptr lmty
221
genStaticLit cmm@(CmmLabel l) = do var <- getGlobalPtr =<< strCLabel_llvm l dflags <- getDynFlags let ptr = LMStaticPointer var lmty = cmmToLlvmType $ cmmLitType dflags cmm return $ LMPtoI ptr lmty
221
genStaticLit cmm@(CmmLabel l) = do var <- getGlobalPtr =<< strCLabel_llvm l dflags <- getDynFlags let ptr = LMStaticPointer var lmty = cmmToLlvmType $ cmmLitType dflags cmm return $ LMPtoI ptr lmty
221
false
false
0
11
54
77
35
42
null
null
seL4/capDL-tool
CapDL/PrintUtils.hs
bsd-2-clause
maybeRightsList _ [] = []
25
maybeRightsList _ [] = []
25
maybeRightsList _ [] = []
25
false
false
0
6
4
15
7
8
null
null
osa1/language-lua
tests/Main.hs
bsd-3-clause
literalDecodingTests :: TestTree literalDecodingTests = testGroup "Literal codec tests" [ testCase "decoding" (do assertEqual "C escapes wrong" (Just "\a\b\f\n\r\t\v\\\"'") $ interpretStringLiteral "\"\\a\\b\\f\\n\\r\\t\\v\\\\\\\"'\"" assertEqual "C escapes wrong" ...
4,050
literalDecodingTests :: TestTree literalDecodingTests = testGroup "Literal codec tests" [ testCase "decoding" (do assertEqual "C escapes wrong" (Just "\a\b\f\n\r\t\v\\\"'") $ interpretStringLiteral "\"\\a\\b\\f\\n\\r\\t\\v\\\\\\\"'\"" assertEqual "C escapes wrong" ...
4,050
literalDecodingTests = testGroup "Literal codec tests" [ testCase "decoding" (do assertEqual "C escapes wrong" (Just "\a\b\f\n\r\t\v\\\"'") $ interpretStringLiteral "\"\\a\\b\\f\\n\\r\\t\\v\\\\\\\"'\"" assertEqual "C escapes wrong" (Just "\a \b \f \n \r \t \v \\...
4,017
false
true
0
15
1,214
413
181
232
null
null
magthe/dataenc
test-src/DataencUT.hs
bsd-3-clause
base64UrlTestData = [ ("base64url", "empty", "", [], base64Url) , ("base64url", "\0", "AA==", [0], base64Url) , ("base64url", "\255", "_w==", [255], base64Url) , ("base64url", "Example", "RXhhbXBsZQ==", [69,120,97,109,112,108,101], base64Url) ]
264
base64UrlTestData = [ ("base64url", "empty", "", [], base64Url) , ("base64url", "\0", "AA==", [0], base64Url) , ("base64url", "\255", "_w==", [255], base64Url) , ("base64url", "Example", "RXhhbXBsZQ==", [69,120,97,109,112,108,101], base64Url) ]
264
base64UrlTestData = [ ("base64url", "empty", "", [], base64Url) , ("base64url", "\0", "AA==", [0], base64Url) , ("base64url", "\255", "_w==", [255], base64Url) , ("base64url", "Example", "RXhhbXBsZQ==", [69,120,97,109,112,108,101], base64Url) ]
264
false
false
1
7
46
110
70
40
null
null
romanb/aws
Aws/Core.hs
bsd-3-clause
tellMetadataRef :: Monoid m => IORef m -> m -> IO () tellMetadataRef r m = modifyIORef r (`mappend` m)
102
tellMetadataRef :: Monoid m => IORef m -> m -> IO () tellMetadataRef r m = modifyIORef r (`mappend` m)
102
tellMetadataRef r m = modifyIORef r (`mappend` m)
49
false
true
0
9
19
50
25
25
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
mpl-2.0
-- | 'InstanceStatusEvent' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'iseCode' @::@ 'Maybe' 'EventCode' -- -- * 'iseDescription' @::@ 'Maybe' 'Text' -- -- * 'iseNotAfter' @::@ 'Maybe' 'UTCTime' -- -- * 'iseNotBefore' @::@ 'Maybe' 'UTCTime' -- instanceStatusEvent :: InstanceStatu...
502
instanceStatusEvent :: InstanceStatusEvent instanceStatusEvent = InstanceStatusEvent { _iseCode = Nothing , _iseDescription = Nothing , _iseNotBefore = Nothing , _iseNotAfter = Nothing }
218
instanceStatusEvent = InstanceStatusEvent { _iseCode = Nothing , _iseDescription = Nothing , _iseNotBefore = Nothing , _iseNotAfter = Nothing }
175
true
true
0
7
96
59
37
22
null
null
spockwangs/scheme.in.haskell
list6.2.hs
unlicense
parseCharacter :: Parser LispVal parseCharacter = do char '\\' c <- anyChar s <- many letter case map toLower (c:s) of [a] -> return $ Character a "space" -> return $ Character ' ' "newline" -> ...
448
parseCharacter :: Parser LispVal parseCharacter = do char '\\' c <- anyChar s <- many letter case map toLower (c:s) of [a] -> return $ Character a "space" -> return $ Character ' ' "newline" -> ...
448
parseCharacter = do char '\\' c <- anyChar s <- many letter case map toLower (c:s) of [a] -> return $ Character a "space" -> return $ Character ' ' "newline" -> return $ Character '\n' ...
415
false
true
0
13
201
119
56
63
null
null
rfranek/duckling
Duckling/Duration/HE/Rules.hs
bsd-3-clause
ruleExactlyDuration :: Rule ruleExactlyDuration = Rule { name = "exactly <duration>" , pattern = [ regex "\x05d1\x05d3\x05d9\x05d5\x05e7" , dimension Duration ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
268
ruleExactlyDuration :: Rule ruleExactlyDuration = Rule { name = "exactly <duration>" , pattern = [ regex "\x05d1\x05d3\x05d9\x05d5\x05e7" , dimension Duration ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
268
ruleExactlyDuration = Rule { name = "exactly <duration>" , pattern = [ regex "\x05d1\x05d3\x05d9\x05d5\x05e7" , dimension Duration ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
240
false
true
0
14
68
82
44
38
null
null
ruicc/haskell-protocol-buffers
Text/ProtocolBuffers/WireMessage.hs
apache-2.0
wireSizeOpt tagSize i (Just v) = wireSizeReq tagSize i v
56
wireSizeOpt tagSize i (Just v) = wireSizeReq tagSize i v
56
wireSizeOpt tagSize i (Just v) = wireSizeReq tagSize i v
56
false
false
0
6
9
29
12
17
null
null
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/Sql.hs
bsd-3-clause
sqlQueryGenerator :: PQ.PrimQueryFold Select sqlQueryGenerator = (unit, baseTable, product, aggregate, order, limit_, join, values, binary)
160
sqlQueryGenerator :: PQ.PrimQueryFold Select sqlQueryGenerator = (unit, baseTable, product, aggregate, order, limit_, join, values, binary)
160
sqlQueryGenerator = (unit, baseTable, product, aggregate, order, limit_, join, values, binary)
115
false
true
1
6
35
47
26
21
null
null
DougBurke/swish
src/Swish/RDF/ProofContext.hs
lgpl-2.1
-- | Ruleset for RDFS inference. rulesetRDFS :: RDFRuleset rulesetRDFS = makeRuleset scopeRDFS axiomsRDFS rulesRDFS
116
rulesetRDFS :: RDFRuleset rulesetRDFS = makeRuleset scopeRDFS axiomsRDFS rulesRDFS
82
rulesetRDFS = makeRuleset scopeRDFS axiomsRDFS rulesRDFS
56
true
true
0
5
15
19
10
9
null
null
mumuki/mulang
src/Language/Mulang/Transform/Normalizer.hs
gpl-3.0
normalize ops (Sequence es) = normalizeSequence ops . sortDeclarations ops . mapNormalize ops $ es
123
normalize ops (Sequence es) = normalizeSequence ops . sortDeclarations ops . mapNormalize ops $ es
123
normalize ops (Sequence es) = normalizeSequence ops . sortDeclarations ops . mapNormalize ops $ es
123
false
false
0
8
39
39
17
22
null
null
dagit/mattermost-api
src/Network/Mattermost/Types.hs
bsd-3-clause
runLogger _ _ _ = return ()
27
runLogger _ _ _ = return ()
27
runLogger _ _ _ = return ()
27
false
false
0
6
6
18
8
10
null
null
dlewissandy/lambda-blas
src/Numerical/BLAS/Single.hs
bsd-3-clause
scopy :: Int -> Vector Float -> Int -> Vector Float -> Int -> Vector Float scopy = copy
87
scopy :: Int -> Vector Float -> Int -> Vector Float -> Int -> Vector Float scopy = copy
87
scopy = copy
12
false
true
0
10
18
40
19
21
null
null
utsav2601/cmpe295A
tools/flounder/UMP_IPI.hs
mit
uparams = template_params { ump_payload = 28, -- bytes ump_drv = "ump_ipi", ump_binding_extra_fields = [ C.Param (C.Struct "ipi_notify") "ipi_notify", C.Param (C.TypeName "bool") "no_notify" ], ump_extra_includes = ["arch/x86/barrelfish/ipi_notify.h"], ump_extra_protos = ...
936
uparams = template_params { ump_payload = 28, -- bytes ump_drv = "ump_ipi", ump_binding_extra_fields = [ C.Param (C.Struct "ipi_notify") "ipi_notify", C.Param (C.TypeName "bool") "no_notify" ], ump_extra_includes = ["arch/x86/barrelfish/ipi_notify.h"], ump_extra_protos = ...
936
uparams = template_params { ump_payload = 28, -- bytes ump_drv = "ump_ipi", ump_binding_extra_fields = [ C.Param (C.Struct "ipi_notify") "ipi_notify", C.Param (C.TypeName "bool") "no_notify" ], ump_extra_includes = ["arch/x86/barrelfish/ipi_notify.h"], ump_extra_protos = ...
936
false
false
0
11
212
172
101
71
null
null
christiaanb/ghc
compiler/hsSyn/HsTypes.hs
bsd-3-clause
pprHsContext :: (OutputableBndr name) => HsContext name -> SDoc pprHsContext = maybe empty (<+> darrow) . pprHsContextMaybe
123
pprHsContext :: (OutputableBndr name) => HsContext name -> SDoc pprHsContext = maybe empty (<+> darrow) . pprHsContextMaybe
123
pprHsContext = maybe empty (<+> darrow) . pprHsContextMaybe
59
false
true
0
7
16
40
21
19
null
null
walck/cyclotomic
src/Data/Number/RealCyclotomic.hs
gpl-3.0
-- | Sine function with argument in degrees. sinDeg :: Rational -> RealCyclotomic sinDeg r = RealCyclotomic (Cyc.sinDeg r)
122
sinDeg :: Rational -> RealCyclotomic sinDeg r = RealCyclotomic (Cyc.sinDeg r)
77
sinDeg r = RealCyclotomic (Cyc.sinDeg r)
40
true
true
0
8
18
35
16
19
null
null
isomorphism/csound-expression
src/Csound/Control/Instr.hs
bsd-3-clause
-- | Mixes the scores and plays them in the loop. mixLoop :: (Sigs a) => Sco (Mix a) -> a mixLoop a = sched instr $ withDur dt $ repeatE unit $ metroE $ sig $ 1 / dt where dt = dur a instr _ = return $ mix a -- | Mixes the procedures and plays them in the loop.
287
mixLoop :: (Sigs a) => Sco (Mix a) -> a mixLoop a = sched instr $ withDur dt $ repeatE unit $ metroE $ sig $ 1 / dt where dt = dur a instr _ = return $ mix a -- | Mixes the procedures and plays them in the loop.
237
mixLoop a = sched instr $ withDur dt $ repeatE unit $ metroE $ sig $ 1 / dt where dt = dur a instr _ = return $ mix a -- | Mixes the procedures and plays them in the loop.
197
true
true
1
11
88
97
47
50
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/Linux/FileSystem/ReadWrite.hs
bsd-3-clause
-- | Read n bytes in a buffer handleReadBuffer :: MonadIO m => Handle -> Maybe Word64 -> Word64 -> FlowT ReadErrors' m Buffer handleReadBuffer hdl offset size = do b <- mallocBytes (fromIntegral size) sz <- handleRead hdl offset b (fromIntegral size) -- free the pointer on error `onFlowError_` f...
454
handleReadBuffer :: MonadIO m => Handle -> Maybe Word64 -> Word64 -> FlowT ReadErrors' m Buffer handleReadBuffer hdl offset size = do b <- mallocBytes (fromIntegral size) sz <- handleRead hdl offset b (fromIntegral size) -- free the pointer on error `onFlowError_` free b -- otherwise return t...
424
handleReadBuffer hdl offset size = do b <- mallocBytes (fromIntegral size) sz <- handleRead hdl offset b (fromIntegral size) -- free the pointer on error `onFlowError_` free b -- otherwise return the buffer bufferUnsafePackPtr (fromIntegral sz) (castPtr b) -- | Like read but uses several...
328
true
true
0
12
101
123
58
65
null
null
gumgl/project-euler
43/43.hs
mit
answer = sum (map (unDigits 10) pandigitalSSDs)
47
answer = sum (map (unDigits 10) pandigitalSSDs)
47
answer = sum (map (unDigits 10) pandigitalSSDs)
47
false
false
1
9
6
27
11
16
null
null
sgillespie/ghc
testsuite/tests/typecheck/should_fail/VtaFail.hs
bsd-3-clause
e = show @Int @Float (read "5")
31
e = show @Int @Float (read "5")
31
e = show @Int @Float (read "5")
31
false
false
1
7
6
26
11
15
null
null
hguenther/gtl
lib/Language/GTL/ErrorRefiner.hs
bsd-3-clause
valueToC _ (GTLIntVal x) = show x
33
valueToC _ (GTLIntVal x) = show x
33
valueToC _ (GTLIntVal x) = show x
33
false
false
1
6
6
23
9
14
null
null
flipstone/glados
src/Handler/Agreement.hs
mit
agreementNew :: App Response agreementNew = do view <- getForm "agreement" (agreementForm Nothing) ok $ toResponse $ agreementNewView view
142
agreementNew :: App Response agreementNew = do view <- getForm "agreement" (agreementForm Nothing) ok $ toResponse $ agreementNewView view
142
agreementNew = do view <- getForm "agreement" (agreementForm Nothing) ok $ toResponse $ agreementNewView view
113
false
true
0
11
22
52
22
30
null
null
snowleopard/alga
src/Algebra/Graph/AdjacencyMap.hs
mit
compose :: Ord a => AdjacencyMap a -> AdjacencyMap a -> AdjacencyMap a compose x y = fromAdjacencySets [ (t, ys) | v <- Set.toList vs, let ys = postSet v y, not (Set.null ys) , t <- Set.toList (postSet v tx) ] where tx = transpose x vs = vertexSet x `Set.union` vertexSet y -- | Compute the ...
1,447
compose :: Ord a => AdjacencyMap a -> AdjacencyMap a -> AdjacencyMap a compose x y = fromAdjacencySets [ (t, ys) | v <- Set.toList vs, let ys = postSet v y, not (Set.null ys) , t <- Set.toList (postSet v tx) ] where tx = transpose x vs = vertexSet x `Set.union` vertexSet y -- | Compute the ...
1,447
compose x y = fromAdjacencySets [ (t, ys) | v <- Set.toList vs, let ys = postSet v y, not (Set.null ys) , t <- Set.toList (postSet v tx) ] where tx = transpose x vs = vertexSet x `Set.union` vertexSet y -- | Compute the /Cartesian product/ of graphs. -- Complexity: /O((n + m) * log(n))/ tim...
1,376
false
true
0
10
424
171
95
76
null
null
eklavya/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reflectTTQuote unq (UType u) = reflCall "UType" [reflectUniverse u]
67
reflectTTQuote unq (UType u) = reflCall "UType" [reflectUniverse u]
67
reflectTTQuote unq (UType u) = reflCall "UType" [reflectUniverse u]
67
false
false
0
7
8
28
13
15
null
null
thomasdziedzic/hs-spotify
example/high-login.hs
mit
credentialsBlobUpdatedCb :: Session -> String -> IO () credentialsBlobUpdatedCb session log_data = do putStrLn "in credentials_blob_updated_cb callback"
154
credentialsBlobUpdatedCb :: Session -> String -> IO () credentialsBlobUpdatedCb session log_data = do putStrLn "in credentials_blob_updated_cb callback"
154
credentialsBlobUpdatedCb session log_data = do putStrLn "in credentials_blob_updated_cb callback"
99
false
true
0
8
18
40
17
23
null
null
CulpaBS/wbBach
src/Futhark/Representation/SOACS.hs
bsd-3-clause
removeFunDefLore :: (Attributes lore, Op lore ~ Op SOACS) => AST.FunDef lore -> FunDef removeFunDefLore = rephraseFunDef removeLore
131
removeFunDefLore :: (Attributes lore, Op lore ~ Op SOACS) => AST.FunDef lore -> FunDef removeFunDefLore = rephraseFunDef removeLore
131
removeFunDefLore = rephraseFunDef removeLore
44
false
true
0
8
17
46
22
24
null
null
richardTowers/verify-sample-local-matching-services
haskell/Controllers/MatchingController.hs
mit
checkCycle3 nextCheck request = nextCheck request
125
checkCycle3 nextCheck request = nextCheck request
125
checkCycle3 nextCheck request = nextCheck request
125
false
false
0
5
81
14
6
8
null
null
DanielWaterworth/Idris-dev
src/IRTS/CodegenLLVM.hs
bsd-3-clause
cgOp (LStrInt ity) [s] = do ns <- unbox FString s nx <- inst $ simpleCall "strtoll" [ns , ConstantOperand $ C.Null (PointerType (PointerType (IntegerType 8) (AddrSpace 0)) (AddrSpace 0)) , ConstantOperand $ C.Int 32 10 ] nx' <- case ity of (ITFixed IT64) -> return nx ...
410
cgOp (LStrInt ity) [s] = do ns <- unbox FString s nx <- inst $ simpleCall "strtoll" [ns , ConstantOperand $ C.Null (PointerType (PointerType (IntegerType 8) (AddrSpace 0)) (AddrSpace 0)) , ConstantOperand $ C.Int 32 10 ] nx' <- case ity of (ITFixed IT64) -> return nx ...
410
cgOp (LStrInt ity) [s] = do ns <- unbox FString s nx <- inst $ simpleCall "strtoll" [ns , ConstantOperand $ C.Null (PointerType (PointerType (IntegerType 8) (AddrSpace 0)) (AddrSpace 0)) , ConstantOperand $ C.Int 32 10 ] nx' <- case ity of (ITFixed IT64) -> return nx ...
410
false
false
0
18
123
188
90
98
null
null
rhofour/rlglue-haskell-codec
src/RL_Glue/Network.hs
apache-2.0
sendMessage :: Word32 -> Socket -> BS.ByteString -> IO BS.ByteString sendMessage selByte sock msg = do let packedMsg = runPut ( putWord32be selByte >> putWord32be (fromIntegral (4 + BS.length msg)) >> putWord32be (fromIntegral (BS.length msg)) >> putByteStri...
589
sendMessage :: Word32 -> Socket -> BS.ByteString -> IO BS.ByteString sendMessage selByte sock msg = do let packedMsg = runPut ( putWord32be selByte >> putWord32be (fromIntegral (4 + BS.length msg)) >> putWord32be (fromIntegral (BS.length msg)) >> putByteStri...
589
sendMessage selByte sock msg = do let packedMsg = runPut ( putWord32be selByte >> putWord32be (fromIntegral (4 + BS.length msg)) >> putWord32be (fromIntegral (BS.length msg)) >> putByteString msg) sendLazy sock packedMsg confirmState sock selByte ...
520
false
true
0
21
178
183
82
101
null
null
sdiehl/ghc
hadrian/src/Rules/Libffi.hs
bsd-3-clause
-- | Need the (locally built) libffi library. needLibffi :: Stage -> Action () needLibffi stage = do manifest <- dynLibManifest stage need [manifest] -- | Context for @libffi@.
185
needLibffi :: Stage -> Action () needLibffi stage = do manifest <- dynLibManifest stage need [manifest] -- | Context for @libffi@.
139
needLibffi stage = do manifest <- dynLibManifest stage need [manifest] -- | Context for @libffi@.
106
true
true
0
9
37
49
22
27
null
null
ddssff/lens
src/Control/Lens/TH.hs
bsd-3-clause
deNewtype d = d
15
deNewtype d = d
15
deNewtype d = d
15
false
false
0
5
3
9
4
5
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/playpen/interview/api-catalog/src/EntityTagCache.hs
unlicense
tstc = U.t "tstc" (cToList cache) ( [(0,[1,-1]), (1,[2,1]), (2,[]), (3,[0,-1])] , 3 , [("abc",2),("bar",-1),("foo",1),("xyz",0)] , [(-1,"bar"),(0,"xyz"),(1,"foo"),(2,"abc")] )
195
tstc = U.t "tstc" (cToList cache) ( [(0,[1,-1]), (1,[2,1]), (2,[]), (3,[0,-1])] , 3 , [("abc",2),("bar",-1),("foo",1),("xyz",0)] , [(-1,"bar"),(0,"xyz"),(1,"foo"),(2,"abc")] )
195
tstc = U.t "tstc" (cToList cache) ( [(0,[1,-1]), (1,[2,1]), (2,[]), (3,[0,-1])] , 3 , [("abc",2),("bar",-1),("foo",1),("xyz",0)] , [(-1,"bar"),(0,"xyz"),(1,"foo"),(2,"abc")] )
195
false
false
1
9
37
174
107
67
null
null
da-x/Algorithm-W-Step-By-Step
Lamdu/Expr/Pure.hs
gpl-3.0
recEmpty :: Monoid a => Val a recEmpty = Val mempty $ V.BLeaf V.LRecEmpty
73
recEmpty :: Monoid a => Val a recEmpty = Val mempty $ V.BLeaf V.LRecEmpty
73
recEmpty = Val mempty $ V.BLeaf V.LRecEmpty
43
false
true
0
7
13
35
16
19
null
null
eklinkhammer/neural-algorithms
src/RandomUtil/Random.hs
bsd-3-clause
randomBool :: RandomGen g => g -> Double -> (g, Bool) randomBool g percent = (g', bool) where (val,g') = random g bool = val < percent -- Creates an infinite list of booleans that have percent chance of being true
232
randomBool :: RandomGen g => g -> Double -> (g, Bool) randomBool g percent = (g', bool) where (val,g') = random g bool = val < percent -- Creates an infinite list of booleans that have percent chance of being true
232
randomBool g percent = (g', bool) where (val,g') = random g bool = val < percent -- Creates an infinite list of booleans that have percent chance of being true
178
false
true
3
10
59
81
39
42
null
null
olsner/ghc
compiler/nativeGen/PPC/Ppr.hs
bsd-3-clause
pprInstr (SL II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = -- As above for SR, but for left shifts. -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/10870 pprInstr (XOR reg1 reg2 (RIReg reg2))
220
pprInstr (SL II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = -- As above for SR, but for left shifts. -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/10870 pprInstr (XOR reg1 reg2 (RIReg reg2))
220
pprInstr (SL II32 reg1 reg2 (RIImm (ImmInt i))) | i < 0 || i > 31 = -- As above for SR, but for left shifts. -- Fixes ticket http://ghc.haskell.org/trac/ghc/ticket/10870 pprInstr (XOR reg1 reg2 (RIReg reg2))
220
false
false
0
11
48
72
35
37
null
null
sdiehl/ghc
compiler/utils/Util.hs
bsd-3-clause
dropList _ xs@[] = xs
22
dropList _ xs@[] = xs
22
dropList _ xs@[] = xs
22
false
false
0
7
5
16
8
8
null
null
IreneKnapp/direct-http
Haskell/Network/HTTP.hs
mit
headerType HttpIfUnmodifiedSince = RequestHeader
48
headerType HttpIfUnmodifiedSince = RequestHeader
48
headerType HttpIfUnmodifiedSince = RequestHeader
48
false
false
0
5
3
9
4
5
null
null
kandersen/Utrecht
src/Utrecht/Mastermind/Core.hs
mit
tODO :: a -> a tODO = id
24
tODO :: a -> a tODO = id
24
tODO = id
9
false
true
0
5
7
15
8
7
null
null
alosich/language-java
Language/Java/Parser.hs
bsd-3-clause
---------------------------------------------------------------------------- -- Variable declarations varDecls :: P [VarDecl] varDecls = seplist1 varDecl comma
160
varDecls :: P [VarDecl] varDecls = seplist1 varDecl comma
57
varDecls = seplist1 varDecl comma
33
true
true
0
6
13
24
13
11
null
null
ardumont/write-yourself-a-scheme-lab
Scheme/Primitive.hs
gpl-2.0
-- *Main> :main "(cdr '(2 1))" -- (1) -- *Main> :main "(cdr '(2 1 . 4))" -- (1 . 4) -- *Main> :main "(cdr '(2 1 . 4))" -- (1 . 4) -- *Main> :main "(cdr '(2))" -- () -- *Main> :main "(cdr '())" -- Invalid type: expected pair, found () cons :: [LispVal] -> ThrowsError LispVal cons [x, List []] = return $ List [x]
313
cons :: [LispVal] -> ThrowsError LispVal cons [x, List []] = return $ List [x]
78
cons [x, List []] = return $ List [x]
37
true
true
0
8
66
55
33
22
null
null
input-output-hk/rscoin-haskell
test/Test/RSCoin/Pure/Update.hs
gpl-3.0
execUpdateSafe :: (MonadThrow m, Exception e) => Update e s a -> s -> m s execUpdateSafe upd storage = snd <$> runUpdateSafe upd storage
136
execUpdateSafe :: (MonadThrow m, Exception e) => Update e s a -> s -> m s execUpdateSafe upd storage = snd <$> runUpdateSafe upd storage
136
execUpdateSafe upd storage = snd <$> runUpdateSafe upd storage
62
false
true
2
9
24
65
29
36
null
null
avh4/elm-format
elm-format-lib/src/Parse/Helpers.hs
bsd-3-clause
-- TODO: push the Multiline type further up in the AST and get rid of this multilineToBool :: Multiline -> Bool multilineToBool multine = case multine of SplitAll -> True JoinAll -> False
197
multilineToBool :: Multiline -> Bool multilineToBool multine = case multine of SplitAll -> True JoinAll -> False
122
multilineToBool multine = case multine of SplitAll -> True JoinAll -> False
85
true
true
0
7
42
35
18
17
null
null