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
styx/gtc
Gt/Helpers.hs
gpl-3.0
jarr_to_list :: JSValue -> [JSValue] jarr_to_list (JSArray jarr) = jarr
71
jarr_to_list :: JSValue -> [JSValue] jarr_to_list (JSArray jarr) = jarr
71
jarr_to_list (JSArray jarr) = jarr
34
false
true
0
9
9
33
15
18
null
null
rzil/honours
DeepLearning/PNN/PNN-Haskell/app/Main.hs
mit
main :: IO () main = print err
30
main :: IO () main = print err
30
main = print err
16
false
true
1
6
7
22
9
13
null
null
iu-parfunc/containers
tests/map-properties.hs
bsd-3-clause
test_deleteMin :: Assertion test_deleteMin = do deleteMin (fromList [(5,"a"), (3,"b"), (7,"c")]) @?= fromList [(5,"a"), (7,"c")] deleteMin (empty :: SMap) @?= empty
172
test_deleteMin :: Assertion test_deleteMin = do deleteMin (fromList [(5,"a"), (3,"b"), (7,"c")]) @?= fromList [(5,"a"), (7,"c")] deleteMin (empty :: SMap) @?= empty
172
test_deleteMin = do deleteMin (fromList [(5,"a"), (3,"b"), (7,"c")]) @?= fromList [(5,"a"), (7,"c")] deleteMin (empty :: SMap) @?= empty
144
false
true
0
12
28
98
53
45
null
null
text-utf8/text
tests/Tests/Properties.hs
bsd-2-clause
t_take_drop_8 m t = T.append (takeWord8 n t) (dropWord8 n t) == t where n = small m
85
t_take_drop_8 m t = T.append (takeWord8 n t) (dropWord8 n t) == t where n = small m
85
t_take_drop_8 m t = T.append (takeWord8 n t) (dropWord8 n t) == t where n = small m
85
false
false
0
8
19
49
23
26
null
null
uuhan/Idris-dev
src/Idris/Coverage.hs
bsd-3-clause
genClauses :: FC -> Name -> [([Name], Term)] -> -- (Argument names, LHS) [PTerm] -> Idris [PTerm] -- No clauses (only valid via elab reflection). We should probably still do -- a check here somehow, e.g. that one of the arguments is an obviously -- empty type. In practice, this should only really be used for Void elimination. genClauses fc n lhs_tms [] = return []
380
genClauses :: FC -> Name -> [([Name], Term)] -> -- (Argument names, LHS) [PTerm] -> Idris [PTerm] genClauses fc n lhs_tms [] = return []
150
genClauses fc n lhs_tms [] = return []
38
true
true
0
10
79
68
38
30
null
null
ExcaliburZero/pixelated-avatar-generator
src/Graphics/Avatars/Pixelated.hs
mit
-- | Converts an image into a Png image ByteString. encodeToPng :: ImageConversion encodeToPng = encodePng
106
encodeToPng :: ImageConversion encodeToPng = encodePng
54
encodeToPng = encodePng
23
true
true
0
4
15
12
7
5
null
null
AlexanderPankiv/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
dffvAlt :: (t, [Var], CoreExpr) -> DFFV () dffvAlt (_,xs,r) = extendScopeList xs (dffvExpr r)
93
dffvAlt :: (t, [Var], CoreExpr) -> DFFV () dffvAlt (_,xs,r) = extendScopeList xs (dffvExpr r)
93
dffvAlt (_,xs,r) = extendScopeList xs (dffvExpr r)
50
false
true
0
7
14
59
31
28
null
null
kindohm/Tidal
Sound/Tidal/Parse.hs
gpl-3.0
pVocable :: Parser (Pattern String) pVocable = do v <- pString return $ atom v
92
pVocable :: Parser (Pattern String) pVocable = do v <- pString return $ atom v
92
pVocable = do v <- pString return $ atom v
56
false
true
1
9
28
41
17
24
null
null
NatureShade/SymbolicHaskell
src/Math/Symbolic/M/Parser.hs
mit
table :: (Fractional a, Real a) => OperatorTable String () Identity (Math a) table = [ [binary "^" (**) AssocLeft], [prefix "-" negate], [binary "*" (*) AssocLeft, binary "/" (/) AssocLeft ], [binary "*:" (\x y -> Op "*:" [x, y]) AssocLeft, prefix ":*" (\x -> Op "*:" [x])], [binary "+" (+) AssocLeft, binary "-" (-) AssocLeft ], [binary "+:" (\x y -> Op "+:" [x, y]) AssocLeft, prefix ":+" (\x -> Op "+:" [x])] ]
471
table :: (Fractional a, Real a) => OperatorTable String () Identity (Math a) table = [ [binary "^" (**) AssocLeft], [prefix "-" negate], [binary "*" (*) AssocLeft, binary "/" (/) AssocLeft ], [binary "*:" (\x y -> Op "*:" [x, y]) AssocLeft, prefix ":*" (\x -> Op "*:" [x])], [binary "+" (+) AssocLeft, binary "-" (-) AssocLeft ], [binary "+:" (\x y -> Op "+:" [x, y]) AssocLeft, prefix ":+" (\x -> Op "+:" [x])] ]
471
table = [ [binary "^" (**) AssocLeft], [prefix "-" negate], [binary "*" (*) AssocLeft, binary "/" (/) AssocLeft ], [binary "*:" (\x y -> Op "*:" [x, y]) AssocLeft, prefix ":*" (\x -> Op "*:" [x])], [binary "+" (+) AssocLeft, binary "-" (-) AssocLeft ], [binary "+:" (\x y -> Op "+:" [x, y]) AssocLeft, prefix ":+" (\x -> Op "+:" [x])] ]
394
false
true
0
12
133
245
134
111
null
null
isido/functional-morphology-for-koine-greek
greek/RulesGreek.hs
gpl-3.0
vLambano :: String -> String -> Verb vLambano lambano lab vf = case vf of Indicative p n Aorist Active -> mkStr $ augment (endingsImperfectW lab (p, n, Active)) Imperative p n AoristI Active -> mkStr $ (endingsPresentImperativeW lab (p, n, Active)) _ -> vPaideuo lambano vf -- make regular stems
342
vLambano :: String -> String -> Verb vLambano lambano lab vf = case vf of Indicative p n Aorist Active -> mkStr $ augment (endingsImperfectW lab (p, n, Active)) Imperative p n AoristI Active -> mkStr $ (endingsPresentImperativeW lab (p, n, Active)) _ -> vPaideuo lambano vf -- make regular stems
342
vLambano lambano lab vf = case vf of Indicative p n Aorist Active -> mkStr $ augment (endingsImperfectW lab (p, n, Active)) Imperative p n AoristI Active -> mkStr $ (endingsPresentImperativeW lab (p, n, Active)) _ -> vPaideuo lambano vf -- make regular stems
305
false
true
0
12
97
117
60
57
null
null
jragonfyre/TRPG
src/ParseUtilities.hs
bsd-3-clause
--import Text.Read (readMaybe) myDefaultOptions = defaultOptions { sumEncoding = ObjectWithSingleField , constructorTagModifier = camelTo2 '-' , fieldLabelModifier = camelTo2 '-' , omitNothingFields = False }
241
myDefaultOptions = defaultOptions { sumEncoding = ObjectWithSingleField , constructorTagModifier = camelTo2 '-' , fieldLabelModifier = camelTo2 '-' , omitNothingFields = False }
209
myDefaultOptions = defaultOptions { sumEncoding = ObjectWithSingleField , constructorTagModifier = camelTo2 '-' , fieldLabelModifier = camelTo2 '-' , omitNothingFields = False }
209
true
false
1
8
57
43
23
20
null
null
frantisekfarka/CoALP
tests/CoALP/Tests/Unit/Transform.hs
lgpl-3.0
annotateProgramTests :: TestTree annotateProgramTests = testGroup "Program Annotation Tests" [ testCase "Annotate one clause Program" $ annotateProgA p1 l1 @?= pa1 , testCase "Annotate multi clause Program" $ annotateProgA p2 l2 @?= pa2 , testCase "Annotate clause mulitple times" $ annotateProgA p3 l3 @?= pa3 , testCase "Annotate unguared 2" $ annotateProgA p4 l4 @?= pa4 , annotationGoldenTests ] where ts1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (CoInd 16)]] c1 = Clause (Fun "h" ts1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca1 = Clause (Fun "h" as1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p1 = [c1] l1 = [(0,3)] -- Clause 0, term 3 pa1 = [ca1] ts2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (Ind 16)]] c2 = Clause (Fun "g" ts2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca2 = Clause (Fun "g" as2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as3 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (CoInd 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] ca3 = Clause (Fun "h" as3) [Fun "h" [Var (Ind 1), Var (CoInd 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as4 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (CoInd 16)]] ca4 = Clause (Fun "h" as4) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p2 = [c1, c2, c1] l2 = [(1,1),(0,3),(2, 0)] pa2 = [ca1, ca2, ca3] p3 = [c1] l3 = [(0,3), (0,1)] pa3 = [ca4] cp1 = Clause (Fun "p" [Fun "1" [], Fun "trans-fun-1" [] ]) [] cp2 = Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (Ind 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (Ind 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] cp3 = Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (Ind 7)]]) [Fun "p" [Var (Ind 3), Var (Ind 7)]] p4 = [cp1, cp2, cp3] l4 = [(2,0), (1,1)] pa4 = [ cp1 , Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (CoInd 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (CoInd 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] , Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (CoInd 7)]]) [Fun "p" [Var (Ind 3), Var (CoInd 7)]] ]
3,897
annotateProgramTests :: TestTree annotateProgramTests = testGroup "Program Annotation Tests" [ testCase "Annotate one clause Program" $ annotateProgA p1 l1 @?= pa1 , testCase "Annotate multi clause Program" $ annotateProgA p2 l2 @?= pa2 , testCase "Annotate clause mulitple times" $ annotateProgA p3 l3 @?= pa3 , testCase "Annotate unguared 2" $ annotateProgA p4 l4 @?= pa4 , annotationGoldenTests ] where ts1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (CoInd 16)]] c1 = Clause (Fun "h" ts1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca1 = Clause (Fun "h" as1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p1 = [c1] l1 = [(0,3)] -- Clause 0, term 3 pa1 = [ca1] ts2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (Ind 16)]] c2 = Clause (Fun "g" ts2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca2 = Clause (Fun "g" as2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as3 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (CoInd 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] ca3 = Clause (Fun "h" as3) [Fun "h" [Var (Ind 1), Var (CoInd 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as4 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (CoInd 16)]] ca4 = Clause (Fun "h" as4) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p2 = [c1, c2, c1] l2 = [(1,1),(0,3),(2, 0)] pa2 = [ca1, ca2, ca3] p3 = [c1] l3 = [(0,3), (0,1)] pa3 = [ca4] cp1 = Clause (Fun "p" [Fun "1" [], Fun "trans-fun-1" [] ]) [] cp2 = Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (Ind 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (Ind 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] cp3 = Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (Ind 7)]]) [Fun "p" [Var (Ind 3), Var (Ind 7)]] p4 = [cp1, cp2, cp3] l4 = [(2,0), (1,1)] pa4 = [ cp1 , Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (CoInd 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (CoInd 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] , Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (CoInd 7)]]) [Fun "p" [Var (Ind 3), Var (CoInd 7)]] ]
3,897
annotateProgramTests = testGroup "Program Annotation Tests" [ testCase "Annotate one clause Program" $ annotateProgA p1 l1 @?= pa1 , testCase "Annotate multi clause Program" $ annotateProgA p2 l2 @?= pa2 , testCase "Annotate clause mulitple times" $ annotateProgA p3 l3 @?= pa3 , testCase "Annotate unguared 2" $ annotateProgA p4 l4 @?= pa4 , annotationGoldenTests ] where ts1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as1 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (CoInd 16)]] c1 = Clause (Fun "h" ts1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca1 = Clause (Fun "h" as1) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p1 = [c1] l1 = [(0,3)] -- Clause 0, term 3 pa1 = [ca1] ts2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] as2 = [Var (Ind 1), Var (Ind 2), Fun "f" [Var (Ind 3)], Fun "transform-func-2" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (Ind 16)]] c2 = Clause (Fun "g" ts2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] ca2 = Clause (Fun "g" as2) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (Ind 3), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as3 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (CoInd 13), Var (Ind 14), Var (Ind 15), Var (Ind 16)]] ca3 = Clause (Fun "h" as3) [Fun "h" [Var (Ind 1), Var (CoInd 13)], Fun "g" [Var (Ind 2), Var (Ind 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (Ind 16)]] as4 = [Var (Ind 1), Fun "g" [], Fun "transform-func-1" [Var (Ind 13), Var (CoInd 14), Var (Ind 15), Var (CoInd 16)]] ca4 = Clause (Fun "h" as4) [Fun "h" [Var (Ind 1), Var (Ind 13)], Fun "g" [Var (Ind 2), Var (CoInd 14)], Fun "f" [Var (Ind 15)], Fun "g" [Var (CoInd 16)]] p2 = [c1, c2, c1] l2 = [(1,1),(0,3),(2, 0)] pa2 = [ca1, ca2, ca3] p3 = [c1] l3 = [(0,3), (0,1)] pa3 = [ca4] cp1 = Clause (Fun "p" [Fun "1" [], Fun "trans-fun-1" [] ]) [] cp2 = Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (Ind 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (Ind 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] cp3 = Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (Ind 7)]]) [Fun "p" [Var (Ind 3), Var (Ind 7)]] p4 = [cp1, cp2, cp3] l4 = [(2,0), (1,1)] pa4 = [ cp1 , Clause (Fun "p" [Var (Ind 2), Fun "trans-fun-2" [Var (Ind 4), Var (CoInd 5), Var (Ind 6)]]) [Fun "q" [Var (Ind 2), Var (Ind 4)], Fun "p2" [Var (Ind 2), Var (CoInd 5)], Fun "q" [Var (Ind 2), Var (Ind 6)]] , Clause (Fun "p2" [Var (Ind 3), Fun "trans-fun-3" [Var (CoInd 7)]]) [Fun "p" [Var (Ind 3), Var (CoInd 7)]] ]
3,864
false
true
27
14
1,504
2,208
1,083
1,125
null
null
Helkafen/haskell-linode
src/Network/Linode.hs
bsd-3-clause
{-| Create a swap partition. -} createSwapDisk :: ApiKey -> LinodeId -> String -> Int -> ExceptT LinodeError IO CreatedDisk createSwapDisk apiKey linId label = createDisk apiKey linId label Swap
194
createSwapDisk :: ApiKey -> LinodeId -> String -> Int -> ExceptT LinodeError IO CreatedDisk createSwapDisk apiKey linId label = createDisk apiKey linId label Swap
162
createSwapDisk apiKey linId label = createDisk apiKey linId label Swap
70
true
true
0
9
29
51
25
26
null
null
samstokes/icalendar-parser
Text/Icalendar/Parser.hs
bsd-3-clause
component :: Maybe String -> Parser Component component maybeType = do typ <- maybe beginAny begin maybeType Component typ <$> property `manyTill` lookAhead (beginAny <|> end typ) <*> component Nothing `manyTill` try (end typ)
242
component :: Maybe String -> Parser Component component maybeType = do typ <- maybe beginAny begin maybeType Component typ <$> property `manyTill` lookAhead (beginAny <|> end typ) <*> component Nothing `manyTill` try (end typ)
242
component maybeType = do typ <- maybe beginAny begin maybeType Component typ <$> property `manyTill` lookAhead (beginAny <|> end typ) <*> component Nothing `manyTill` try (end typ)
196
false
true
0
13
49
89
42
47
null
null
edwardwas/haskellRogue
src/Game.hs
mit
applyUpdate :: WorldUpdate -> World -> Maybe World applyUpdate u@(MobUpdate func _) w = if checkAfterUpdate u w' then Just w' else Nothing where w' = func w
160
applyUpdate :: WorldUpdate -> World -> Maybe World applyUpdate u@(MobUpdate func _) w = if checkAfterUpdate u w' then Just w' else Nothing where w' = func w
160
applyUpdate u@(MobUpdate func _) w = if checkAfterUpdate u w' then Just w' else Nothing where w' = func w
109
false
true
0
8
31
64
32
32
null
null
Frefreak/hearthstone-cardsearch
client/src/JavaScript/JQuery.hs
bsd-3-clause
last :: JQuery -> IO JQuery last = jq_last
42
last :: JQuery -> IO JQuery last = jq_last
42
last = jq_last
14
false
true
0
7
8
24
10
14
null
null
ethercrow/docopt.hs
System/Console/Docopt/UsageParse.hs
mit
flatten x = x
30
flatten x = x
30
flatten x = x
30
false
false
0
4
20
9
4
5
null
null
sergv/vector
Data/Vector.hs
bsd-3-clause
update = G.update
17
update = G.update
17
update = G.update
17
false
false
0
5
2
8
4
4
null
null
ublubu/shapes
shapes/src/Physics/Linear.hs
mit
smulV6' :: V6 -> Double -> V6 smulV6' = flip smulV6
51
smulV6' :: V6 -> Double -> V6 smulV6' = flip smulV6
51
smulV6' = flip smulV6
21
false
true
0
6
10
22
11
11
null
null
BartAdv/Idris-dev
src/Idris/Delaborate.hs
bsd-3-clause
pprintErr :: IState -> Err -> Doc OutputAnnotation pprintErr i err = pprintErr' i (fmap (errReverse i) err)
107
pprintErr :: IState -> Err -> Doc OutputAnnotation pprintErr i err = pprintErr' i (fmap (errReverse i) err)
107
pprintErr i err = pprintErr' i (fmap (errReverse i) err)
56
false
true
0
9
17
46
22
24
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
undefined_RDR :: RdrName undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
80
undefined_RDR :: RdrName undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
80
undefined_RDR = varQual_RDR gHC_ERR (fsLit "undefined")
55
false
true
0
7
8
28
12
16
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2009-Real_World_Haskell/TreeMap.hs
unlicense
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
61
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
61
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
61
false
false
0
7
9
35
16
19
null
null
elieux/ghc
compiler/main/DynFlags.hs
bsd-3-clause
addImportPath p = upd (\s -> s{importPaths = importPaths s ++ splitPathList p})
80
addImportPath p = upd (\s -> s{importPaths = importPaths s ++ splitPathList p})
80
addImportPath p = upd (\s -> s{importPaths = importPaths s ++ splitPathList p})
80
false
false
0
11
13
38
19
19
null
null
energyflowanalysis/efa-2.1
src/EFA/Data/Collection.hs
bsd-3-clause
map :: (Unpack a) => (Container a -> Container a) -> Collection label a -> Collection label a map f (Collection o m) = Collection o $ Map.map (snd . unpack . f . pack . (,) o) m
177
map :: (Unpack a) => (Container a -> Container a) -> Collection label a -> Collection label a map f (Collection o m) = Collection o $ Map.map (snd . unpack . f . pack . (,) o) m
177
map f (Collection o m) = Collection o $ Map.map (snd . unpack . f . pack . (,) o) m
83
false
true
0
11
38
108
51
57
null
null
lucas8/netlist-compiler
compil.hs
mit
readMemory lb r 2 d = do putStrLn $ "movq %" ++ d ++ ", %rdi" putStrLn $ "movq %" ++ r ++ ", %rdx" putStrLn $ "shrq $2, %" ++ r putStrLn $ "andq $3, %rdx" putStrLn $ "movb (%rdi,%" ++ r ++ ",1), %dil" l1 <- lb l2 <- lb putStrLn $ "jmp " ++ l2 putStrLn $ l1 ++ ":" putStrLn $ "shrq $2, %rdi" putStrLn $ "decq %rdx" putStrLn $ l2 ++ ":" putStrLn $ "andq %rdx,%rdx" putStrLn $ "jne " ++ l1
443
readMemory lb r 2 d = do putStrLn $ "movq %" ++ d ++ ", %rdi" putStrLn $ "movq %" ++ r ++ ", %rdx" putStrLn $ "shrq $2, %" ++ r putStrLn $ "andq $3, %rdx" putStrLn $ "movb (%rdi,%" ++ r ++ ",1), %dil" l1 <- lb l2 <- lb putStrLn $ "jmp " ++ l2 putStrLn $ l1 ++ ":" putStrLn $ "shrq $2, %rdi" putStrLn $ "decq %rdx" putStrLn $ l2 ++ ":" putStrLn $ "andq %rdx,%rdx" putStrLn $ "jne " ++ l1
443
readMemory lb r 2 d = do putStrLn $ "movq %" ++ d ++ ", %rdi" putStrLn $ "movq %" ++ r ++ ", %rdx" putStrLn $ "shrq $2, %" ++ r putStrLn $ "andq $3, %rdx" putStrLn $ "movb (%rdi,%" ++ r ++ ",1), %dil" l1 <- lb l2 <- lb putStrLn $ "jmp " ++ l2 putStrLn $ l1 ++ ":" putStrLn $ "shrq $2, %rdi" putStrLn $ "decq %rdx" putStrLn $ l2 ++ ":" putStrLn $ "andq %rdx,%rdx" putStrLn $ "jne " ++ l1
443
false
false
0
9
143
157
71
86
null
null
kmilner/tamarin-prover
lib/theory/src/Theory/Proof.hs
gpl-3.0
-- Unfinished proofs -------------------- -- | A proof using the 'sorry' proof method. sorry :: Maybe String -> a -> Proof a sorry reason ann = LNode (ProofStep (Sorry reason) ann) M.empty
189
sorry :: Maybe String -> a -> Proof a sorry reason ann = LNode (ProofStep (Sorry reason) ann) M.empty
101
sorry reason ann = LNode (ProofStep (Sorry reason) ann) M.empty
63
true
true
0
9
32
54
27
27
null
null
lukexi/cabal
cabal-install/Distribution/Client/InstallPlan.hs
bsd-3-clause
problems :: (HasUnitId ipkg, PackageFixedDeps ipkg, HasUnitId srcpkg, PackageFixedDeps srcpkg) => FakeMap -> Bool -> PlanIndex ipkg srcpkg iresult ifailure -> [PlanProblem ipkg srcpkg iresult ifailure] problems fakeMap indepGoals index = [ PackageMissingDeps pkg (catMaybes (map (fmap packageId . PlanIndex.fakeLookupUnitId fakeMap index) missingDeps)) | (pkg, missingDeps) <- PlanIndex.brokenPackages fakeMap index ] ++ [ PackageCycle cycleGroup | cycleGroup <- PlanIndex.dependencyCycles fakeMap index ] ++ [ PackageInconsistency name inconsistencies | (name, inconsistencies) <- PlanIndex.dependencyInconsistencies fakeMap indepGoals index ] ++ [ PackageStateInvalid pkg pkg' | pkg <- PackageIndex.allPackages index , Just pkg' <- map (PlanIndex.fakeLookupUnitId fakeMap index) (CD.flatDeps (depends pkg)) , not (stateDependencyRelation pkg pkg') ]
998
problems :: (HasUnitId ipkg, PackageFixedDeps ipkg, HasUnitId srcpkg, PackageFixedDeps srcpkg) => FakeMap -> Bool -> PlanIndex ipkg srcpkg iresult ifailure -> [PlanProblem ipkg srcpkg iresult ifailure] problems fakeMap indepGoals index = [ PackageMissingDeps pkg (catMaybes (map (fmap packageId . PlanIndex.fakeLookupUnitId fakeMap index) missingDeps)) | (pkg, missingDeps) <- PlanIndex.brokenPackages fakeMap index ] ++ [ PackageCycle cycleGroup | cycleGroup <- PlanIndex.dependencyCycles fakeMap index ] ++ [ PackageInconsistency name inconsistencies | (name, inconsistencies) <- PlanIndex.dependencyInconsistencies fakeMap indepGoals index ] ++ [ PackageStateInvalid pkg pkg' | pkg <- PackageIndex.allPackages index , Just pkg' <- map (PlanIndex.fakeLookupUnitId fakeMap index) (CD.flatDeps (depends pkg)) , not (stateDependencyRelation pkg pkg') ]
998
problems fakeMap indepGoals index = [ PackageMissingDeps pkg (catMaybes (map (fmap packageId . PlanIndex.fakeLookupUnitId fakeMap index) missingDeps)) | (pkg, missingDeps) <- PlanIndex.brokenPackages fakeMap index ] ++ [ PackageCycle cycleGroup | cycleGroup <- PlanIndex.dependencyCycles fakeMap index ] ++ [ PackageInconsistency name inconsistencies | (name, inconsistencies) <- PlanIndex.dependencyInconsistencies fakeMap indepGoals index ] ++ [ PackageStateInvalid pkg pkg' | pkg <- PackageIndex.allPackages index , Just pkg' <- map (PlanIndex.fakeLookupUnitId fakeMap index) (CD.flatDeps (depends pkg)) , not (stateDependencyRelation pkg pkg') ]
754
false
true
6
14
249
282
137
145
null
null
choener/BiobaseFasta
_old/Pipes.hs
gpl-3.0
-- | Transforms bytestrings into tracked fasta entries. This is a -- pre-transform: header entries can be split over multiple @TrackedHeader@ -- constructors and @TrackedFasta@ constructors hold different line lengths and -- their corresponding header is not yet set. tracked ∷ Monad m ⇒ Producer ByteString (Producer TrackedFasta m) x → Producer TrackedFasta m x tracked p = next p >>= goPrepare (TF 1 1 BS.empty) where -- Remove all lines before the first line starting with @'>'@. goPrepare tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- not a single character? Nothing → next p' >>= goPrepare tf -- start of a FASTA header Just (h,_) | h=='>' → goHdr tf $ Right (r,p') -- remove first line and check the beginning of the next line | Just k ← BS8.findIndex (=='\n') r → goPrepare (over tfLine (+1) tf) $ Right (BS8.drop k r, p') -- we are somewhere in the first line of crap and need to pull more -- stuff | otherwise → next p' >>= goPrepare tf -- Start emitting @TrackedHeader@. Does not do an additional check! goHdr tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.findIndex (=='\n') r of -- header continues into the next fragment. Nothing → do yield $ TrackedHeader (tf^.tfLine) r next p' >>= goHdr tf -- one header line, goData has to do the check on what the next line -- is. Just k → do yield $ TrackedHeader (tf^.tfLine) (BS8.take k r) -- goData should be at the first character of the next -- line now. goData (over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- Start emitting @TrackedFasta@, but check each line for being a header. -- This will emit @TrackedFasta@ of (at most) line length elements, but -- sometimes (whenever @next@ is not at line boundaries) yield the same -- line with different positions. -- -- TODO need to remove all @\n@ and @\r@. goData tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- need to get more data first. Nothing → next p' >>= goData tf Just (h,_) | h=='>' -- this is a header that needs to be handled. → goHdr tf $ Right (r,p') -- we have at least two lines, emit the first and handle the -- remaining bytes next. -- the fasta header will be set by a combining function later. | Just k ← BS8.findIndex (=='\n') r → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) (BS8.take k r) BS.empty goData (set tfPos 1 $ over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- we have only the beginning of a line. | otherwise → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) r BS.empty next p' >>= goData (over tfPos (+ BS.length r) tf) lineprep = BS8.filter (/='\r')
3,262
tracked ∷ Monad m ⇒ Producer ByteString (Producer TrackedFasta m) x → Producer TrackedFasta m x tracked p = next p >>= goPrepare (TF 1 1 BS.empty) where -- Remove all lines before the first line starting with @'>'@. goPrepare tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- not a single character? Nothing → next p' >>= goPrepare tf -- start of a FASTA header Just (h,_) | h=='>' → goHdr tf $ Right (r,p') -- remove first line and check the beginning of the next line | Just k ← BS8.findIndex (=='\n') r → goPrepare (over tfLine (+1) tf) $ Right (BS8.drop k r, p') -- we are somewhere in the first line of crap and need to pull more -- stuff | otherwise → next p' >>= goPrepare tf -- Start emitting @TrackedHeader@. Does not do an additional check! goHdr tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.findIndex (=='\n') r of -- header continues into the next fragment. Nothing → do yield $ TrackedHeader (tf^.tfLine) r next p' >>= goHdr tf -- one header line, goData has to do the check on what the next line -- is. Just k → do yield $ TrackedHeader (tf^.tfLine) (BS8.take k r) -- goData should be at the first character of the next -- line now. goData (over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- Start emitting @TrackedFasta@, but check each line for being a header. -- This will emit @TrackedFasta@ of (at most) line length elements, but -- sometimes (whenever @next@ is not at line boundaries) yield the same -- line with different positions. -- -- TODO need to remove all @\n@ and @\r@. goData tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- need to get more data first. Nothing → next p' >>= goData tf Just (h,_) | h=='>' -- this is a header that needs to be handled. → goHdr tf $ Right (r,p') -- we have at least two lines, emit the first and handle the -- remaining bytes next. -- the fasta header will be set by a combining function later. | Just k ← BS8.findIndex (=='\n') r → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) (BS8.take k r) BS.empty goData (set tfPos 1 $ over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- we have only the beginning of a line. | otherwise → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) r BS.empty next p' >>= goData (over tfPos (+ BS.length r) tf) lineprep = BS8.filter (/='\r')
2,993
tracked p = next p >>= goPrepare (TF 1 1 BS.empty) where -- Remove all lines before the first line starting with @'>'@. goPrepare tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- not a single character? Nothing → next p' >>= goPrepare tf -- start of a FASTA header Just (h,_) | h=='>' → goHdr tf $ Right (r,p') -- remove first line and check the beginning of the next line | Just k ← BS8.findIndex (=='\n') r → goPrepare (over tfLine (+1) tf) $ Right (BS8.drop k r, p') -- we are somewhere in the first line of crap and need to pull more -- stuff | otherwise → next p' >>= goPrepare tf -- Start emitting @TrackedHeader@. Does not do an additional check! goHdr tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.findIndex (=='\n') r of -- header continues into the next fragment. Nothing → do yield $ TrackedHeader (tf^.tfLine) r next p' >>= goHdr tf -- one header line, goData has to do the check on what the next line -- is. Just k → do yield $ TrackedHeader (tf^.tfLine) (BS8.take k r) -- goData should be at the first character of the next -- line now. goData (over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- Start emitting @TrackedFasta@, but check each line for being a header. -- This will emit @TrackedFasta@ of (at most) line length elements, but -- sometimes (whenever @next@ is not at line boundaries) yield the same -- line with different positions. -- -- TODO need to remove all @\n@ and @\r@. goData tf = \case Left l → return l Right (r',p') → let r = lineprep r' in case BS8.uncons r of -- need to get more data first. Nothing → next p' >>= goData tf Just (h,_) | h=='>' -- this is a header that needs to be handled. → goHdr tf $ Right (r,p') -- we have at least two lines, emit the first and handle the -- remaining bytes next. -- the fasta header will be set by a combining function later. | Just k ← BS8.findIndex (=='\n') r → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) (BS8.take k r) BS.empty goData (set tfPos 1 $ over tfLine (+1) tf) $ Right (BS8.drop (k+1) r, p') -- we have only the beginning of a line. | otherwise → do yield $ TrackedFasta (tf^.tfLine) (tf^.tfPos) r BS.empty next p' >>= goData (over tfPos (+ BS.length r) tf) lineprep = BS8.filter (/='\r')
2,897
true
true
3
23
1,126
818
407
411
null
null
Catchouli/neuron
src/Neural.hs
bsd-3-clause
-- Evaluates a neural network. Contrary to evalNetwork, the input is taken in the same form -- as evalLayerM, i.e. a matrix where the rows are a single input vector. evalNetworkM :: Network -> Matrix R -> [(Matrix R, Matrix R)] evalNetworkM network inputs = feedForward evalLayerM inputs network
295
evalNetworkM :: Network -> Matrix R -> [(Matrix R, Matrix R)] evalNetworkM network inputs = feedForward evalLayerM inputs network
129
evalNetworkM network inputs = feedForward evalLayerM inputs network
67
true
true
0
9
48
51
26
25
null
null
mbezjak/grailsproject
src/Grails/Output.hs
mit
printPlugins :: Plugins -> IO () printPlugins = mapM_ printPlugin . table
73
printPlugins :: Plugins -> IO () printPlugins = mapM_ printPlugin . table
73
printPlugins = mapM_ printPlugin . table
40
false
true
0
7
11
27
13
14
null
null
yogeshsajanikar/range-space
Data/RangeSpace.hs
bsd-3-clause
-- | Calculate the union of two 'Range's, per-basis. -- -- The union is constructed by calculating the difference vector between two points, -- performing a basis decomposition on that vector, performing comparisons and -- adjustments on each basis vector, recomposing, and adding the result back to -- the starting position. -- -- The advantage of this method is that it works on an 'AffineSpace' and -- doesn't require a full 'VectorSpace'. It does require that the -- affine space scalars are in a vector space, but this is more easily -- satisfiable. unionRange :: BasisRange t => Range t -> Range t -> Range t unionRange r0 r1 = Range (adjust combineMin min0 min1) (adjust combineMax max0 max1) where combineMin dif = min dif 0 combineMax dif = max dif 0 adjust f orig s = (orig .+^) . recompose . map (fmap f) . decompose $ s .-. orig (min0,max0) = toBounds r0 (min1,max1) = toBounds r1 -- | Restrict a 'Range' by applying a sub-'Range' mask. -- -- For ranges with multiple dimensions, the masking is performed -- independently for each basis. -- If the range lies entirely outside the mask, the returned value -- is 'Range rmin rmin' (per-basis)
1,238
unionRange :: BasisRange t => Range t -> Range t -> Range t unionRange r0 r1 = Range (adjust combineMin min0 min1) (adjust combineMax max0 max1) where combineMin dif = min dif 0 combineMax dif = max dif 0 adjust f orig s = (orig .+^) . recompose . map (fmap f) . decompose $ s .-. orig (min0,max0) = toBounds r0 (min1,max1) = toBounds r1 -- | Restrict a 'Range' by applying a sub-'Range' mask. -- -- For ranges with multiple dimensions, the masking is performed -- independently for each basis. -- If the range lies entirely outside the mask, the returned value -- is 'Range rmin rmin' (per-basis)
683
unionRange r0 r1 = Range (adjust combineMin min0 min1) (adjust combineMax max0 max1) where combineMin dif = min dif 0 combineMax dif = max dif 0 adjust f orig s = (orig .+^) . recompose . map (fmap f) . decompose $ s .-. orig (min0,max0) = toBounds r0 (min1,max1) = toBounds r1 -- | Restrict a 'Range' by applying a sub-'Range' mask. -- -- For ranges with multiple dimensions, the masking is performed -- independently for each basis. -- If the range lies entirely outside the mask, the returned value -- is 'Range rmin rmin' (per-basis)
623
true
true
0
11
288
193
100
93
null
null
roberth/uu-helium
lib/Prelude.hs
gpl-3.0
concat :: [[a]] -> [a] concat = foldr (++) []
45
concat :: [[a]] -> [a] concat = foldr (++) []
45
concat = foldr (++) []
22
false
true
0
7
9
33
19
14
null
null
ghc-android/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
-- IndexXXXoffAddr emitPrimOp dflags res IndexOffAddrOp_Char args = doIndexOffAddrOp (Just (mo_u_8ToWord dflags)) b8 res args
140
emitPrimOp dflags res IndexOffAddrOp_Char args = doIndexOffAddrOp (Just (mo_u_8ToWord dflags)) b8 res args
120
emitPrimOp dflags res IndexOffAddrOp_Char args = doIndexOffAddrOp (Just (mo_u_8ToWord dflags)) b8 res args
120
true
false
0
9
29
37
18
19
null
null
cabrera/hasql
library/Hasql/QQ.hs
mit
-- | -- Produces a lambda-expression, -- which takes as many parameters as there are placeholders in the quoted text -- and results in a 'Bknd.Stmt'. -- -- E.g.: -- -- >selectSum :: Int -> Int -> Stmt c -- >selectSum = [stmt|SELECT (? + ?)|] -- -- It also allows to directly refer to free variables like so: -- -- >selectSum :: Int -> Int -> Stmt c -- >selectSum a b = [stmt|SELECT ($a + $b)|] stmt :: QuasiQuoter stmt = QuasiQuoter (parseExp) (const $ fail "Pattern context is not supported") (const $ fail "Type context is not supported") (const $ fail "Declaration context is not supported") where parseExp = fmap (uncurry statementF) . either (fail . showString "Parsing failure: ") return . Parser.parse . fromString statementF t params = LamE (map VarP argNames) (purify [|Bknd.Stmt $(pure statementE) $(pure argsE) True|]) where (varNames, argNames) = (\(a, b) -> (reverse a, reverse b)) $ flip execState ([], []) $ forM_ params $ \case Parser.ParamName n -> modify $ \(a, b) -> (mkName (Text.unpack n) : a, b) Parser.OrderedPlaceholder -> modify $ \(a, b) -> let n = mkName $ '_' : show (length b + 1) in (n : a, n : b) Parser.IndexedPlaceholder i -> fail "Indexed placeholders are not supported" statementE = LitE (StringL (Text.unpack t)) argsE = vectorE $ map (\x -> purify [| Bknd.encodeValue $(varE x) |]) $ varNames
1,617
stmt :: QuasiQuoter stmt = QuasiQuoter (parseExp) (const $ fail "Pattern context is not supported") (const $ fail "Type context is not supported") (const $ fail "Declaration context is not supported") where parseExp = fmap (uncurry statementF) . either (fail . showString "Parsing failure: ") return . Parser.parse . fromString statementF t params = LamE (map VarP argNames) (purify [|Bknd.Stmt $(pure statementE) $(pure argsE) True|]) where (varNames, argNames) = (\(a, b) -> (reverse a, reverse b)) $ flip execState ([], []) $ forM_ params $ \case Parser.ParamName n -> modify $ \(a, b) -> (mkName (Text.unpack n) : a, b) Parser.OrderedPlaceholder -> modify $ \(a, b) -> let n = mkName $ '_' : show (length b + 1) in (n : a, n : b) Parser.IndexedPlaceholder i -> fail "Indexed placeholders are not supported" statementE = LitE (StringL (Text.unpack t)) argsE = vectorE $ map (\x -> purify [| Bknd.encodeValue $(varE x) |]) $ varNames
1,217
stmt = QuasiQuoter (parseExp) (const $ fail "Pattern context is not supported") (const $ fail "Type context is not supported") (const $ fail "Declaration context is not supported") where parseExp = fmap (uncurry statementF) . either (fail . showString "Parsing failure: ") return . Parser.parse . fromString statementF t params = LamE (map VarP argNames) (purify [|Bknd.Stmt $(pure statementE) $(pure argsE) True|]) where (varNames, argNames) = (\(a, b) -> (reverse a, reverse b)) $ flip execState ([], []) $ forM_ params $ \case Parser.ParamName n -> modify $ \(a, b) -> (mkName (Text.unpack n) : a, b) Parser.OrderedPlaceholder -> modify $ \(a, b) -> let n = mkName $ '_' : show (length b + 1) in (n : a, n : b) Parser.IndexedPlaceholder i -> fail "Indexed placeholders are not supported" statementE = LitE (StringL (Text.unpack t)) argsE = vectorE $ map (\x -> purify [| Bknd.encodeValue $(varE x) |]) $ varNames
1,197
true
true
1
21
521
400
214
186
null
null
TomMD/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
callishOp FloatSinOp = Just MO_F32_Sin
41
callishOp FloatSinOp = Just MO_F32_Sin
41
callishOp FloatSinOp = Just MO_F32_Sin
41
false
false
1
5
7
15
5
10
null
null
fpinsight/hadron
src/Hadron/Streams/Bounded.hs
bsd-3-clause
------------------------------------------------------------------------------ -- | Writes the contents of an input stream to a channel until the input stream -- yields end-of-stream. inputToChan :: InputStream a -> BoundedChan (Maybe a) -> IO () inputToChan is ch = go where go = do mb <- read is writeChan ch mb maybe (return $! ()) (const go) mb ------------------------------------------------------------------------------ -- | Turns a 'Chan' into an input stream. --
504
inputToChan :: InputStream a -> BoundedChan (Maybe a) -> IO () inputToChan is ch = go where go = do mb <- read is writeChan ch mb maybe (return $! ()) (const go) mb ------------------------------------------------------------------------------ -- | Turns a 'Chan' into an input stream. --
320
inputToChan is ch = go where go = do mb <- read is writeChan ch mb maybe (return $! ()) (const go) mb ------------------------------------------------------------------------------ -- | Turns a 'Chan' into an input stream. --
257
true
true
0
10
96
98
48
50
null
null
EchoTeam/harlson
Perftest.hs
bsd-2-clause
newConnHandle :: IO Handle newConnHandle = do addrinfos <- getAddrInfo Nothing (Just "127.0.0.1") (Just "1813") let serveraddr = head addrinfos sock <- socket (addrFamily serveraddr) Stream defaultProtocol connect sock (addrAddress serveraddr) socketToHandle sock ReadWriteMode
297
newConnHandle :: IO Handle newConnHandle = do addrinfos <- getAddrInfo Nothing (Just "127.0.0.1") (Just "1813") let serveraddr = head addrinfos sock <- socket (addrFamily serveraddr) Stream defaultProtocol connect sock (addrAddress serveraddr) socketToHandle sock ReadWriteMode
297
newConnHandle = do addrinfos <- getAddrInfo Nothing (Just "127.0.0.1") (Just "1813") let serveraddr = head addrinfos sock <- socket (addrFamily serveraddr) Stream defaultProtocol connect sock (addrAddress serveraddr) socketToHandle sock ReadWriteMode
270
false
true
0
11
53
100
43
57
null
null
alexvong1995/pandoc
src/Text/Pandoc/Writers/EPUB.hs
gpl-2.0
toId :: FilePath -> String toId = map (\x -> if isAlphaNum x || x == '-' || x == '_' then x else '_') . takeFileName
158
toId :: FilePath -> String toId = map (\x -> if isAlphaNum x || x == '-' || x == '_' then x else '_') . takeFileName
158
toId = map (\x -> if isAlphaNum x || x == '-' || x == '_' then x else '_') . takeFileName
131
false
true
0
13
68
64
31
33
null
null
databrary/databrary
src/Model/Ingest.hs
agpl-3.0
parseParticipantFieldMapping :: [Metric] -> [(Metric, Text)] -> Either String ParticipantFieldMapping2 parseParticipantFieldMapping volParticipantActiveMetrics requestedMapping = do when ( length volParticipantActiveMetrics /= length requestedMapping || L.sort volParticipantActiveMetrics /= (L.sort . fmap fst) requestedMapping) (Left "The requested metric mapping does not completely match the required volume metrics") mkParticipantFieldMapping2 requestedMapping
493
parseParticipantFieldMapping :: [Metric] -> [(Metric, Text)] -> Either String ParticipantFieldMapping2 parseParticipantFieldMapping volParticipantActiveMetrics requestedMapping = do when ( length volParticipantActiveMetrics /= length requestedMapping || L.sort volParticipantActiveMetrics /= (L.sort . fmap fst) requestedMapping) (Left "The requested metric mapping does not completely match the required volume metrics") mkParticipantFieldMapping2 requestedMapping
493
parseParticipantFieldMapping volParticipantActiveMetrics requestedMapping = do when ( length volParticipantActiveMetrics /= length requestedMapping || L.sort volParticipantActiveMetrics /= (L.sort . fmap fst) requestedMapping) (Left "The requested metric mapping does not completely match the required volume metrics") mkParticipantFieldMapping2 requestedMapping
390
false
true
0
13
73
102
49
53
null
null
goldfirere/singletons
singletons-th/src/Data/Singletons/TH.hs
bsd-3-clause
sCases :: OptionsMonad q => Name -- ^ The head of the type the scrutinee's type is based on. -- (Like @''Maybe@ or @''Bool@.) -> q Exp -- ^ The scrutinee, in a Template Haskell quote -> q Exp -- ^ The body, in a Template Haskell quote -> q Exp sCases tyName expq bodyq = do opts <- getOptions dinfo <- dsReify tyName case dinfo of Just (DTyConI (DDataD _ _ _ _ _ ctors _) _) -> let ctor_stuff = map (first (singledDataConName opts) . extractNameArgs) ctors in expToTH <$> buildCases ctor_stuff expq bodyq Just _ -> fail $ "Using <<cases>> with something other than a type constructor: " ++ (show tyName) _ -> fail $ "Cannot find " ++ show tyName
765
sCases :: OptionsMonad q => Name -- ^ The head of the type the scrutinee's type is based on. -- (Like @''Maybe@ or @''Bool@.) -> q Exp -- ^ The scrutinee, in a Template Haskell quote -> q Exp -- ^ The body, in a Template Haskell quote -> q Exp sCases tyName expq bodyq = do opts <- getOptions dinfo <- dsReify tyName case dinfo of Just (DTyConI (DDataD _ _ _ _ _ ctors _) _) -> let ctor_stuff = map (first (singledDataConName opts) . extractNameArgs) ctors in expToTH <$> buildCases ctor_stuff expq bodyq Just _ -> fail $ "Using <<cases>> with something other than a type constructor: " ++ (show tyName) _ -> fail $ "Cannot find " ++ show tyName
765
sCases tyName expq bodyq = do opts <- getOptions dinfo <- dsReify tyName case dinfo of Just (DTyConI (DDataD _ _ _ _ _ ctors _) _) -> let ctor_stuff = map (first (singledDataConName opts) . extractNameArgs) ctors in expToTH <$> buildCases ctor_stuff expq bodyq Just _ -> fail $ "Using <<cases>> with something other than a type constructor: " ++ (show tyName) _ -> fail $ "Cannot find " ++ show tyName
452
false
true
0
19
243
192
91
101
null
null
imalsogreg/realtime-streams
test/System/IO/Streams/Realtime/Internal/Tests.hs
bsd-3-clause
tests :: Test tests = testGroup "Realtime Internal tests" []
60
tests :: Test tests = testGroup "Realtime Internal tests" []
60
tests = testGroup "Realtime Internal tests" []
46
false
true
0
6
9
25
10
15
null
null
kolmodin/cabal
cabal-install/Distribution/Client/InstallPlan.hs
bsd-3-clause
showPlanPackageTag (Failed _ _) = "Failed"
47
showPlanPackageTag (Failed _ _) = "Failed"
47
showPlanPackageTag (Failed _ _) = "Failed"
47
false
false
0
7
10
17
8
9
null
null
mariefarrell/Hets
GUI/GraphMenu.hs
gpl-2.0
createMenuButtonProveStructured :: GInfo -> ButtonMenu GA.NodeValue createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
281
createMenuButtonProveStructured :: GInfo -> ButtonMenu GA.NodeValue createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
281
createMenuButtonProveStructured gi = createMenuButton "Prove VSE Structured" (\ descr _ -> proofMenu gi (SelectCmd Prover $ "VSE structured: " ++ show descr) $ VSE.prove (libName gi, descr)) gi
213
false
true
0
13
53
80
39
41
null
null
cdepillabout/coursera
algorithms1/week1/Trash.hs
gpl-3.0
s = read n :: Int --finalArray <- buildArray nums --f <- freeze finalArray :: IO (Array Int Int) --print f --let g = runSTArray $ buildArrayST nums --print g --print $ runSTArray $ doWhat g --print g --print $ runSTArray $ doWhat g --print g --print $ runSTArray $ doWhat g --print g --print $ runSTArray $ doWhat g --print g --print $ runSTArray $ doWhat g --print g buildArray :: Int -> IO (IOArray Int Int) buildArray n = do arr <- newArray (0, n) 999999 :: IO (IOArray Int Int) a <- readArray arr 1 writeArray arr 1 64 b <- readArray arr 1 return arr buildAr
725
buildArray :: Int -> IO (IOArray Int Int) buildArray n = do arr <- newArray (0, n) 999999 :: IO (IOArray Int Int) a <- readArray arr 1 writeArray arr 1 64 b <- readArray arr 1 return arr
226
buildArray n = do arr <- newArray (0, n) 999999 :: IO (IOArray Int Int) a <- readArray arr 1 writeArray arr 1 64 b <- readArray arr 1 return arr
184
true
true
2
10
272
140
69
71
null
null
flipstone/orville
orville-postgresql-libpq/src/Orville/PostgreSQL/PgCatalog/PgAttribute.hs
mit
{- | The @attnotnull@ column of the @pg_catalog.pg_attribute@ table -} attributeIsNotNullField :: Orville.FieldDefinition Orville.NotNull Bool attributeIsNotNullField = Orville.booleanField "attnotnull"
206
attributeIsNotNullField :: Orville.FieldDefinition Orville.NotNull Bool attributeIsNotNullField = Orville.booleanField "attnotnull"
133
attributeIsNotNullField = Orville.booleanField "attnotnull"
61
true
true
1
6
22
30
13
17
null
null
mookerji/libsbp
haskell/test/Test/SwiftNav/SBP/Table.hs
lgpl-3.0
testParse :: TestTree testParse = testGroup "Empty Test" [ testCase "Empty data" $ do True @?= False ]
120
testParse :: TestTree testParse = testGroup "Empty Test" [ testCase "Empty data" $ do True @?= False ]
120
testParse = testGroup "Empty Test" [ testCase "Empty data" $ do True @?= False ]
98
false
true
0
10
35
33
16
17
null
null
fiigii/dataflow
ContextSensitiveCP.hs
mit
csTransfer _ (CallStmt res _ (FunctionStmt _ _ body _) _ Return _) (Just (_, oldL)) (omiga, csL) = let (ReturnStmt (Just e) _) = last body upEnv = tail omiga sigma = csL ! omiga oldState = oldL ! upEnv resultState = insert res (cpA e sigma) oldState resultCallStringState = Map.singleton upEnv resultState in (upEnv, resultCallStringState)
373
csTransfer _ (CallStmt res _ (FunctionStmt _ _ body _) _ Return _) (Just (_, oldL)) (omiga, csL) = let (ReturnStmt (Just e) _) = last body upEnv = tail omiga sigma = csL ! omiga oldState = oldL ! upEnv resultState = insert res (cpA e sigma) oldState resultCallStringState = Map.singleton upEnv resultState in (upEnv, resultCallStringState)
373
csTransfer _ (CallStmt res _ (FunctionStmt _ _ body _) _ Return _) (Just (_, oldL)) (omiga, csL) = let (ReturnStmt (Just e) _) = last body upEnv = tail omiga sigma = csL ! omiga oldState = oldL ! upEnv resultState = insert res (cpA e sigma) oldState resultCallStringState = Map.singleton upEnv resultState in (upEnv, resultCallStringState)
373
false
false
2
12
90
160
79
81
null
null
glguy/config-value
src/Config/Number.hs
mit
integerToNumber :: Integer -> Number integerToNumber = rationalToNumber . fromInteger
85
integerToNumber :: Integer -> Number integerToNumber = rationalToNumber . fromInteger
85
integerToNumber = rationalToNumber . fromInteger
48
false
true
0
7
9
26
11
15
null
null
MauriceIsAG/HaskellScratch
.stack-work/intero/intero1846heo.hs
bsd-3-clause
encodeDirect :: (Eq a) => [a] -> [List a] encodeDirect [] = []
62
encodeDirect :: (Eq a) => [a] -> [List a] encodeDirect [] = []
62
encodeDirect [] = []
20
false
true
0
8
12
40
21
19
null
null
beni55/text
Data/Text.hs
bsd-2-clause
-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at -- newline 'Char's. The resulting strings do not contain newlines. lines :: Text -> [Text] lines ps | null ps = [] | otherwise = h : if null t then [] else lines (unsafeTail t) where (# h,t #) = span_ (/= '\n') ps
340
lines :: Text -> [Text] lines ps | null ps = [] | otherwise = h : if null t then [] else lines (unsafeTail t) where (# h,t #) = span_ (/= '\n') ps
216
lines ps | null ps = [] | otherwise = h : if null t then [] else lines (unsafeTail t) where (# h,t #) = span_ (/= '\n') ps
192
true
true
0
10
127
94
47
47
null
null
DougBurke/swish
tests/RDFProofContextTest.hs
lgpl-2.1
rdfBase03, rdfCon03a, rdfGoal03 :: RDFFormula rdfBase03 = makeFormula scopeex "rdfBase03" "ex:s ex:p ex:o ."
126
rdfBase03, rdfCon03a, rdfGoal03 :: RDFFormula rdfBase03 = makeFormula scopeex "rdfBase03" "ex:s ex:p ex:o ."
126
rdfBase03 = makeFormula scopeex "rdfBase03" "ex:s ex:p ex:o ."
80
false
true
0
5
31
22
13
9
null
null
gokhankici/symmetry
checker/tests/todo/SrcReslock.hs
mit
ack_msg :: ReslockSem repr => repr (Pid RSing -> Msg) ack_msg = lam $ \pid -> inr $ inl pid
92
ack_msg :: ReslockSem repr => repr (Pid RSing -> Msg) ack_msg = lam $ \pid -> inr $ inl pid
92
ack_msg = lam $ \pid -> inr $ inl pid
38
false
true
2
10
20
53
24
29
null
null
phischu/fragnix
tests/packages/scotty/Text.PrettyPrint.Annotated.HughesPJ.hs
bsd-3-clause
annotSize _ = 0
27
annotSize _ = 0
27
annotSize _ = 0
27
false
false
0
4
15
10
4
6
null
null
RayRacine/nucleic
Nucleic/IO.hs
gpl-3.0
pushS :: Signal a -> a -> IO () pushS (Signal _ pB) = FRP.sync . pB
68
pushS :: Signal a -> a -> IO () pushS (Signal _ pB) = FRP.sync . pB
68
pushS (Signal _ pB) = FRP.sync . pB
36
false
true
0
8
17
44
21
23
null
null
haskell-works/kafka-client
tests/Kafka/Consumer/ConsumerRecordMapSpec.hs
mit
spec :: Spec spec = describe "Kafka.Consumer.ConsumerRecordSpec" $ do it "should exract key" $ bitraverse id pure testRecord `shouldBe` Just (crMapKey (const testKey) testRecord) it "should extract value" $ sequence testRecord `shouldBe` Just (crMapValue (const testValue) testRecord) it "should extract both key and value" $ bisequence testRecord `shouldBe` Just (crMapKV (const testKey) (const testValue) testRecord)
450
spec :: Spec spec = describe "Kafka.Consumer.ConsumerRecordSpec" $ do it "should exract key" $ bitraverse id pure testRecord `shouldBe` Just (crMapKey (const testKey) testRecord) it "should extract value" $ sequence testRecord `shouldBe` Just (crMapValue (const testValue) testRecord) it "should extract both key and value" $ bisequence testRecord `shouldBe` Just (crMapKV (const testKey) (const testValue) testRecord)
450
spec = describe "Kafka.Consumer.ConsumerRecordSpec" $ do it "should exract key" $ bitraverse id pure testRecord `shouldBe` Just (crMapKey (const testKey) testRecord) it "should extract value" $ sequence testRecord `shouldBe` Just (crMapValue (const testValue) testRecord) it "should extract both key and value" $ bisequence testRecord `shouldBe` Just (crMapKV (const testKey) (const testValue) testRecord)
437
false
true
0
14
86
145
67
78
null
null
leichunfeng/learnyouahaskell
baby.hs
mit
head' (x:_) = x
15
head' (x:_) = x
15
head' (x:_) = x
15
false
false
0
6
3
17
8
9
null
null
gafiatulin/codewars
src/4 kyu/BWT.hs
mit
encode :: Ord a => [a] -> ([a], Int) encode = (map last . snd &&& fromJust . uncurry ($)) . (elemIndex &&& sort . shifts) where shifts = reverse . tail . uncurry (zipWith (++)) . (tails &&& inits)
200
encode :: Ord a => [a] -> ([a], Int) encode = (map last . snd &&& fromJust . uncurry ($)) . (elemIndex &&& sort . shifts) where shifts = reverse . tail . uncurry (zipWith (++)) . (tails &&& inits)
200
encode = (map last . snd &&& fromJust . uncurry ($)) . (elemIndex &&& sort . shifts) where shifts = reverse . tail . uncurry (zipWith (++)) . (tails &&& inits)
163
false
true
0
11
43
109
59
50
null
null
thoughtpolice/infinity
Setup.hs
bsd-3-clause
ignore a = Prelude.catch a (\_ -> return ())
44
ignore a = Prelude.catch a (\_ -> return ())
44
ignore a = Prelude.catch a (\_ -> return ())
44
false
false
0
9
8
29
14
15
null
null
Tr1p0d/WisRegister
dist/build/autogen/Paths_WisRegister.hs
gpl-3.0
getSysconfDir = catchIO (getEnv "WisRegister_sysconfdir") (\_ -> return sysconfdir)
83
getSysconfDir = catchIO (getEnv "WisRegister_sysconfdir") (\_ -> return sysconfdir)
83
getSysconfDir = catchIO (getEnv "WisRegister_sysconfdir") (\_ -> return sysconfdir)
83
false
false
0
8
8
28
14
14
null
null
micxjo/hs-multiaddr
src/Network/Multiaddr.hs
bsd-3-clause
ipv4AddrB :: IPv4Addr -> Builder ipv4AddrB = mconcat . intersperse (singleton '.') . map Builder.decimal . asBytes
116
ipv4AddrB :: IPv4Addr -> Builder ipv4AddrB = mconcat . intersperse (singleton '.') . map Builder.decimal . asBytes
116
ipv4AddrB = mconcat . intersperse (singleton '.') . map Builder.decimal . asBytes
83
false
true
0
10
18
41
20
21
null
null
Warbo/nix-eval
src/Language/Eval/Internal.hs
gpl-3.0
runCmdStdIO :: CreateProcess -> String -> IO (String, ExitCode) runCmdStdIO c i = do (Just hIn, Just hOut, Nothing, hProc) <- createProcess c hPutContents hIn i out <- System.IO.Strict.hGetContents hOut code <- waitForProcess hProc return (out, code)
335
runCmdStdIO :: CreateProcess -> String -> IO (String, ExitCode) runCmdStdIO c i = do (Just hIn, Just hOut, Nothing, hProc) <- createProcess c hPutContents hIn i out <- System.IO.Strict.hGetContents hOut code <- waitForProcess hProc return (out, code)
335
runCmdStdIO c i = do (Just hIn, Just hOut, Nothing, hProc) <- createProcess c hPutContents hIn i out <- System.IO.Strict.hGetContents hOut code <- waitForProcess hProc return (out, code)
271
false
true
0
9
121
105
51
54
null
null
jonaprieto/online-atps
src/OnlineATPs/Options.hs
mit
tpOpt ∷ String → MOptions atpOpt [] _ = Left $ pretty "option " <> squotes "--atp" <> pretty " requires an argument NAME"
124
atpOpt ∷ String → MOptions atpOpt [] _ = Left $ pretty "option " <> squotes "--atp" <> pretty " requires an argument NAME"
124
atpOpt [] _ = Left $ pretty "option " <> squotes "--atp" <> pretty " requires an argument NAME"
97
false
true
4
8
26
50
21
29
null
null
blanu/arbre
Arbre/Context.hs
gpl-2.0
bindPair Local (Context lex dyn self value local) (key, val) = Context lex dyn self value (bindPairMapping (key, val) local)
124
bindPair Local (Context lex dyn self value local) (key, val) = Context lex dyn self value (bindPairMapping (key, val) local)
124
bindPair Local (Context lex dyn self value local) (key, val) = Context lex dyn self value (bindPairMapping (key, val) local)
124
false
false
1
8
19
61
30
31
null
null
tel/graphbuilder
src/Data/Graph/Builder.hs
mit
modifyVxs :: (Map Vertex (Maybe a) -> Map Vertex (Maybe a)) -> GraphBuilder e a b () modifyVxs f = GraphBuilder $ modify $ \ gs@(GraphState { vxs = vxs }) -> gs { vxs = f vxs }
191
modifyVxs :: (Map Vertex (Maybe a) -> Map Vertex (Maybe a)) -> GraphBuilder e a b () modifyVxs f = GraphBuilder $ modify $ \ gs@(GraphState { vxs = vxs }) -> gs { vxs = f vxs }
191
modifyVxs f = GraphBuilder $ modify $ \ gs@(GraphState { vxs = vxs }) -> gs { vxs = f vxs }
93
false
true
0
11
53
97
50
47
null
null
solatis/haskell-network-anonymous-tor
src/Network/Anonymous/Tor/Protocol/Parser.hs
mit
-- | Ascii offset representation of a backslash. backslash :: Word8 backslash = 92
82
backslash :: Word8 backslash = 92
33
backslash = 92
14
true
true
0
6
13
19
8
11
null
null
gbaz/cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
bsd-3-clause
-- | Database with some cycles -- -- * Simplest non-trivial cycle: A -> B and B -> A -- * There is a cycle C -> D -> C, but it can be broken by picking the -- right flag assignment. db14 :: ExampleDb db14 = [ Right $ exAv "A" 1 [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] , Right $ exAv "C" 1 [exFlag "flagC" [ExAny "D"] [ExAny "E"]] , Right $ exAv "D" 1 [ExAny "C"] , Right $ exAv "E" 1 [] ]
409
db14 :: ExampleDb db14 = [ Right $ exAv "A" 1 [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] , Right $ exAv "C" 1 [exFlag "flagC" [ExAny "D"] [ExAny "E"]] , Right $ exAv "D" 1 [ExAny "C"] , Right $ exAv "E" 1 [] ]
225
db14 = [ Right $ exAv "A" 1 [ExAny "B"] , Right $ exAv "B" 1 [ExAny "A"] , Right $ exAv "C" 1 [exFlag "flagC" [ExAny "D"] [ExAny "E"]] , Right $ exAv "D" 1 [ExAny "C"] , Right $ exAv "E" 1 [] ]
207
true
true
0
12
106
135
68
67
null
null
pparkkin/eta
compiler/ETA/SimplCore/FloatIn.hs
bsd-3-clause
fiExpr _ to_drop (_, AnnType ty) = ASSERT( null to_drop ) Type ty
69
fiExpr _ to_drop (_, AnnType ty) = ASSERT( null to_drop ) Type ty
69
fiExpr _ to_drop (_, AnnType ty) = ASSERT( null to_drop ) Type ty
69
false
false
0
7
16
35
17
18
null
null
bitemyapp/7startups
Backends/Hub.hs
bsd-3-clause
ask2message :: IAsk -> Message ask2message (AskingAction (IAskingAction pid age necards gs _) _) = let ps = gs ^. playermap choices = allowableActions age pid necards ps in playerActionsDialog pid ps necards choices
232
ask2message :: IAsk -> Message ask2message (AskingAction (IAskingAction pid age necards gs _) _) = let ps = gs ^. playermap choices = allowableActions age pid necards ps in playerActionsDialog pid ps necards choices
232
ask2message (AskingAction (IAskingAction pid age necards gs _) _) = let ps = gs ^. playermap choices = allowableActions age pid necards ps in playerActionsDialog pid ps necards choices
201
false
true
0
9
50
78
38
40
null
null
wavewave/hoodle-core
src/Hoodle/Coroutine/Default.hs
gpl-3.0
defaultEventProcess ToContSinglePage = viewModeChange ToContSinglePage
70
defaultEventProcess ToContSinglePage = viewModeChange ToContSinglePage
70
defaultEventProcess ToContSinglePage = viewModeChange ToContSinglePage
70
false
false
0
5
4
12
5
7
null
null
ganeti-github-testing/ganeti-test-1
src/Ganeti/OpParams.hs
bsd-2-clause
-- | Cluster-wide default directory for storing Gluster-backed disks. pClusterGlusterStorageDir :: Field pClusterGlusterStorageDir = renameField "ClusterGlusterStorageDir" $ optionalStringField "gluster_storage_dir"
219
pClusterGlusterStorageDir :: Field pClusterGlusterStorageDir = renameField "ClusterGlusterStorageDir" $ optionalStringField "gluster_storage_dir"
149
pClusterGlusterStorageDir = renameField "ClusterGlusterStorageDir" $ optionalStringField "gluster_storage_dir"
114
true
true
0
6
22
22
11
11
null
null
iliastsi/gac
src/main/SysTools.hs
mit
-- ------------------------------------------------------------------- -- Running an external program runSomething :: DynFlags -> String -- For -v message -> String -- Command name (possibly a full path) -> [Option] -- Arguments -> IO Bool runSomething dflags phase_name pgm args = runSomethingFiltered dflags id phase_name pgm args Nothing
410
runSomething :: DynFlags -> String -- For -v message -> String -- Command name (possibly a full path) -> [Option] -- Arguments -> IO Bool runSomething dflags phase_name pgm args = runSomethingFiltered dflags id phase_name pgm args Nothing
307
runSomething dflags phase_name pgm args = runSomethingFiltered dflags id phase_name pgm args Nothing
104
true
true
0
9
114
60
32
28
null
null
mcschroeder/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
noMethodBindingErrorName = err_nm "noMethodBindingError" noMethodBindingErrorIdKey nO_METHOD_BINDING_ERROR_ID
147
noMethodBindingErrorName = err_nm "noMethodBindingError" noMethodBindingErrorIdKey nO_METHOD_BINDING_ERROR_ID
147
noMethodBindingErrorName = err_nm "noMethodBindingError" noMethodBindingErrorIdKey nO_METHOD_BINDING_ERROR_ID
147
false
false
0
5
43
13
6
7
null
null
sdiehl/ghc
libraries/ghc-heap/tests/heap_all.hs
bsd-3-clause
exAPClosure :: Closure exAPClosure = APClosure { info = exItbl{tipe=AP} , arity = 0 , n_args = 0 , fun = asBox id , payload = [] }
154
exAPClosure :: Closure exAPClosure = APClosure { info = exItbl{tipe=AP} , arity = 0 , n_args = 0 , fun = asBox id , payload = [] }
154
exAPClosure = APClosure { info = exItbl{tipe=AP} , arity = 0 , n_args = 0 , fun = asBox id , payload = [] }
131
false
true
0
9
51
60
35
25
null
null
noughtmare/yi
yi-core/src/Yi/Editor.hs
gpl-2.0
acceptedInputs :: EditorM [T.Text] acceptedInputs = do km <- defaultKm <$> askCfg keymap <- withCurrentBuffer $ gets (withMode0 modeKeymap) let l = I.accepted 3 . I.mkAutomaton . extractTopKeymap . keymap $ km return $ fmap T.unwords l -- | Shows the current key bindings in a new window
296
acceptedInputs :: EditorM [T.Text] acceptedInputs = do km <- defaultKm <$> askCfg keymap <- withCurrentBuffer $ gets (withMode0 modeKeymap) let l = I.accepted 3 . I.mkAutomaton . extractTopKeymap . keymap $ km return $ fmap T.unwords l -- | Shows the current key bindings in a new window
296
acceptedInputs = do km <- defaultKm <$> askCfg keymap <- withCurrentBuffer $ gets (withMode0 modeKeymap) let l = I.accepted 3 . I.mkAutomaton . extractTopKeymap . keymap $ km return $ fmap T.unwords l -- | Shows the current key bindings in a new window
261
false
true
0
15
56
97
46
51
null
null
mcmaniac/ghc
compiler/nativeGen/X86/CodeGen.hs
bsd-3-clause
regClobbered _ = False
22
regClobbered _ = False
22
regClobbered _ = False
22
false
false
0
5
3
9
4
5
null
null
rbonifacio/hephaestus-pl
src/meta-hephaestus/HplProducts/Base.hs
lgpl-3.0
-- Add equations for product-specific transformations xml2Transformation :: String -> [String] -> ParserResult TransformationModel xml2Transformation "Undefined" _ = undefined
175
xml2Transformation :: String -> [String] -> ParserResult TransformationModel xml2Transformation "Undefined" _ = undefined
121
xml2Transformation "Undefined" _ = undefined
44
true
true
0
7
18
31
16
15
null
null
alphalambda/codeworld
codeworld-base/src/Internal/Prelude.hs
apache-2.0
randomNumbers :: Number -> [Number] randomNumbers = randomsFrom . numToStdGen
77
randomNumbers :: Number -> [Number] randomNumbers = randomsFrom . numToStdGen
77
randomNumbers = randomsFrom . numToStdGen
41
false
true
0
8
9
29
13
16
null
null
JPMoresmau/leksah-server
src/IDE/Metainfo/SourceDB.hs
gpl-2.0
packageStyle :: P.LanguageDef st packageStyle = emptyDef { P.commentStart = "{-" , P.commentLine = "--" , P.commentEnd = "-}" }
202
packageStyle :: P.LanguageDef st packageStyle = emptyDef { P.commentStart = "{-" , P.commentLine = "--" , P.commentEnd = "-}" }
202
packageStyle = emptyDef { P.commentStart = "{-" , P.commentLine = "--" , P.commentEnd = "-}" }
168
false
true
0
6
94
42
24
18
null
null
TomMD/ghc
libraries/template-haskell/Language/Haskell/TH/Lib.hs
bsd-3-clause
viewP :: ExpQ -> PatQ -> PatQ viewP e p = do e' <- e p' <- p return (ViewP e' p')
111
viewP :: ExpQ -> PatQ -> PatQ viewP e p = do e' <- e p' <- p return (ViewP e' p')
111
viewP e p = do e' <- e p' <- p return (ViewP e' p')
81
false
true
0
10
51
58
25
33
null
null
goldfirere/glambda
src/Language/Glambda/Unchecked.hs
bsd-3-clause
pretty_exp c prec (UArith e1 (UArithOp op) e2) = prettyArith c prec e1 op e2
76
pretty_exp c prec (UArith e1 (UArithOp op) e2) = prettyArith c prec e1 op e2
76
pretty_exp c prec (UArith e1 (UArithOp op) e2) = prettyArith c prec e1 op e2
76
false
false
0
8
14
43
19
24
null
null
MasseR/xmonadcontrib
XMonad/Layout/LayoutCombinators.hs
bsd-3-clause
(**|***) = combineTwo (Tall 1 0.1 (2/5))
42
(**|***) = combineTwo (Tall 1 0.1 (2/5))
42
(**|***) = combineTwo (Tall 1 0.1 (2/5))
42
false
false
1
9
8
32
15
17
null
null
rahulmutt/ghcvm
libraries/base/Data/OldList.hs
bsd-3-clause
dropLength _ [] = []
20
dropLength _ [] = []
20
dropLength _ [] = []
20
false
false
1
6
4
18
7
11
null
null
HIPERFIT/futhark
src/Futhark/CodeGen/Backends/CCUDA.hs
isc
deallocateCUDABuffer _ _ space = error $ "Cannot deallocate in '" ++ space ++ "' memory space."
97
deallocateCUDABuffer _ _ space = error $ "Cannot deallocate in '" ++ space ++ "' memory space."
97
deallocateCUDABuffer _ _ space = error $ "Cannot deallocate in '" ++ space ++ "' memory space."
97
false
false
2
6
18
27
12
15
null
null
green-haskell/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
-- | For debugging problems with the CLabel representation. -- We can't make a Show instance for CLabel because lots of its components don't have instances. -- The regular Outputable instance only shows the label name, and not its other info. -- pprDebugCLabel :: CLabel -> SDoc pprDebugCLabel lbl = case lbl of IdLabel{} -> ppr lbl <> (parens $ text "IdLabel") CmmLabel pkg _name _info -> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg) RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel") ForeignLabel _name mSuffix src funOrData -> ppr lbl <> (parens $ text "ForeignLabel" <+> ppr mSuffix <+> ppr src <+> ppr funOrData) _ -> ppr lbl <> (parens $ text "other CLabel)")
867
pprDebugCLabel :: CLabel -> SDoc pprDebugCLabel lbl = case lbl of IdLabel{} -> ppr lbl <> (parens $ text "IdLabel") CmmLabel pkg _name _info -> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg) RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel") ForeignLabel _name mSuffix src funOrData -> ppr lbl <> (parens $ text "ForeignLabel" <+> ppr mSuffix <+> ppr src <+> ppr funOrData) _ -> ppr lbl <> (parens $ text "other CLabel)")
611
pprDebugCLabel lbl = case lbl of IdLabel{} -> ppr lbl <> (parens $ text "IdLabel") CmmLabel pkg _name _info -> ppr lbl <> (parens $ text "CmmLabel" <+> ppr pkg) RtsLabel{} -> ppr lbl <> (parens $ text "RtsLabel") ForeignLabel _name mSuffix src funOrData -> ppr lbl <> (parens $ text "ForeignLabel" <+> ppr mSuffix <+> ppr src <+> ppr funOrData) _ -> ppr lbl <> (parens $ text "other CLabel)")
578
true
true
0
14
313
193
93
100
null
null
supki/pakej
bin/Main.hs
bsd-3-clause
-- | ~/.pakej/pakej.hs sourceFile :: IO FilePath sourceFile = inPakejDirectory "pakej.hs"
89
sourceFile :: IO FilePath sourceFile = inPakejDirectory "pakej.hs"
66
sourceFile = inPakejDirectory "pakej.hs"
40
true
true
0
5
10
18
9
9
null
null
haskellGardener/yusic
src/Yusic.hs
mit
toKeyGuide (C:E:G :[]) = Just KG_CMajor
59
toKeyGuide (C:E:G :[]) = Just KG_CMajor
59
toKeyGuide (C:E:G :[]) = Just KG_CMajor
59
false
false
0
10
25
29
14
15
null
null
k-bx/riak-haskell-client
src/Network/Riak/Request.hs
apache-2.0
putIndex :: IndexInfo -> Maybe Timeout -> YzIndex.YzIndexPutRequest putIndex = YzIndex.YzIndexPutRequest
104
putIndex :: IndexInfo -> Maybe Timeout -> YzIndex.YzIndexPutRequest putIndex = YzIndex.YzIndexPutRequest
104
putIndex = YzIndex.YzIndexPutRequest
36
false
true
0
9
10
33
14
19
null
null
jrgdiz/tese
src/LangRG.hs
mit
g_authormissing :: GAnswer g_authormissing = GAEAuthorMissing
61
g_authormissing :: GAnswer g_authormissing = GAEAuthorMissing
61
g_authormissing = GAEAuthorMissing
34
false
true
0
6
5
18
7
11
null
null
shlevy/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
ppr_cmd (HsCmdArrApp arrow arg _ HsHigherOrderApp True) = hsep [ppr_lexpr arrow, larrowtt, ppr_lexpr arg]
107
ppr_cmd (HsCmdArrApp arrow arg _ HsHigherOrderApp True) = hsep [ppr_lexpr arrow, larrowtt, ppr_lexpr arg]
107
ppr_cmd (HsCmdArrApp arrow arg _ HsHigherOrderApp True) = hsep [ppr_lexpr arrow, larrowtt, ppr_lexpr arg]
107
false
false
0
7
15
41
20
21
null
null
snoyberg/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
coercibleDataConKey = mkPreludeDataConUnique 32
67
coercibleDataConKey = mkPreludeDataConUnique 32
67
coercibleDataConKey = mkPreludeDataConUnique 32
67
false
false
0
5
23
9
4
5
null
null
bitemyapp/ghc
compiler/deSugar/Check.hs
bsd-3-clause
remove_first_column_lit :: HsLit -> [(EqnNo, EquationInfo)] -> [(EqnNo, EquationInfo)] remove_first_column_lit lit qs = ASSERT2( okGroup qs, pprGroup qs ) [(n, shift_pat eqn) | q@(n,eqn) <- qs, is_var_lit lit (firstPatN q)] where shift_pat eqn@(EqnInfo { eqn_pats = _:ps}) = eqn { eqn_pats = ps } shift_pat _ = panic "Check.shift_var: no patterns" {- This function splits the equations @qs@ in groups that deal with the same constructor. -}
538
remove_first_column_lit :: HsLit -> [(EqnNo, EquationInfo)] -> [(EqnNo, EquationInfo)] remove_first_column_lit lit qs = ASSERT2( okGroup qs, pprGroup qs ) [(n, shift_pat eqn) | q@(n,eqn) <- qs, is_var_lit lit (firstPatN q)] where shift_pat eqn@(EqnInfo { eqn_pats = _:ps}) = eqn { eqn_pats = ps } shift_pat _ = panic "Check.shift_var: no patterns" {- This function splits the equations @qs@ in groups that deal with the same constructor. -}
538
remove_first_column_lit lit qs = ASSERT2( okGroup qs, pprGroup qs ) [(n, shift_pat eqn) | q@(n,eqn) <- qs, is_var_lit lit (firstPatN q)] where shift_pat eqn@(EqnInfo { eqn_pats = _:ps}) = eqn { eqn_pats = ps } shift_pat _ = panic "Check.shift_var: no patterns" {- This function splits the equations @qs@ in groups that deal with the same constructor. -}
403
false
true
1
11
164
152
83
69
null
null
tadeuzagallo/verve-lang
src/Interpreter/Builtin.hs
mit
false = VIn "False" []
22
false = VIn "False" []
22
false = VIn "False" []
22
false
false
1
6
4
18
6
12
null
null
sopvop/cabal
Cabal/Distribution/ParseUtils.hs
bsd-3-clause
listField :: String -> (a -> Doc) -> ReadP [a] a -> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b listField = listFieldWithSep fsep
141
listField :: String -> (a -> Doc) -> ReadP [a] a -> (b -> [a]) -> ([a] -> b -> b) -> FieldDescr b listField = listFieldWithSep fsep
141
listField = listFieldWithSep fsep
33
false
true
0
12
37
76
40
36
null
null
YoshikuniJujo/hsConfigure
HsConfigure.hs
lgpl-3.0
buildLaunch :: String -> Maybe Version -> Maybe FilePath -> IO () buildLaunch prjName ver src = do whenMaybe src $ initAppUserDataDirectory prjName ver recompile prjName ver exec <- getAppUserDataDirectory prjName >>= return . addExecuteSuffix . mkBaseFile prjName args <- getArgs executeFile exec False args Nothing
326
buildLaunch :: String -> Maybe Version -> Maybe FilePath -> IO () buildLaunch prjName ver src = do whenMaybe src $ initAppUserDataDirectory prjName ver recompile prjName ver exec <- getAppUserDataDirectory prjName >>= return . addExecuteSuffix . mkBaseFile prjName args <- getArgs executeFile exec False args Nothing
326
buildLaunch prjName ver src = do whenMaybe src $ initAppUserDataDirectory prjName ver recompile prjName ver exec <- getAppUserDataDirectory prjName >>= return . addExecuteSuffix . mkBaseFile prjName args <- getArgs executeFile exec False args Nothing
260
false
true
0
11
55
108
47
61
null
null
m-alvarez/scher-run
Compiling.hs
mit
preprocessorFlags :: [(PreprocessorFlag, Maybe String)] -> [String] preprocessorFlags = map $ \pair -> case pair of (flag, Nothing) -> "-D"++flag (flag, Just val) -> "-D"++flag++"="++val
204
preprocessorFlags :: [(PreprocessorFlag, Maybe String)] -> [String] preprocessorFlags = map $ \pair -> case pair of (flag, Nothing) -> "-D"++flag (flag, Just val) -> "-D"++flag++"="++val
204
preprocessorFlags = map $ \pair -> case pair of (flag, Nothing) -> "-D"++flag (flag, Just val) -> "-D"++flag++"="++val
136
false
true
4
8
42
89
47
42
null
null
DougBurke/swish
src/Swish/RDF/Vocabulary/FOAF.hs
lgpl-2.1
-- Properties -- | @foaf:account@ from <http://xmlns.com/foaf/spec/#term_account>. foafaccount :: ScopedName foafaccount = toF "account"
138
foafaccount :: ScopedName foafaccount = toF "account"
53
foafaccount = toF "account"
27
true
true
0
5
15
16
9
7
null
null
ezyang/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
translateOp dflags XorOp = Just (mo_wordXor dflags)
60
translateOp dflags XorOp = Just (mo_wordXor dflags)
60
translateOp dflags XorOp = Just (mo_wordXor dflags)
60
false
false
0
7
15
22
9
13
null
null
ghc-android/ghc
compiler/typecheck/TcGenDeriv.hs
bsd-3-clause
ltDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<##" )
53
ltDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<##" )
53
ltDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<##" )
53
false
false
0
7
9
17
8
9
null
null
mbakke/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Cluster Verify error codes and documentation cvEclustercert :: (String, String, String) cvEclustercert = ("cluster", Types.cVErrorCodeToRaw CvECLUSTERCERT, "Cluster certificate files verification failure")
219
cvEclustercert :: (String, String, String) cvEclustercert = ("cluster", Types.cVErrorCodeToRaw CvECLUSTERCERT, "Cluster certificate files verification failure")
168
cvEclustercert = ("cluster", Types.cVErrorCodeToRaw CvECLUSTERCERT, "Cluster certificate files verification failure")
125
true
true
0
7
31
35
21
14
null
null
nevrenato/HyLoRes_Source
src/HyLoRes/Formula/Internal.hs
gpl-2.0
attrib (NegProp a _) = a
24
attrib (NegProp a _) = a
24
attrib (NegProp a _) = a
24
false
false
0
6
5
18
8
10
null
null