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
dmp1ce/Haskell-Programming-Exercises
Chapter 26/Morra.hs
unlicense
humanBattle :: IO () humanBattle = do putStrLn "-- Morra (Human battle) --" initState <- execStateT morraHumanOnlySetup def endState <- execStateT morraLoop initState putStrLn "\nDumping game state:" print endState -- Game loop
241
humanBattle :: IO () humanBattle = do putStrLn "-- Morra (Human battle) --" initState <- execStateT morraHumanOnlySetup def endState <- execStateT morraLoop initState putStrLn "\nDumping game state:" print endState -- Game loop
241
humanBattle = do putStrLn "-- Morra (Human battle) --" initState <- execStateT morraHumanOnlySetup def endState <- execStateT morraLoop initState putStrLn "\nDumping game state:" print endState -- Game loop
220
false
true
0
9
45
65
26
39
null
null
timjs/idris-clean
Sources/IRTS/CodegenClean.hs
mit
cgPrim (LBitCast _ _) = cgFn "id"
33
cgPrim (LBitCast _ _) = cgFn "id"
33
cgPrim (LBitCast _ _) = cgFn "id"
33
false
false
0
7
6
20
9
11
null
null
AlexanderPankiv/ghc
utils/ghctags/Main.hs
bsd-3-clause
fileData :: FileName -> ModuleName -> RenamedSource -> IO FileData fileData filename modname (group, _imports, _lie, _doc) = do -- lie is related to type checking and so is irrelevant -- imports contains import declarations and no definitions -- doc and haddock seem haddock-related; let's hope to ignore the...
514
fileData :: FileName -> ModuleName -> RenamedSource -> IO FileData fileData filename modname (group, _imports, _lie, _doc) = do -- lie is related to type checking and so is irrelevant -- imports contains import declarations and no definitions -- doc and haddock seem haddock-related; let's hope to ignore the...
514
fileData filename modname (group, _imports, _lie, _doc) = do -- lie is related to type checking and so is irrelevant -- imports contains import declarations and no definitions -- doc and haddock seem haddock-related; let's hope to ignore them ls <- lines `fmap` readFile filename let line_map = M.fro...
447
false
true
0
12
102
119
60
59
null
null
jparyani/capnproto-boostpython
compiler/src/CxxGenerator.hs
bsd-2-clause
isDefaultZero (TextDesc _) = error "Can't call isDefaultZero on aggregate types."
81
isDefaultZero (TextDesc _) = error "Can't call isDefaultZero on aggregate types."
81
isDefaultZero (TextDesc _) = error "Can't call isDefaultZero on aggregate types."
81
false
false
0
6
10
19
8
11
null
null
thielema/wxhaskell
wxdirect/src/CompileClassInfo.hs
lgpl-2.1
cmpName s1 s2 = compare (map toLower (haskellTypeName s1)) (map toLower (haskellTypeName s2))
95
cmpName s1 s2 = compare (map toLower (haskellTypeName s1)) (map toLower (haskellTypeName s2))
95
cmpName s1 s2 = compare (map toLower (haskellTypeName s1)) (map toLower (haskellTypeName s2))
95
false
false
1
9
14
49
21
28
null
null
nickspinale/bencode
src/Data/Bencode.hs
mit
parseBString :: Parser B.ByteString parseBString = decimal <* char ':' >>= take
79
parseBString :: Parser B.ByteString parseBString = decimal <* char ':' >>= take
79
parseBString = decimal <* char ':' >>= take
43
false
true
0
7
11
27
13
14
null
null
seagate-ssg/options-schema
src/Options/Schema/Builder.hs
bsd-3-clause
------------- Option Modifiers ------------------ name :: Name -> Mod a name n = Mod $ \a -> a { oNames = n : oNames a }
121
name :: Name -> Mod a name n = Mod $ \a -> a { oNames = n : oNames a }
70
name n = Mod $ \a -> a { oNames = n : oNames a }
48
true
true
2
9
26
55
26
29
null
null
agomezl/tstp2agda
src/Utils/Version.hs
mit
oUpperFirst (x : xs) = toUpper x : xs
38
toUpperFirst (x : xs) = toUpper x : xs
38
toUpperFirst (x : xs) = toUpper x : xs
38
false
false
0
7
9
23
11
12
null
null
gwright83/Wheeler
src/Math/Symbolic/Wheeler/Canonicalize.hs
bsd-3-clause
-- 'simplifyProduct' implements the transformations given in Definition 3.37 -- of Cohen's "Computer Algebra and Symbolic Computation: Mathematical Methods", -- p. 98. simplifyProduct :: Expr -> Expr simplifyProduct (Product fs) = sp (filter (not . isPlaceholder) fs) where sp fs' | null fs' ...
898
simplifyProduct :: Expr -> Expr simplifyProduct (Product fs) = sp (filter (not . isPlaceholder) fs) where sp fs' | null fs' = Const 1 | elem Undefined fs' = Undefined | any isDivideByZero fs' = Undefined | elem (Const 0) fs' = Const 0...
729
simplifyProduct (Product fs) = sp (filter (not . isPlaceholder) fs) where sp fs' | null fs' = Const 1 | elem Undefined fs' = Undefined | any isDivideByZero fs' = Undefined | elem (Const 0) fs' = Const 0 | null (tail fs') ...
697
true
true
0
13
380
216
101
115
null
null
beni55/hs-monte-carlo
lib/Data/Summary/Double.hs
bsd-3-clause
-- | Update the summary with a data point. -- Running mean and variance computed as in Knuth, Vol 2, page 232, -- 3rd edition, see <http://www.johndcook.com/standard_deviation.html> for -- a description. insert :: Double -> Summary -> Summary insert x (S n m s l h) = let n' = n+1 delta = x - m m'...
490
insert :: Double -> Summary -> Summary insert x (S n m s l h) = let n' = n+1 delta = x - m m' = m + delta / fromIntegral n' s' = s + delta*(x - m') l' = if x < l then x else l h' = if x > h then x else h in S n' m' s' l' h'
286
insert x (S n m s l h) = let n' = n+1 delta = x - m m' = m + delta / fromIntegral n' s' = s + delta*(x - m') l' = if x < l then x else l h' = if x > h then x else h in S n' m' s' l' h'
247
true
true
0
11
160
147
79
68
null
null
brendanhay/gogol
gogol-vault/gen/Network/Google/Vault/Types/Product.hs
mpl-2.0
-- | Datatypes to search voCoveredData :: Lens' VoiceOptions [VoiceOptionsCoveredDataItem] voCoveredData = lens _voCoveredData (\ s a -> s{_voCoveredData = a}) . _Default . _Coerce
200
voCoveredData :: Lens' VoiceOptions [VoiceOptionsCoveredDataItem] voCoveredData = lens _voCoveredData (\ s a -> s{_voCoveredData = a}) . _Default . _Coerce
175
voCoveredData = lens _voCoveredData (\ s a -> s{_voCoveredData = a}) . _Default . _Coerce
109
true
true
0
11
44
53
28
25
null
null
elieux/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
58
c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
58
c1TyConName = tcQual gHC_GENERICS (fsLit "C1") c1TyConKey
58
false
false
0
7
7
19
9
10
null
null
maxsnew/TAPL
Untyped/Arithmetic/Implementation/Arithmetic.hs
bsd-3-clause
-- | nv in our Grammar isNumeric :: Term -> Bool isNumeric TZero = True
73
isNumeric :: Term -> Bool isNumeric TZero = True
50
isNumeric TZero = True
24
true
true
0
5
16
19
10
9
null
null
ssaavedra/liquidhaskell
benchmarks/containers-0.5.0.0/Data/Map/Base.hs
bsd-3-clause
intersection t1 t2 = hedgeInt NothingS NothingS NothingS NothingS t1 t2
71
intersection t1 t2 = hedgeInt NothingS NothingS NothingS NothingS t1 t2
71
intersection t1 t2 = hedgeInt NothingS NothingS NothingS NothingS t1 t2
71
false
false
1
5
10
30
11
19
null
null
bgamari/shaking-up-ghc
src/Hadrian/Utilities.hs
bsd-3-clause
a -/- b | last a == '/' = a ++ b | otherwise = a ++ '/' : b
78
a -/- b | last a == '/' = a ++ b | otherwise = a ++ '/' : b
78
a -/- b | last a == '/' = a ++ b | otherwise = a ++ '/' : b
78
false
false
0
9
38
46
20
26
null
null
hsyl20/ViperVM
haskus-system/src/lib/Haskus/System/PCI/MakeTable.hs
bsd-3-clause
makeTable :: String -> Q [Dec] makeTable str = case runParser parseLines "PCI vendor/device identifier table" str of Right e -> return e Left err -> fail (show err) -- | Parse PCI ids
202
makeTable :: String -> Q [Dec] makeTable str = case runParser parseLines "PCI vendor/device identifier table" str of Right e -> return e Left err -> fail (show err) -- | Parse PCI ids
202
makeTable str = case runParser parseLines "PCI vendor/device identifier table" str of Right e -> return e Left err -> fail (show err) -- | Parse PCI ids
171
false
true
0
10
52
70
32
38
null
null
tomtitchener/RealSimpleMusic
src/Music/RealSimpleMusic/ScoreToLilypond/Utils.hs
cc0-1.0
-- | Interpreting accents requires the emitting the list accent of symbols above. renderAccent :: Accent -> Builder renderAccent accent = stringEncoding $ accentKeys !! fromEnum accent
185
renderAccent :: Accent -> Builder renderAccent accent = stringEncoding $ accentKeys !! fromEnum accent
103
renderAccent accent = stringEncoding $ accentKeys !! fromEnum accent
69
true
true
0
6
27
30
15
15
null
null
leshchevds/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
pIAllocatorReqName :: Field pIAllocatorReqName = withDoc "IAllocator target name (new instance, node to evac, etc.)" . renameField "IAllocatorReqName" $ simpleField "name" [t| NonEmptyString |]
197
pIAllocatorReqName :: Field pIAllocatorReqName = withDoc "IAllocator target name (new instance, node to evac, etc.)" . renameField "IAllocatorReqName" $ simpleField "name" [t| NonEmptyString |]
197
pIAllocatorReqName = withDoc "IAllocator target name (new instance, node to evac, etc.)" . renameField "IAllocatorReqName" $ simpleField "name" [t| NonEmptyString |]
169
false
true
0
6
27
40
19
21
null
null
lkania/Haskitter
src/Site.hs
mit
postsWitUserIndexHandler :: ExceptT Error AppHandler [PostWithUser] postsWitUserIndexHandler = getPostsWithUser
112
postsWitUserIndexHandler :: ExceptT Error AppHandler [PostWithUser] postsWitUserIndexHandler = getPostsWithUser
111
postsWitUserIndexHandler = getPostsWithUser
43
false
true
1
6
9
25
11
14
null
null
oforero/sudoku
haskell/src/Sudoku/Types.hs
mit
expand :: Options -> [Options] expand (Options vs) = map builder vs where builder v = Options [v]
109
expand :: Options -> [Options] expand (Options vs) = map builder vs where builder v = Options [v]
109
expand (Options vs) = map builder vs where builder v = Options [v]
78
false
true
0
7
29
48
24
24
null
null
hiratara/lambdabot-hipchat-plugins
src/Lambdabot/Plugin/HipChat.hs
bsd-3-clause
sendHipMessageJSON :: Text -> ByteString sendHipMessageJSON m = encode . object $ [ ("message", String m), ("message_format", "text") ]
139
sendHipMessageJSON :: Text -> ByteString sendHipMessageJSON m = encode . object $ [ ("message", String m), ("message_format", "text") ]
139
sendHipMessageJSON m = encode . object $ [ ("message", String m), ("message_format", "text") ]
98
false
true
0
8
22
47
26
21
null
null
jystic/river
src/River/Core/Example.hs
bsd-3-clause
fromPath :: FilePath -> Program () Prim (Name Text) () fromPath path = unsafePerformIO $ do e <- runExceptT $ parseProgram path case e of Left xx -> error $ Mega.parseErrorPretty xx Right p -> return . (() <$) . coreOfProgram $ elaborateProgram p
284
fromPath :: FilePath -> Program () Prim (Name Text) () fromPath path = unsafePerformIO $ do e <- runExceptT $ parseProgram path case e of Left xx -> error $ Mega.parseErrorPretty xx Right p -> return . (() <$) . coreOfProgram $ elaborateProgram p
284
fromPath path = unsafePerformIO $ do e <- runExceptT $ parseProgram path case e of Left xx -> error $ Mega.parseErrorPretty xx Right p -> return . (() <$) . coreOfProgram $ elaborateProgram p
229
false
true
2
15
81
116
53
63
null
null
jaapterwoerds/algorithmx
src/Main.hs
bsd-3-clause
convert' :: [Int] -> [[Int]] -> [Int] -> [CellCoordinate] convert' [] [] _ = []
79
convert' :: [Int] -> [[Int]] -> [Int] -> [CellCoordinate] convert' [] [] _ = []
79
convert' [] [] _ = []
21
false
true
0
8
14
51
28
23
null
null
sglumac/HDevs
src/HDevs/Simulator.hs
bsd-3-clause
(***) :: Simulator input1 output1 -> Simulator input2 output2 -> Simulator (These input1 input2) (These output1 output2) (Simulator tL1 tN1 model1) *** (Simulator tL2 tN2 model2) = Simulator tL tN model where tL = max tL1 tL2 tN = min tN1 tN2 model = parallel model1 tL1 tN1 mod...
331
(***) :: Simulator input1 output1 -> Simulator input2 output2 -> Simulator (These input1 input2) (These output1 output2) (Simulator tL1 tN1 model1) *** (Simulator tL2 tN2 model2) = Simulator tL tN model where tL = max tL1 tL2 tN = min tN1 tN2 model = parallel model1 tL1 tN1 mode...
330
(Simulator tL1 tN1 model1) *** (Simulator tL2 tN2 model2) = Simulator tL tN model where tL = max tL1 tL2 tN = min tN1 tN2 model = parallel model1 tL1 tN1 model2 tL2 tN2
197
false
true
0
9
92
128
62
66
null
null
danplubell/hmp3-phoenix
src/Style.hs
gpl-3.0
reversebg = Reverse
21
reversebg = Reverse
21
reversebg = Reverse
21
false
false
0
4
4
6
3
3
null
null
snoyberg/ghc
compiler/cmm/CmmType.hs
bsd-3-clause
widthFromBytes 8 = W64
23
widthFromBytes 8 = W64
23
widthFromBytes 8 = W64
23
false
false
0
5
4
9
4
5
null
null
alexander-at-github/eta
compiler/ETA/Main/TidyPgm.hs
bsd-3-clause
dffvExpr (App e1 e2) = dffvExpr e1 >> dffvExpr e2
58
dffvExpr (App e1 e2) = dffvExpr e1 >> dffvExpr e2
58
dffvExpr (App e1 e2) = dffvExpr e1 >> dffvExpr e2
58
false
false
0
7
18
27
12
15
null
null
ancientlanguage/haskell-analysis
greek-morph/src/Grammar/Greek/Morph/Smyth/Nouns/Declension3.hs
mit
declension3StemSigmaNeuter = decl3 Neuter [ [nounParadigm| γένος γένους γένει γένος γένος γένει γενοῖν γένη γενῶν γένεσι γένη |] , [nounParadigm| γέρας γέρως γέραι γέρας γέρας γέρᾱ γερῷν γέρᾱ γερῶν γέρασι(ν) γέρᾱ |] ]
233
declension3StemSigmaNeuter = decl3 Neuter [ [nounParadigm| γένος γένους γένει γένος γένος γένει γενοῖν γένη γενῶν γένεσι γένη |] , [nounParadigm| γέρας γέρως γέραι γέρας γέρας γέρᾱ γερῷν γέρᾱ γερῶν γέρασι(ν) γέρᾱ |] ]
233
declension3StemSigmaNeuter = decl3 Neuter [ [nounParadigm| γένος γένους γένει γένος γένος γένει γενοῖν γένη γενῶν γένεσι γένη |] , [nounParadigm| γέρας γέρως γέραι γέρας γέρας γέρᾱ γερῷν γέρᾱ γερῶν γέρασι(ν) γέρᾱ |] ]
233
false
false
0
5
48
26
17
9
null
null
meteogrid/sigym4-geometry
src/Sigym4/Geometry/QuadTree/Internal/Algorithms.hs
bsd-3-clause
lookupByPoint :: VectorSpace v => QuadTree v srid a -> Point v srid -> P.Maybe a lookupByPoint qt p = case qtLocCode qt p of Just c -> let TNode{tNode=node} = qtTraverseToLevel qt minBound c in P.Just (leafData node) Nothing -> P.Nothing
272
lookupByPoint :: VectorSpace v => QuadTree v srid a -> Point v srid -> P.Maybe a lookupByPoint qt p = case qtLocCode qt p of Just c -> let TNode{tNode=node} = qtTraverseToLevel qt minBound c in P.Just (leafData node) Nothing -> P.Nothing
272
lookupByPoint qt p = case qtLocCode qt p of Just c -> let TNode{tNode=node} = qtTraverseToLevel qt minBound c in P.Just (leafData node) Nothing -> P.Nothing
187
false
true
0
14
76
116
53
63
null
null
metabrainz/musicbrainz-email
test/Tests.hs
gpl-3.0
-------------------------------------------------------------------------------- main :: IO () main = do testConfig <- Configurator.load [ Configurator.Required "test.cfg" ] `catchIOError` (\e -> if isDoesNotExistError e then error "test.cfg not found. Ple...
1,405
main :: IO () main = do testConfig <- Configurator.load [ Configurator.Required "test.cfg" ] `catchIOError` (\e -> if isDoesNotExistError e then error "test.cfg not found. Please add a test.cfg file, see test.cfg.example for more information." ...
1,324
main = do testConfig <- Configurator.load [ Configurator.Required "test.cfg" ] `catchIOError` (\e -> if isDoesNotExistError e then error "test.cfg not found. Please add a test.cfg file, see test.cfg.example for more information." ...
1,310
true
true
0
14
289
277
131
146
null
null
olorin/amazonka
amazonka-config/gen/Network/AWS/Config/ListDiscoveredResources.hs
mpl-2.0
-- | The IDs of only those resources that you want AWS Config to list in the -- response. If you do not specify this parameter, AWS Config lists all -- resources of the specified type that it has discovered. ldrResourceIds :: Lens' ListDiscoveredResources [Text] ldrResourceIds = lens _ldrResourceIds (\ s a -> s{_ldrRes...
355
ldrResourceIds :: Lens' ListDiscoveredResources [Text] ldrResourceIds = lens _ldrResourceIds (\ s a -> s{_ldrResourceIds = a}) . _Default . _Coerce
147
ldrResourceIds = lens _ldrResourceIds (\ s a -> s{_ldrResourceIds = a}) . _Default . _Coerce
92
true
true
0
11
59
53
30
23
null
null
suhailshergill/liboleg
Language/TEval/TInfTEnv.hs
bsd-3-clause
tvext :: TVE -> (TVarName,Typ) -> TVE tvext (TVE c s) (tv,t) = TVE c $ M.insert tv t s
86
tvext :: TVE -> (TVarName,Typ) -> TVE tvext (TVE c s) (tv,t) = TVE c $ M.insert tv t s
86
tvext (TVE c s) (tv,t) = TVE c $ M.insert tv t s
48
false
true
0
7
19
60
31
29
null
null
spechub/Hets
Comorphisms/CSMOF2CASL.hs
gpl-2.0
maxConstraint :: MultConstr -> Integer -> PredMap -> CASLFORMULA maxConstraint con int predM = let predTypes = MapSet.lookup (stringToId $ getRole con) predM -- Set PredType souVars = generateVars "x" 1 tarVars = generateVars "y" (int + 1) correctPredType = Set.fold (getCorrectPredType con) [] predTyp...
859
maxConstraint :: MultConstr -> Integer -> PredMap -> CASLFORMULA maxConstraint con int predM = let predTypes = MapSet.lookup (stringToId $ getRole con) predM -- Set PredType souVars = generateVars "x" 1 tarVars = generateVars "y" (int + 1) correctPredType = Set.fold (getCorrectPredType con) [] predTyp...
859
maxConstraint con int predM = let predTypes = MapSet.lookup (stringToId $ getRole con) predM -- Set PredType souVars = generateVars "x" 1 tarVars = generateVars "y" (int + 1) correctPredType = Set.fold (getCorrectPredType con) [] predTypes souVarDec = Var_decl souVars (head (predArgs (head correct...
794
false
true
0
16
245
245
123
122
null
null
Soostone/cassy
src/Database/Cassandra/Pack.hs
bsd-3-clause
-- | composite columns are a pain -- need to write 2 byte length, n byte body, 1 byte separator -- -- from pycassa: -- The composite format for each component is: -- <len> <value> <eoc> -- 2 bytes | ? bytes | 1 byte ------------------------------------------------------------------------------- putBytes :: ...
470
putBytes :: B.ByteString -> Put putBytes b = do putLen b putByteString b -------------------------------------------------------------------------------
162
putBytes b = do putLen b putByteString b -------------------------------------------------------------------------------
130
true
true
0
7
81
41
23
18
null
null
sopvop/snap-core
test/Snap/Core/Tests.hs
bsd-3-clause
goPath :: ByteString -> Snap a -> IO (Request,Response) goPath s m = do rq <- mkRequest s runSnap m dummy timeoutModifier rq where timeoutModifier !f = return $! f 0 `seq` () dummy = const $ return () ------------------------------------------------------------------------------
299
goPath :: ByteString -> Snap a -> IO (Request,Response) goPath s m = do rq <- mkRequest s runSnap m dummy timeoutModifier rq where timeoutModifier !f = return $! f 0 `seq` () dummy = const $ return () ------------------------------------------------------------------------------
299
goPath s m = do rq <- mkRequest s runSnap m dummy timeoutModifier rq where timeoutModifier !f = return $! f 0 `seq` () dummy = const $ return () ------------------------------------------------------------------------------
243
false
true
0
8
59
100
48
52
null
null
lukexi/ghc-7.8-arm64
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
bsd-3-clause
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = do (vval, stmts1, top1) <- exprToVar val (vidx, stmts2, top2) <- exprToVar idx ([vval'], stmts3) <- castVars [(vval, LMVector l ty)] (v1, s1) <- doExpr ty $ Extract vval' vidx return (v1, stmts1 `appOL` stmts2 `appOL` stmts3 `snocOL` s...
394
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = do (vval, stmts1, top1) <- exprToVar val (vidx, stmts2, top2) <- exprToVar idx ([vval'], stmts3) <- castVars [(vval, LMVector l ty)] (v1, s1) <- doExpr ty $ Extract vval' vidx return (v1, stmts1 `appOL` stmts2 `appOL` stmts3 `snocOL` s...
394
genMachOp_slow _ (MO_VF_Extract l w) [val, idx] = do (vval, stmts1, top1) <- exprToVar val (vidx, stmts2, top2) <- exprToVar idx ([vval'], stmts3) <- castVars [(vval, LMVector l ty)] (v1, s1) <- doExpr ty $ Extract vval' vidx return (v1, stmts1 `appOL` stmts2 `appOL` stmts3 `snocOL` s...
394
false
false
0
11
99
172
92
80
null
null
mtlstats/mtlstats
test/TypesSpec.hs
gpl-3.0
awayTeamSpec :: Spec awayTeamSpec = describe "awayTeam" $ do let gs gt = newGameState & gameType .~ gt & otherTeam .~ "foo" context "unknown game type" $ it "should return an empty string" $ awayTeam (gs Nothing) `shouldBe` "" context "home game" $ it "should return \"foo\"" $ ...
491
awayTeamSpec :: Spec awayTeamSpec = describe "awayTeam" $ do let gs gt = newGameState & gameType .~ gt & otherTeam .~ "foo" context "unknown game type" $ it "should return an empty string" $ awayTeam (gs Nothing) `shouldBe` "" context "home game" $ it "should return \"foo\"" $ ...
491
awayTeamSpec = describe "awayTeam" $ do let gs gt = newGameState & gameType .~ gt & otherTeam .~ "foo" context "unknown game type" $ it "should return an empty string" $ awayTeam (gs Nothing) `shouldBe` "" context "home game" $ it "should return \"foo\"" $ awayTeam (gs $ Jus...
470
false
true
0
14
131
167
77
90
null
null
facebookincubator/duckling
Duckling/AmountOfMoney/SV/Rules.hs
bsd-3-clause
ruleExactlyAmountofmoney :: Rule ruleExactlyAmountofmoney = Rule { name = "exactly <amount-of-money>" , pattern = [ regex "exakt|precis" , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
275
ruleExactlyAmountofmoney :: Rule ruleExactlyAmountofmoney = Rule { name = "exactly <amount-of-money>" , pattern = [ regex "exakt|precis" , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
275
ruleExactlyAmountofmoney = Rule { name = "exactly <amount-of-money>" , pattern = [ regex "exakt|precis" , Predicate isMoneyWithValue ] , prod = \tokens -> case tokens of (_:token:_) -> Just token _ -> Nothing }
242
false
true
0
14
68
82
44
38
null
null
csstaub/xmonad-contrib
XMonad/Hooks/ToggleHook.hs
bsd-3-clause
_get :: String -> ((Bool, Bool) -> a) -> X a _get n f = XS.gets $ f . (findWithDefault (False, False) n . hooks)
112
_get :: String -> ((Bool, Bool) -> a) -> X a _get n f = XS.gets $ f . (findWithDefault (False, False) n . hooks)
112
_get n f = XS.gets $ f . (findWithDefault (False, False) n . hooks)
67
false
true
3
10
24
75
37
38
null
null
dmort27/HsSPE
Data/Phonology/RuleParsers.hs
bsd-3-clause
testRuleV :: RuleState -> String -> [Bool] testRuleV st = map (testRule st) . expandRule
88
testRuleV :: RuleState -> String -> [Bool] testRuleV st = map (testRule st) . expandRule
88
testRuleV st = map (testRule st) . expandRule
45
false
true
0
9
14
44
20
24
null
null
kim/amazonka
amazonka-swf/gen/Network/AWS/SWF/Types.hs
mpl-2.0
-- | The Id of the 'DecisionTaskStarted' event recorded when this decision task was -- started. This information can be useful for diagnosing problems by tracing -- back the chain of events leading up to this event. dtceaStartedEventId :: Lens' DecisionTaskCompletedEventAttributes Integer dtceaStartedEventId = lens...
382
dtceaStartedEventId :: Lens' DecisionTaskCompletedEventAttributes Integer dtceaStartedEventId = lens _dtceaStartedEventId (\s a -> s { _dtceaStartedEventId = a })
166
dtceaStartedEventId = lens _dtceaStartedEventId (\s a -> s { _dtceaStartedEventId = a })
92
true
true
0
9
58
42
24
18
null
null
ethercrow/yi-config
modules/IdrisIDE.hs
gpl-2.0
loadCurrentFileY :: YiM () loadCurrentFileY = do IdrisProcess hIn hOut _ <- getEditorDyn currentFilename <- withCurrentBuffer (gets identString) void $ loadFile hIn hOut (T.unpack currentFilename)
208
loadCurrentFileY :: YiM () loadCurrentFileY = do IdrisProcess hIn hOut _ <- getEditorDyn currentFilename <- withCurrentBuffer (gets identString) void $ loadFile hIn hOut (T.unpack currentFilename)
208
loadCurrentFileY = do IdrisProcess hIn hOut _ <- getEditorDyn currentFilename <- withCurrentBuffer (gets identString) void $ loadFile hIn hOut (T.unpack currentFilename)
181
false
true
0
11
36
68
31
37
null
null
MortimerMcMire315/grasph
src/Grasph/Algorithm/MWST.hs
gpl-3.0
dist' [] _ _ = PositiveInfinity
31
dist' [] _ _ = PositiveInfinity
31
dist' [] _ _ = PositiveInfinity
31
false
false
0
6
5
15
7
8
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/GMPerc.hs
gpl-3.0
percN "bd" = 36
15
percN "bd" = 36
15
percN "bd" = 36
15
false
false
0
5
3
9
4
5
null
null
brendanhay/gogol
gogol-analytics/gen/Network/Google/Resource/Analytics/Management/Experiments/Get.hs
mpl-2.0
-- | Account ID to retrieve the experiment for. megAccountId :: Lens' ManagementExperimentsGet Text megAccountId = lens _megAccountId (\ s a -> s{_megAccountId = a})
167
megAccountId :: Lens' ManagementExperimentsGet Text megAccountId = lens _megAccountId (\ s a -> s{_megAccountId = a})
119
megAccountId = lens _megAccountId (\ s a -> s{_megAccountId = a})
67
true
true
0
9
26
42
22
20
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_PROPS_DEFAULT :: Int wxSTC_PROPS_DEFAULT = 0
50
wxSTC_PROPS_DEFAULT :: Int wxSTC_PROPS_DEFAULT = 0
50
wxSTC_PROPS_DEFAULT = 0
23
false
true
0
4
5
11
6
5
null
null
codeq/language-go
src/Language/Go/LexerUtils.hs
mit
alexGetByte (_, _, [], []) = Nothing
46
alexGetByte (_, _, [], []) = Nothing
46
alexGetByte (_, _, [], []) = Nothing
46
false
false
0
7
16
25
14
11
null
null
denibertovic/haskell
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
bsd-3-clause
-- | 'v1beta1LocalSubjectAccessReviewKind' Lens v1beta1LocalSubjectAccessReviewKindL :: Lens_' V1beta1LocalSubjectAccessReview (Maybe Text) v1beta1LocalSubjectAccessReviewKindL f V1beta1LocalSubjectAccessReview{..} = (\v1beta1LocalSubjectAccessReviewKind -> V1beta1LocalSubjectAccessReview { v1beta1LocalSubjectAccessRev...
376
v1beta1LocalSubjectAccessReviewKindL :: Lens_' V1beta1LocalSubjectAccessReview (Maybe Text) v1beta1LocalSubjectAccessReviewKindL f V1beta1LocalSubjectAccessReview{..} = (\v1beta1LocalSubjectAccessReviewKind -> V1beta1LocalSubjectAccessReview { v1beta1LocalSubjectAccessReviewKind, ..} ) <$> f v1beta1LocalSubjectAccessRe...
328
v1beta1LocalSubjectAccessReviewKindL f V1beta1LocalSubjectAccessReview{..} = (\v1beta1LocalSubjectAccessReviewKind -> V1beta1LocalSubjectAccessReview { v1beta1LocalSubjectAccessReviewKind, ..} ) <$> f v1beta1LocalSubjectAccessReviewKind
236
true
true
0
8
23
57
30
27
null
null
bixuanzju/fcore
lib/Inheritance.hs
bsd-2-clause
mix :: Mixin s R1 R2 mix this super = R2 (super {func = \n -> trace "Hello!" $ func super n}) (\n -> 1 + func super n)
119
mix :: Mixin s R1 R2 mix this super = R2 (super {func = \n -> trace "Hello!" $ func super n}) (\n -> 1 + func super n)
119
mix this super = R2 (super {func = \n -> trace "Hello!" $ func super n}) (\n -> 1 + func super n)
98
false
true
1
11
29
77
37
40
null
null
GaloisInc/halvm-ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
tySynInstD :: Name -> TySynEqnQ -> DecQ tySynInstD tc eqn = do eqn1 <- eqn return (TySynInstD tc eqn1)
112
tySynInstD :: Name -> TySynEqnQ -> DecQ tySynInstD tc eqn = do eqn1 <- eqn return (TySynInstD tc eqn1)
112
tySynInstD tc eqn = do eqn1 <- eqn return (TySynInstD tc eqn1)
72
false
true
0
9
28
45
21
24
null
null
Velro/PolarisCover
src/ParticleDemo.hs
gpl-2.0
updateParticleSystem :: ParticleSystem -> CFloat -> ParticleSystem updateParticleSystem (ParticleSystem oldParticles) deltaTime = ParticleSystem newParticleArray where newParticleArray = [updateParticle (oldParticles !! i) deltaTime | i <- [0..(length oldParticles -1)] ] --filter for particles that should be killed
320
updateParticleSystem :: ParticleSystem -> CFloat -> ParticleSystem updateParticleSystem (ParticleSystem oldParticles) deltaTime = ParticleSystem newParticleArray where newParticleArray = [updateParticle (oldParticles !! i) deltaTime | i <- [0..(length oldParticles -1)] ] --filter for particles that should be killed
320
updateParticleSystem (ParticleSystem oldParticles) deltaTime = ParticleSystem newParticleArray where newParticleArray = [updateParticle (oldParticles !! i) deltaTime | i <- [0..(length oldParticles -1)] ] --filter for particles that should be killed
253
false
true
1
12
39
89
42
47
null
null
vTurbine/ghc
utils/ghc-cabal/Main.hs
bsd-3-clause
doCheck :: FilePath -> IO () doCheck directory = withCurrentDirectory directory $ do let verbosity = normal gpdFile <- defaultPackageDesc verbosity gpd <- readPackageDescription verbosity gpdFile case filter isFailure $ checkPackage gpd Nothing of [] -> return () errs -> mapM_ ...
501
doCheck :: FilePath -> IO () doCheck directory = withCurrentDirectory directory $ do let verbosity = normal gpdFile <- defaultPackageDesc verbosity gpd <- readPackageDescription verbosity gpdFile case filter isFailure $ checkPackage gpd Nothing of [] -> return () errs -> mapM_ ...
501
doCheck directory = withCurrentDirectory directory $ do let verbosity = normal gpdFile <- defaultPackageDesc verbosity gpd <- readPackageDescription verbosity gpdFile case filter isFailure $ checkPackage gpd Nothing of [] -> return () errs -> mapM_ print errs >> exitWith (ExitF...
472
false
true
2
13
127
167
74
93
null
null
acowley/ghc
compiler/prelude/THNames.hs
bsd-3-clause
-- data RuleBndr = ... ruleVarName, typedRuleVarName :: Name ruleVarName = libFun (fsLit ("ruleVar")) ruleVarIdKey
124
ruleVarName, typedRuleVarName :: Name ruleVarName = libFun (fsLit ("ruleVar")) ruleVarIdKey
101
ruleVarName = libFun (fsLit ("ruleVar")) ruleVarIdKey
63
true
true
0
8
24
28
16
12
null
null
limaner2002/EPC-tools
USACScripts/src/Scripts/SPINChangeIntake.hs
bsd-3-clause
spinChangeIntake :: (RapidFire m, MonadGen m) => SpinChangeConfig -> AppianT m (Maybe Text) spinChangeIntake conf = do v <- myLandingPageAction "SPIN Change" spinChangeIntake' conf v
187
spinChangeIntake :: (RapidFire m, MonadGen m) => SpinChangeConfig -> AppianT m (Maybe Text) spinChangeIntake conf = do v <- myLandingPageAction "SPIN Change" spinChangeIntake' conf v
187
spinChangeIntake conf = do v <- myLandingPageAction "SPIN Change" spinChangeIntake' conf v
95
false
true
0
10
29
67
30
37
null
null
blippy/sifi
src/Post.hs
gpl-3.0
postingsFromNtrans ntrans = concatMap postingsFromNtran ntrans
63
postingsFromNtrans ntrans = concatMap postingsFromNtran ntrans
63
postingsFromNtrans ntrans = concatMap postingsFromNtran ntrans
63
false
false
0
5
6
14
6
8
null
null
alexisVallet/hnn
src/HNN/NN/Mutable.hs
bsd-3-clause
withDescriptor :: (Storable desc) => String -> (Ptr desc -> IO CuDNN.Status) -- creation fct -> (desc -> IO CuDNN.Status) -- set fct -> (desc -> IO CuDNN.Status) -- destroy fct -> (desc -> IO a) -- action to perform -> IO a withDe...
671
withDescriptor :: (Storable desc) => String -> (Ptr desc -> IO CuDNN.Status) -- creation fct -> (desc -> IO CuDNN.Status) -- set fct -> (desc -> IO CuDNN.Status) -- destroy fct -> (desc -> IO a) -- action to perform -> IO a withDe...
671
withDescriptor name create set destroy action = do desc <- alloca $ \descptr -> do handleError ("Couldn't create " ++ name ++ " descriptor.") $ create descptr peek descptr handleError ("Couldn't set " ++ name ++ " descriptor.") $ set desc x <- action desc handleError ("Couldn't destroy " ++ name ++ " de...
357
false
true
0
17
209
222
105
117
null
null
robeverest/accelerate
Data/Array/Accelerate/Trafo/Simplify.hs
bsd-3-clause
-- Simplify array conditionals by attempting to prune branches. -- simplifyAcond :: Arrays a => Delta aenv aenv -> Exp aenv Bool -> OpenAcc aenv a -- then branch -> OpenAcc aenv a -- else branch -> PreOpenAcc OpenAcc aenv a simplifyAcond _aenv p t@(OpenAcc tacc) e@(OpenAcc ea...
518
simplifyAcond :: Arrays a => Delta aenv aenv -> Exp aenv Bool -> OpenAcc aenv a -- then branch -> OpenAcc aenv a -- else branch -> PreOpenAcc OpenAcc aenv a simplifyAcond _aenv p t@(OpenAcc tacc) e@(OpenAcc eacc) | Const ((), True) <- p = tacc | Const ((), F...
451
simplifyAcond _aenv p t@(OpenAcc tacc) e@(OpenAcc eacc) | Const ((), True) <- p = tacc | Const ((), False) <- p = eacc | Just REFL <- matchOpenAcc t e = tacc | otherwise = Acond p t e
250
true
true
14
7
190
165
85
80
null
null
brendanhay/amqp-bark
bark/src/Main.hs
bsd-3-clause
conduitParser :: (MonadResource m, MonadIO m) => Options -> Unbounded B.ByteString -> Overflow Event -> m () conduitParser Options{..} input output = sourceBuffer input $= tee (conduitEvent optDelim optStrip) $$ sinkBuffer output where tee | optTee = ...
362
conduitParser :: (MonadResource m, MonadIO m) => Options -> Unbounded B.ByteString -> Overflow Event -> m () conduitParser Options{..} input output = sourceBuffer input $= tee (conduitEvent optDelim optStrip) $$ sinkBuffer output where tee | optTee = ...
362
conduitParser Options{..} input output = sourceBuffer input $= tee (conduitEvent optDelim optStrip) $$ sinkBuffer output where tee | optTee = (=$= conduitShow) | otherwise = id
197
false
true
0
10
119
116
55
61
null
null
fmapfmapfmap/amazonka
amazonka-redshift/gen/Network/AWS/Redshift/ResetClusterParameterGroup.hs
mpl-2.0
-- | An array of names of parameters to be reset. If /ResetAllParameters/ -- option is not used, then at least one parameter name must be supplied. -- -- Constraints: A maximum of 20 parameters can be reset in a single -- request. rcpgParameters :: Lens' ResetClusterParameterGroup [Parameter] rcpgParameters = lens _rcp...
386
rcpgParameters :: Lens' ResetClusterParameterGroup [Parameter] rcpgParameters = lens _rcpgParameters (\ s a -> s{_rcpgParameters = a}) . _Default . _Coerce
155
rcpgParameters = lens _rcpgParameters (\ s a -> s{_rcpgParameters = a}) . _Default . _Coerce
92
true
true
0
11
62
55
32
23
null
null
briansteffens/basm
src/Elf.hs
gpl-2.0
renderContents sections (RelaContents rel) = renderRelocations sections (relocations rel)
93
renderContents sections (RelaContents rel) = renderRelocations sections (relocations rel)
93
renderContents sections (RelaContents rel) = renderRelocations sections (relocations rel)
93
false
false
0
7
12
28
13
15
null
null
amtal/soyuz
DCPU16/Instructions.hs
mit
fromOpCode IFE=0xc
18
fromOpCode IFE=0xc
18
fromOpCode IFE=0xc
18
false
false
0
5
1
9
4
5
null
null
ekmett/ghclive
prototypes/sharededitor/WsTest.hs
bsd-3-clause
emptyDoc = SM.singleton (AtomId (Timestamp 0) (ClientId 0)) (TextAtom ' ' (Just (Timestamp 0)))
95
emptyDoc = SM.singleton (AtomId (Timestamp 0) (ClientId 0)) (TextAtom ' ' (Just (Timestamp 0)))
95
emptyDoc = SM.singleton (AtomId (Timestamp 0) (ClientId 0)) (TextAtom ' ' (Just (Timestamp 0)))
95
false
false
0
11
13
53
26
27
null
null
ndmitchell/cmdargs
Data/Generics/Any/Prelude.hs
bsd-3-clause
isMaybe x = typeShell x == "Maybe"
34
isMaybe x = typeShell x == "Maybe"
34
isMaybe x = typeShell x == "Maybe"
34
false
false
2
5
6
23
8
15
null
null
chrisbanks/cpiwb
profileMC4.hs
gpl-3.0
f26 = Nec (0,infty) f18
23
f26 = Nec (0,infty) f18
23
f26 = Nec (0,infty) f18
23
false
false
1
6
4
20
9
11
null
null
andorp/air
src/Air/Domain.hs
bsd-3-clause
-- Produces a readable string from the given amount of money readableMoney = moneyCata (show . toFloat) where toFloat :: Rational -> Float toFloat = fromRational -- | Balance is money -- Interpretation: Every user has an active balance, -- which holds the user's money
273
readableMoney = moneyCata (show . toFloat) where toFloat :: Rational -> Float toFloat = fromRational -- | Balance is money -- Interpretation: Every user has an active balance, -- which holds the user's money
212
readableMoney = moneyCata (show . toFloat) where toFloat :: Rational -> Float toFloat = fromRational -- | Balance is money -- Interpretation: Every user has an active balance, -- which holds the user's money
212
true
false
0
7
49
36
21
15
null
null
UCSD-PL/230-web
static/lec-intro.hs
mit
zog = pat3 2 10
15
zog = pat3 2 10
15
zog = pat3 2 10
15
false
false
1
5
4
14
5
9
null
null
BurntSushi/fex
Tests/Untyped.hs
unlicense
-- Examples id' :: Fex id' = lam $ var 1
40
id' :: Fex id' = lam $ var 1
28
id' = lam $ var 1
17
true
true
2
6
10
27
11
16
null
null
OS2World/DEV-UTIL-HUGS
oldlib/MinHeap.hs
bsd-3-clause
deleteAll x E = E
17
deleteAll x E = E
17
deleteAll x E = E
17
false
false
1
5
4
16
5
11
null
null
siddhanathan/ghc
compiler/cmm/CmmNode.hs
bsd-3-clause
wrapRecExp f e = f e
39
wrapRecExp f e = f e
39
wrapRecExp f e = f e
39
false
false
1
5
24
19
6
13
null
null
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/ServiceNetworking/Types/Product.hs
mpl-2.0
-- | Creates a value of 'DeleteConnectionMetadata' with the minimum fields required to make a request. -- deleteConnectionMetadata :: DeleteConnectionMetadata deleteConnectionMetadata = DeleteConnectionMetadata'
215
deleteConnectionMetadata :: DeleteConnectionMetadata deleteConnectionMetadata = DeleteConnectionMetadata'
109
deleteConnectionMetadata = DeleteConnectionMetadata'
52
true
true
1
5
26
17
8
9
null
null
swoertz/pia
src/PIA.hs
gpl-3.0
main::IO() main = do argv <- getArgs prg <- getProgName let(actions, _, errors) = getOpt Permute options argv unless (null errors) $ do printErrorAndExit $ (unlines errors) ++ "Try " ++ prg ++ " --help for more information" opts <- foldl (>>=) (return defaultOptions) actions (trsFile, in...
764
main::IO() main = do argv <- getArgs prg <- getProgName let(actions, _, errors) = getOpt Permute options argv unless (null errors) $ do printErrorAndExit $ (unlines errors) ++ "Try " ++ prg ++ " --help for more information" opts <- foldl (>>=) (return defaultOptions) actions (trsFile, in...
764
main = do argv <- getArgs prg <- getProgName let(actions, _, errors) = getOpt Permute options argv unless (null errors) $ do printErrorAndExit $ (unlines errors) ++ "Try " ++ prg ++ " --help for more information" opts <- foldl (>>=) (return defaultOptions) actions (trsFile, interpretatio...
753
false
true
4
14
153
209
100
109
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/Constants.hs
bsd-2-clause
-- * RPC rpcEncodingNone :: Int rpcEncodingNone = 0
52
rpcEncodingNone :: Int rpcEncodingNone = 0
42
rpcEncodingNone = 0
19
true
true
0
4
9
12
7
5
null
null
danclien/validation-aeson-history
src/Data/Validation/Aeson.hs
mit
localP :: (log -> log) -> Parser (ReaderAccValidation log err a) -> Parser (ReaderAccValidation log err a) localP f = fmap (local f)
152
localP :: (log -> log) -> Parser (ReaderAccValidation log err a) -> Parser (ReaderAccValidation log err a) localP f = fmap (local f)
152
localP f = fmap (local f)
25
false
true
0
9
42
64
31
33
null
null
rodrigofegui/UnB
2017.2/Linguagens de Programação/Trab 2_Ver 2/F6LAE.hs
gpl-3.0
avaliar (Add esq dir) reg funcs nvl = binOp (+) esq dir reg funcs nvl
69
avaliar (Add esq dir) reg funcs nvl = binOp (+) esq dir reg funcs nvl
69
avaliar (Add esq dir) reg funcs nvl = binOp (+) esq dir reg funcs nvl
69
false
false
1
7
14
40
19
21
null
null
roberth/uu-helium
src/Helium/Main.hs
gpl-3.0
preludeImportsPrelude _ = False
31
preludeImportsPrelude _ = False
31
preludeImportsPrelude _ = False
31
false
false
0
5
3
9
4
5
null
null
michaelt/series
Series/Combinators.hs
bsd-3-clause
augmentsFolding_ :: (forall r'. (f r' -> r') -> (m r' -> r') -> (r -> r') -> r') -> (forall r'. (f r' -> r') -> (m r' -> r') -> (s -> r') -> r') -> (forall r'. (f r' -> r') -> (m r' -> r') -> ((r,s) -> r') -> r') augmentsFolding_ = \phi psi construct wrap done -> phi construct ...
438
augmentsFolding_ :: (forall r'. (f r' -> r') -> (m r' -> r') -> (r -> r') -> r') -> (forall r'. (f r' -> r') -> (m r' -> r') -> (s -> r') -> r') -> (forall r'. (f r' -> r') -> (m r' -> r') -> ((r,s) -> r') -> r') augmentsFolding_ = \phi psi construct wrap done -> phi construct ...
438
augmentsFolding_ = \phi psi construct wrap done -> phi construct wrap (\r -> psi construct wrap (\s -> done (r,s)))
203
false
true
0
14
184
218
117
101
null
null
phischu/game-dsl
tower-defense/Main.hs
bsd-3-clause
renderFinished :: Rule renderFinished = do tickCounter <- getEntity finishedCount <- getAttribute FinishedCount tickCounter return (draw (translate (-90) (90) (scale 0.1 0.1 (text ("Finished: " ++ show finishedCount)))))
232
renderFinished :: Rule renderFinished = do tickCounter <- getEntity finishedCount <- getAttribute FinishedCount tickCounter return (draw (translate (-90) (90) (scale 0.1 0.1 (text ("Finished: " ++ show finishedCount)))))
232
renderFinished = do tickCounter <- getEntity finishedCount <- getAttribute FinishedCount tickCounter return (draw (translate (-90) (90) (scale 0.1 0.1 (text ("Finished: " ++ show finishedCount)))))
209
false
true
0
18
39
86
42
44
null
null
bergmark/haskell-opaleye
opaleye-sqlite/src/Opaleye/SQLite/Internal/HaskellDB/Sql/Default.hs
bsd-3-clause
showAggrOp AggrMax = "MAX"
37
showAggrOp AggrMax = "MAX"
37
showAggrOp AggrMax = "MAX"
37
false
false
0
5
14
9
4
5
null
null
jrockway/c2hs
src/C2HS/State.hs
gpl-2.0
-- | get a switch values -- getSwitch :: (SwitchBoard -> a) -> CST s a getSwitch = readExtra
93
getSwitch :: (SwitchBoard -> a) -> CST s a getSwitch = readExtra
65
getSwitch = readExtra
22
true
true
0
7
19
29
16
13
null
null
KiNaudiz/bachelor
CN/Plot2D.hs
gpl-3.0
genTicks :: (PrintfArg a, Num a) => a -> a -> Int -> Int -> [(String,Int)] genTicks x0 dx ticknum n = gen' [0..(n-1)] where part = n `div` ticknum gen' [] = [] gen' (lh:ll) | lh `mod` part == 0 = (printf "%.0f" (x0+fromIntegral lh*dx),fromIntegral (lh+1)) ...
379
genTicks :: (PrintfArg a, Num a) => a -> a -> Int -> Int -> [(String,Int)] genTicks x0 dx ticknum n = gen' [0..(n-1)] where part = n `div` ticknum gen' [] = [] gen' (lh:ll) | lh `mod` part == 0 = (printf "%.0f" (x0+fromIntegral lh*dx),fromIntegral (lh+1)) ...
379
genTicks x0 dx ticknum n = gen' [0..(n-1)] where part = n `div` ticknum gen' [] = [] gen' (lh:ll) | lh `mod` part == 0 = (printf "%.0f" (x0+fromIntegral lh*dx),fromIntegral (lh+1)) : gen' ll | otherwise = gen' ll
304
false
true
5
13
147
184
96
88
null
null
Peaker/lamdu
test/Tests/Sugar.hs
gpl-3.0
testInline :: Test testInline = do queryLangInfo <- Env.make <&> \env -> QueryLangInfo (env ^. has) (env ^. has) (env ^. has) (env ^. has) (env ^. has) let inline workArea = do result <- workArea ^?! ...
1,254
testInline :: Test testInline = do queryLangInfo <- Env.make <&> \env -> QueryLangInfo (env ^. has) (env ^. has) (env ^. has) (env ^. has) (env ^. has) let inline workArea = do result <- workArea ^?! ...
1,254
testInline = do queryLangInfo <- Env.make <&> \env -> QueryLangInfo (env ^. has) (env ^. has) (env ^. has) (env ^. has) (env ^. has) let inline workArea = do result <- workArea ^?! replBody . ...
1,235
false
true
2
27
533
331
162
169
null
null
facebookincubator/duckling
Duckling/Rules/ML.hs
bsd-3-clause
langRules (Seal Duration) = []
30
langRules (Seal Duration) = []
30
langRules (Seal Duration) = []
30
false
false
0
7
4
17
8
9
null
null
tfausak/hutton
Main.hs
mit
format :: Datum -> [Chunk] format datum = intersperse "\t" [ (datum |> secondsLeft |> show |> fromString) <> (datum |> color |> fore) , datum |> numPressers |> show |> fromString , datum |> time |> show |> fromString , datum |> mac |> fromString ]
267
format :: Datum -> [Chunk] format datum = intersperse "\t" [ (datum |> secondsLeft |> show |> fromString) <> (datum |> color |> fore) , datum |> numPressers |> show |> fromString , datum |> time |> show |> fromString , datum |> mac |> fromString ]
267
format datum = intersperse "\t" [ (datum |> secondsLeft |> show |> fromString) <> (datum |> color |> fore) , datum |> numPressers |> show |> fromString , datum |> time |> show |> fromString , datum |> mac |> fromString ]
240
false
true
0
11
66
107
54
53
null
null
tjakway/ghcjvm
compiler/cmm/CLabel.hs
bsd-3-clause
labelType (LargeSRTLabel _) = DataLabel
59
labelType (LargeSRTLabel _) = DataLabel
59
labelType (LargeSRTLabel _) = DataLabel
59
false
false
0
6
24
16
7
9
null
null
antarestrader/sapphire
Parser.hs
gpl-3.0
transLHS exp = fail $ "illigal Left Hand Side of assignment expression: " ++ (show exp)
87
transLHS exp = fail $ "illigal Left Hand Side of assignment expression: " ++ (show exp)
87
transLHS exp = fail $ "illigal Left Hand Side of assignment expression: " ++ (show exp)
87
false
false
0
7
15
23
11
12
null
null
cikusa/genetic
Genetic/Mutation.hs
bsd-3-clause
mutMultiPoint :: (MonadRandom m, FreeGenome g, Gene g ~ e) => (e -> e) -> Probability -> g -> m g mutMultiPoint f r g = foldM mutateGene g [0..length g - 1] where mutateGene a p = probValue r a $ setG p (f $ getG p a) a
221
mutMultiPoint :: (MonadRandom m, FreeGenome g, Gene g ~ e) => (e -> e) -> Probability -> g -> m g mutMultiPoint f r g = foldM mutateGene g [0..length g - 1] where mutateGene a p = probValue r a $ setG p (f $ getG p a) a
221
mutMultiPoint f r g = foldM mutateGene g [0..length g - 1] where mutateGene a p = probValue r a $ setG p (f $ getG p a) a
123
false
true
0
9
51
125
61
64
null
null
binesiyu/ifl
examples/ch18/CountEntries.hs
mit
listDirectory :: FilePath -> IO [String] listDirectory = liftM (filter notDots) . getDirectoryContents where notDots p = p /= "." && p /= ".."
146
listDirectory :: FilePath -> IO [String] listDirectory = liftM (filter notDots) . getDirectoryContents where notDots p = p /= "." && p /= ".."
146
listDirectory = liftM (filter notDots) . getDirectoryContents where notDots p = p /= "." && p /= ".."
105
false
true
0
9
27
56
28
28
null
null
mboes/dedukti
Dedukti/Core.hs
gpl-3.0
bind_name (x ::: _) = x
23
bind_name (x ::: _) = x
23
bind_name (x ::: _) = x
23
false
false
0
7
5
16
8
8
null
null
phadej/hpack
src/Hpack/Run.hs
mit
renderExposedModules :: [String] -> Element renderExposedModules = Field "exposed-modules" . LineSeparatedList
110
renderExposedModules :: [String] -> Element renderExposedModules = Field "exposed-modules" . LineSeparatedList
110
renderExposedModules = Field "exposed-modules" . LineSeparatedList
66
false
true
0
6
10
25
13
12
null
null
brendanhay/gogol
gogol-serviceuser/gen/Network/Google/ServiceUser/Types/Product.hs
mpl-2.0
-- | Creates a value of 'Enum' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'enuSourceContext' -- -- * 'enuEnumvalue' -- -- * 'enuName' -- -- * 'enuOptions' -- -- * 'enuSyntax' enum :: Enum' enum = Enum'' { _enuSourceConte...
448
enum :: Enum' enum = Enum'' { _enuSourceContext = Nothing , _enuEnumvalue = Nothing , _enuName = Nothing , _enuOptions = Nothing , _enuSyntax = Nothing }
183
enum = Enum'' { _enuSourceContext = Nothing , _enuEnumvalue = Nothing , _enuName = Nothing , _enuOptions = Nothing , _enuSyntax = Nothing }
165
true
true
0
6
106
56
40
16
null
null
pyr/himpy
System/Himpy/Logger.hs
mit
-- Simplistic logging module log_line :: TChan String -> String -> IO () log_line chan path = do line <- atomically $ readTChan chan fd <- openFile path AppendMode hPutStrLn fd line hFlush fd hClose fd
212
log_line :: TChan String -> String -> IO () log_line chan path = do line <- atomically $ readTChan chan fd <- openFile path AppendMode hPutStrLn fd line hFlush fd hClose fd
182
log_line chan path = do line <- atomically $ readTChan chan fd <- openFile path AppendMode hPutStrLn fd line hFlush fd hClose fd
138
true
true
0
10
46
84
35
49
null
null
sakhnik/FreeCell
FreeCell.hs
bsd-3-clause
-- Returns the number of foundation. tryFoundate :: [Foundation] -> Card -> Maybe Int tryFoundate foundations (Card Ace _) = -- Ace can be placed only on an empty foundation. elemIndex Nothing foundations
212
tryFoundate :: [Foundation] -> Card -> Maybe Int tryFoundate foundations (Card Ace _) = -- Ace can be placed only on an empty foundation. elemIndex Nothing foundations
175
tryFoundate foundations (Card Ace _) = -- Ace can be placed only on an empty foundation. elemIndex Nothing foundations
126
true
true
0
7
40
45
23
22
null
null
pikajude/ruby-qq
src/RubyQQ.hs
mit
unString :: String -> String unString s' = case readP_to_S lex $ '"' : concatMap escape s' ++ "\"" of [(String str,"")] -> str _ -> error $ "Invalid string literal \"" ++ s' ++ "\" (possibly a bad escape sequence)" where escape '"' = "\\\"" escape m' = [m']
279
unString :: String -> String unString s' = case readP_to_S lex $ '"' : concatMap escape s' ++ "\"" of [(String str,"")] -> str _ -> error $ "Invalid string literal \"" ++ s' ++ "\" (possibly a bad escape sequence)" where escape '"' = "\\\"" escape m' = [m']
279
unString s' = case readP_to_S lex $ '"' : concatMap escape s' ++ "\"" of [(String str,"")] -> str _ -> error $ "Invalid string literal \"" ++ s' ++ "\" (possibly a bad escape sequence)" where escape '"' = "\\\"" escape m' = [m']
250
false
true
0
10
71
99
50
49
null
null
sdiehl/ghc
compiler/coreSyn/CoreMap.hs
bsd-3-clause
foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b foldTypeMap k z m = foldTM k m z
84
foldTypeMap :: (a -> b -> b) -> b -> TypeMap a -> b foldTypeMap k z m = foldTM k m z
84
foldTypeMap k z m = foldTM k m z
32
false
true
0
8
22
51
25
26
null
null
genos/online_problems
advent_of_code_2021/day04/Main.hs
mit
won :: BingoCard -> Bool won (BC marks _) = rows || cols || diags where rows = or [ and (i `M.getRow` marks) | i <- indices ] cols = or [ and (i `M.getCol` marks) | i <- indices ] diags = and (M.getDiag marks) || and (M.getDiag $ M.transpose marks)
257
won :: BingoCard -> Bool won (BC marks _) = rows || cols || diags where rows = or [ and (i `M.getRow` marks) | i <- indices ] cols = or [ and (i `M.getCol` marks) | i <- indices ] diags = and (M.getDiag marks) || and (M.getDiag $ M.transpose marks)
257
won (BC marks _) = rows || cols || diags where rows = or [ and (i `M.getRow` marks) | i <- indices ] cols = or [ and (i `M.getCol` marks) | i <- indices ] diags = and (M.getDiag marks) || and (M.getDiag $ M.transpose marks)
232
false
true
0
10
61
144
73
71
null
null
fedep3/Metaheuriscticas-Data-Clustering
Tests/src/Results.hs
gpl-2.0
-- | Número punto flotante. flotante = do s <- sign l <- many digit p <- char '.' r <- many1 digit c <- scientific <|> (return "") <?> "scientific notation" return $ s ++ l ++ [p] ++ r ++ c -- | Notación científica
243
flotante = do s <- sign l <- many digit p <- char '.' r <- many1 digit c <- scientific <|> (return "") <?> "scientific notation" return $ s ++ l ++ [p] ++ r ++ c -- | Notación científica
215
flotante = do s <- sign l <- many digit p <- char '.' r <- many1 digit c <- scientific <|> (return "") <?> "scientific notation" return $ s ++ l ++ [p] ++ r ++ c -- | Notación científica
215
true
false
0
11
75
92
43
49
null
null
sdiehl/ghc
compiler/GHC/Cmm/Type.hs
bsd-3-clause
isVecType _ = False
41
isVecType _ = False
41
isVecType _ = False
41
false
false
0
4
25
10
4
6
null
null
siddhanathan/dotfiles
scripts/volume.hs
gpl-3.0
matchArgs xs = print "Usage: volume output +5%"
47
matchArgs xs = print "Usage: volume output +5%"
47
matchArgs xs = print "Usage: volume output +5%"
47
false
false
1
5
7
16
5
11
null
null
ghcjs/ghcjs
utils/pkg-cache/ghc/includes/dist-derivedconstants/header/GHCConstantsHaskellWrappers.hs
mit
oFFSET_StgRegTable_rD1 :: DynFlags -> Int oFFSET_StgRegTable_rD1 dflags = pc_OFFSET_StgRegTable_rD1 (platformConstants dflags)
126
oFFSET_StgRegTable_rD1 :: DynFlags -> Int oFFSET_StgRegTable_rD1 dflags = pc_OFFSET_StgRegTable_rD1 (platformConstants dflags)
126
oFFSET_StgRegTable_rD1 dflags = pc_OFFSET_StgRegTable_rD1 (platformConstants dflags)
84
false
true
0
7
10
30
14
16
null
null
myuon/OoP
src/Dungeon.hs
mit
sortFst :: (Ord a) => [(a,b)] -> [(a,b)] sortFst = sortBy (\a b -> compare (fst a) (fst b))
91
sortFst :: (Ord a) => [(a,b)] -> [(a,b)] sortFst = sortBy (\a b -> compare (fst a) (fst b))
91
sortFst = sortBy (\a b -> compare (fst a) (fst b))
50
false
true
0
10
18
72
40
32
null
null