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
bqv/mako
Irc.hs
mpl-2.0
startNetWorker :: IrcServer -> IO IrcConnection startNetWorker is = connect (IrcServer.host is) (IrcServer.port is) >>= runReaderT listen
157
startNetWorker :: IrcServer -> IO IrcConnection startNetWorker is = connect (IrcServer.host is) (IrcServer.port is) >>= runReaderT listen
157
startNetWorker is = connect (IrcServer.host is) (IrcServer.port is) >>= runReaderT listen
109
false
true
0
9
36
49
23
26
null
null
futtetennista/IntroductionToFunctionalProgramming
itfp/src/Chapter4.hs
mit
norm :: Base -> Vint -> Vint norm base = strep . foldr (carry base) [0]
73
norm :: Base -> Vint -> Vint norm base = strep . foldr (carry base) [0]
73
norm base = strep . foldr (carry base) [0]
44
false
true
0
8
17
40
20
20
null
null
emwap/feldspar-compiler
lib/Feldspar/Compiler/Imperative/ExternalProgram.hs
bsd-3-clause
expToExpression' _ _ Seq{} = error "expToExpression: No support for seq."
73
expToExpression' _ _ Seq{} = error "expToExpression: No support for seq."
73
expToExpression' _ _ Seq{} = error "expToExpression: No support for seq."
73
false
false
0
6
10
20
9
11
null
null
nushio3/ghc
compiler/simplCore/SimplEnv.hs
bsd-3-clause
addNonRec :: SimplEnv -> OutId -> OutExpr -> SimplEnv -- Add a non-recursive binding and extend the in-scope set -- The latter is important; the binder may already be in the -- in-scope set (although it might also have been created with newId) -- but it may now have more IdInfo addNonRec env id rhs = id `seq` -- This seq forces the Id, and hence its IdInfo, -- and hence any inner substitutions env { seFloats = seFloats env `addFlts` unitFloat (NonRec id rhs), seInScope = extendInScopeSet (seInScope env) id }
546
addNonRec :: SimplEnv -> OutId -> OutExpr -> SimplEnv addNonRec env id rhs = id `seq` -- This seq forces the Id, and hence its IdInfo, -- and hence any inner substitutions env { seFloats = seFloats env `addFlts` unitFloat (NonRec id rhs), seInScope = extendInScopeSet (seInScope env) id }
321
addNonRec env id rhs = id `seq` -- This seq forces the Id, and hence its IdInfo, -- and hence any inner substitutions env { seFloats = seFloats env `addFlts` unitFloat (NonRec id rhs), seInScope = extendInScopeSet (seInScope env) id }
267
true
true
0
11
124
87
49
38
null
null
nomeata/codeworld
funblocks-client/src/Blocks/Printer.hs
apache-2.0
reset :: Printer reset = do PrintState (col,stack,lines) <- get case stack of (h:_) -> put $ PrintState (h,stack,lines `T.append` "\n" `T.append` (T.pack $ replicate h ' ') ) _ -> put $ PrintState (col, stack, lines)
229
reset :: Printer reset = do PrintState (col,stack,lines) <- get case stack of (h:_) -> put $ PrintState (h,stack,lines `T.append` "\n" `T.append` (T.pack $ replicate h ' ') ) _ -> put $ PrintState (col, stack, lines)
229
reset = do PrintState (col,stack,lines) <- get case stack of (h:_) -> put $ PrintState (h,stack,lines `T.append` "\n" `T.append` (T.pack $ replicate h ' ') ) _ -> put $ PrintState (col, stack, lines)
212
false
true
0
16
49
118
64
54
null
null
ailiev/faerieplay-compiler
Faerieplay/Intermediate.hs
bsd-3-clause
proj_FL_byte_off f loc@(FieldLoc { byteloc = (off,len) }) = loc { byteloc = (f off, len) }
93
proj_FL_byte_off f loc@(FieldLoc { byteloc = (off,len) }) = loc { byteloc = (f off, len) }
93
proj_FL_byte_off f loc@(FieldLoc { byteloc = (off,len) }) = loc { byteloc = (f off, len) }
93
false
false
0
11
19
49
28
21
null
null
gangsterveggies/julia-pinheiro-compiler
Scope.hs
gpl-2.0
enscope :: Scope -> Bool -> Scope enscope (st, i) recursive = (Stack.push (HashTable.empty, 0, recursive) st, i)
112
enscope :: Scope -> Bool -> Scope enscope (st, i) recursive = (Stack.push (HashTable.empty, 0, recursive) st, i)
112
enscope (st, i) recursive = (Stack.push (HashTable.empty, 0, recursive) st, i)
78
false
true
0
9
17
60
31
29
null
null
steveshogren/language-safety-data-collector
src/learningGADTS.hs
bsd-3-clause
eval (Add e1 e2) = eval e1 + eval e2
36
eval (Add e1 e2) = eval e1 + eval e2
36
eval (Add e1 e2) = eval e1 + eval e2
36
false
false
0
7
9
27
12
15
null
null
bb010g/aura
aura/exec/aura.hs
gpl-3.0
main :: IO () main = do options <- execParser opts res <- try $ withEnv options $ \env -> execute env options >>= exit (settings env) case res of Left err -> putTextLn (dtot . ($ English) $ failure err) *> exitFailure Right r -> pure r -- | Won't throw due to the `try`.
290
main :: IO () main = do options <- execParser opts res <- try $ withEnv options $ \env -> execute env options >>= exit (settings env) case res of Left err -> putTextLn (dtot . ($ English) $ failure err) *> exitFailure Right r -> pure r -- | Won't throw due to the `try`.
290
main = do options <- execParser opts res <- try $ withEnv options $ \env -> execute env options >>= exit (settings env) case res of Left err -> putTextLn (dtot . ($ English) $ failure err) *> exitFailure Right r -> pure r -- | Won't throw due to the `try`.
276
false
true
0
15
75
121
57
64
null
null
rueshyna/gogol
gogol-container/gen/Network/Google/Container/Types/Product.hs
mpl-2.0
-- | The initial node count for the pool. You must ensure that your Compute -- Engine resource quota is sufficient for this number of instances. You -- must also have available firewall and routes quota. npInitialNodeCount :: Lens' NodePool (Maybe Int32) npInitialNodeCount = lens _npInitialNodeCount (\ s a -> s{_npInitialNodeCount = a}) . mapping _Coerce
370
npInitialNodeCount :: Lens' NodePool (Maybe Int32) npInitialNodeCount = lens _npInitialNodeCount (\ s a -> s{_npInitialNodeCount = a}) . mapping _Coerce
166
npInitialNodeCount = lens _npInitialNodeCount (\ s a -> s{_npInitialNodeCount = a}) . mapping _Coerce
115
true
true
3
8
69
65
30
35
null
null
pjones/xmonad-test
vendor/xmonad-contrib/XMonad/Layout/ThreeColumns.hs
bsd-2-clause
-- | tile3. Compute window positions using 3 panes tile3 :: Bool -> Rational -> Rectangle -> Int -> Int -> [Rectangle] tile3 middle f r nmaster n | n <= nmaster || nmaster == 0 = splitVertically n r | n <= nmaster+1 = splitVertically nmaster s1 ++ splitVertically (n-nmaster) s2 | otherwise = splitVertically nmaster r1 ++ splitVertically nslave1 r2 ++ splitVertically nslave2 r3 where (r1, r2, r3) = split3HorizontallyBy middle (if f<0 then 1+2*f else f) r (s1, s2) = splitHorizontallyBy (if f<0 then 1+f else f) r nslave = (n - nmaster) nslave1 = ceiling (nslave % 2) nslave2 = (n - nmaster - nslave1)
680
tile3 :: Bool -> Rational -> Rectangle -> Int -> Int -> [Rectangle] tile3 middle f r nmaster n | n <= nmaster || nmaster == 0 = splitVertically n r | n <= nmaster+1 = splitVertically nmaster s1 ++ splitVertically (n-nmaster) s2 | otherwise = splitVertically nmaster r1 ++ splitVertically nslave1 r2 ++ splitVertically nslave2 r3 where (r1, r2, r3) = split3HorizontallyBy middle (if f<0 then 1+2*f else f) r (s1, s2) = splitHorizontallyBy (if f<0 then 1+f else f) r nslave = (n - nmaster) nslave1 = ceiling (nslave % 2) nslave2 = (n - nmaster - nslave1)
628
tile3 middle f r nmaster n | n <= nmaster || nmaster == 0 = splitVertically n r | n <= nmaster+1 = splitVertically nmaster s1 ++ splitVertically (n-nmaster) s2 | otherwise = splitVertically nmaster r1 ++ splitVertically nslave1 r2 ++ splitVertically nslave2 r3 where (r1, r2, r3) = split3HorizontallyBy middle (if f<0 then 1+2*f else f) r (s1, s2) = splitHorizontallyBy (if f<0 then 1+f else f) r nslave = (n - nmaster) nslave1 = ceiling (nslave % 2) nslave2 = (n - nmaster - nslave1)
560
true
true
1
11
185
270
138
132
null
null
RoboNickBot/interactive-tree-demos
src/Hyper/Canvas/Types.hs
bsd-2-clause
mult :: Int -> (Location, Vector, Primitive) -> [Draw] mult nf qp = foldr (\n -> (:) (frameShift qp n)) [] [1..nf]
114
mult :: Int -> (Location, Vector, Primitive) -> [Draw] mult nf qp = foldr (\n -> (:) (frameShift qp n)) [] [1..nf]
114
mult nf qp = foldr (\n -> (:) (frameShift qp n)) [] [1..nf]
59
false
true
0
10
21
77
40
37
null
null
recursion-ninja/megaparsec
bench/memory/Main.hs
bsd-2-clause
---------------------------------------------------------------------------- -- Helpers -- | Generate that many \'a\' characters. manyAs :: Int -> Text manyAs n = T.replicate n "a"
182
manyAs :: Int -> Text manyAs n = T.replicate n "a"
50
manyAs n = T.replicate n "a"
28
true
true
0
6
22
31
16
15
null
null
rootzlevel/device-manager
lib/Data/Config/Parser.hs
bsd-3-clause
section :: Parser Section section = Section <$> sectionHeader <*> many assignment
81
section :: Parser Section section = Section <$> sectionHeader <*> many assignment
81
section = Section <$> sectionHeader <*> many assignment
55
false
true
0
6
11
25
12
13
null
null
edofic/scotty
Web/Scotty/Route.hs
bsd-3-clause
-- | Build a route that requires the requested path match exactly, without captures. literal :: String -> RoutePattern literal = Literal . T.pack
145
literal :: String -> RoutePattern literal = Literal . T.pack
60
literal = Literal . T.pack
26
true
true
0
6
23
22
12
10
null
null
bergmark/hlint
src/HSE/Util.hs
bsd-3-clause
--------------------------------------------------------------------- -- VECTOR APPLICATION apps :: [Exp_] -> Exp_ apps = foldl1 (App an)
139
apps :: [Exp_] -> Exp_ apps = foldl1 (App an)
45
apps = foldl1 (App an)
22
true
true
0
7
15
35
17
18
null
null
lancelet/approxier
src/lib/VecMath.hs
apache-2.0
-- | Offsets a point by a given vector. offsetPoint :: Vector3 -> Point3 -> Point3 offsetPoint (Vector3 vx vy vz) (Point3 px py pz) = Point3 (px + vx) (py + vy) (pz + vz)
170
offsetPoint :: Vector3 -> Point3 -> Point3 offsetPoint (Vector3 vx vy vz) (Point3 px py pz) = Point3 (px + vx) (py + vy) (pz + vz)
130
offsetPoint (Vector3 vx vy vz) (Point3 px py pz) = Point3 (px + vx) (py + vy) (pz + vz)
87
true
true
0
7
35
73
38
35
null
null
AlexanderPankiv/ghc
compiler/main/HscTypes.hs
bsd-3-clause
-- | Constructs an empty ModDetails emptyModDetails :: ModDetails emptyModDetails = ModDetails { md_types = emptyTypeEnv, md_exports = [], md_insts = [], md_rules = [], md_fam_insts = [], md_anns = [], md_vect_info = noVectInfo }
352
emptyModDetails :: ModDetails emptyModDetails = ModDetails { md_types = emptyTypeEnv, md_exports = [], md_insts = [], md_rules = [], md_fam_insts = [], md_anns = [], md_vect_info = noVectInfo }
316
emptyModDetails = ModDetails { md_types = emptyTypeEnv, md_exports = [], md_insts = [], md_rules = [], md_fam_insts = [], md_anns = [], md_vect_info = noVectInfo }
286
true
true
0
7
157
69
41
28
null
null
suhailshergill/liboleg
Lambda/Semantics.hs
bsd-3-clause
lsen5_pc = lsen5 :: (P C) Bool
32
lsen5_pc = lsen5 :: (P C) Bool
32
lsen5_pc = lsen5 :: (P C) Bool
32
false
false
0
7
8
18
9
9
null
null
ssoudan/hsChess
src/Minimax.hs
apache-2.0
-- | Compare two 'GameTree' based on the payoff computed with 'play'. compareGT :: GameTree -> GameTree -> Ordering compareGT s1 s2 = play s1 `compare` play s2
159
compareGT :: GameTree -> GameTree -> Ordering compareGT s1 s2 = play s1 `compare` play s2
89
compareGT s1 s2 = play s1 `compare` play s2
43
true
true
0
6
27
37
19
18
null
null
seckcoder/vector
Data/Vector/Generic.hs
bsd-3-clause
prescanl f z = unstream . inplace (S.prescanl f z) id . stream
62
prescanl f z = unstream . inplace (S.prescanl f z) id . stream
62
prescanl f z = unstream . inplace (S.prescanl f z) id . stream
62
false
false
1
10
12
39
16
23
null
null
ndmitchell/nsis
src/Development/NSIS/Optimise.hs
bsd-3-clause
elimDeadVar :: [NSIS] -> [NSIS] elimDeadVar x = transform f x where f (Assign x _:xs) | x `elem` unused = xs f xs = xs unused = nub assign \\ nub used used = every \\ assign every = universeBi x assign = [x | Assign x _ <- universeBi x]
289
elimDeadVar :: [NSIS] -> [NSIS] elimDeadVar x = transform f x where f (Assign x _:xs) | x `elem` unused = xs f xs = xs unused = nub assign \\ nub used used = every \\ assign every = universeBi x assign = [x | Assign x _ <- universeBi x]
289
elimDeadVar x = transform f x where f (Assign x _:xs) | x `elem` unused = xs f xs = xs unused = nub assign \\ nub used used = every \\ assign every = universeBi x assign = [x | Assign x _ <- universeBi x]
257
false
true
0
10
104
127
64
63
null
null
smurphy8/serial-test-generators
src/Test/Serial.hs
mit
explainError old new = [i| JSON doesn't match: old: ${old} new: ${new} |]
86
explainError old new = [i| JSON doesn't match: old: ${old} new: ${new} |]
86
explainError old new = [i| JSON doesn't match: old: ${old} new: ${new} |]
86
false
false
1
5
25
20
9
11
null
null
roberth/uu-helium
src/Helium/Parser/CollectFunctionBindings.hs
gpl-3.0
functionBindingOfDeclaration :: Declaration -> FunctionBinding functionBindingOfDeclaration (Declaration_FunctionBindings _ [f]) = f
132
functionBindingOfDeclaration :: Declaration -> FunctionBinding functionBindingOfDeclaration (Declaration_FunctionBindings _ [f]) = f
132
functionBindingOfDeclaration (Declaration_FunctionBindings _ [f]) = f
69
false
true
0
8
10
29
15
14
null
null
stevedonnelly/haskell
code/Data/Tuple/Extensions.hs
mit
third4 (a, b, c, d) = c
23
third4 (a, b, c, d) = c
23
third4 (a, b, c, d) = c
23
false
false
0
5
6
22
12
10
null
null
GaloisInc/halvm-ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
55
gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
55
gHC_TOP_HANDLER = mkBaseModule (fsLit "GHC.TopHandler")
55
false
false
1
7
4
18
7
11
null
null
merijn/GPU-benchmarks
evolve/Client.hs
gpl-3.0
worker :: Input Task -> Output Reply -> SafeT IO () worker tasks results = runEffect $ fromInput tasks >-> processPipe >-> toOutput results where processPipe = P.mapM $ \(Task i (exe:args)) -> do withProcess (proc exe args) $ \case Left (SomeException e) -> return . Result i . Failed $ displayException e Right s -> return . Result i $ Success s
388
worker :: Input Task -> Output Reply -> SafeT IO () worker tasks results = runEffect $ fromInput tasks >-> processPipe >-> toOutput results where processPipe = P.mapM $ \(Task i (exe:args)) -> do withProcess (proc exe args) $ \case Left (SomeException e) -> return . Result i . Failed $ displayException e Right s -> return . Result i $ Success s
388
worker tasks results = runEffect $ fromInput tasks >-> processPipe >-> toOutput results where processPipe = P.mapM $ \(Task i (exe:args)) -> do withProcess (proc exe args) $ \case Left (SomeException e) -> return . Result i . Failed $ displayException e Right s -> return . Result i $ Success s
336
false
true
0
16
104
165
77
88
null
null
kim/amazonka
amazonka-codedeploy/gen/Network/AWS/CodeDeploy/DeleteApplication.hs
mpl-2.0
-- | 'DeleteApplication' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'daApplicationName' @::@ 'Text' -- deleteApplication :: Text -- ^ 'daApplicationName' -> DeleteApplication deleteApplication p1 = DeleteApplication { _daApplicationName = p1 }
309
deleteApplication :: Text -- ^ 'daApplicationName' -> DeleteApplication deleteApplication p1 = DeleteApplication { _daApplicationName = p1 }
166
deleteApplication p1 = DeleteApplication { _daApplicationName = p1 }
76
true
true
0
6
62
33
21
12
null
null
ancientlanguage/haskell-analysis
grammar/src/Grammar/Common/Decompose.hs
mit
decomposeChar '\x0207' = "\x0065\x0311"
39
decomposeChar '\x0207' = "\x0065\x0311"
39
decomposeChar '\x0207' = "\x0065\x0311"
39
false
false
0
5
3
9
4
5
null
null
JonathanReeve/JonathanReeve.github.io
src/RSS.hs
gpl-2.0
elementToDoc :: XML.Element -> Maybe C.Document elementToDoc el = either (const Nothing) Just $ fromXMLDocument $ XML.Document (Prologue [] Nothing []) el []
159
elementToDoc :: XML.Element -> Maybe C.Document elementToDoc el = either (const Nothing) Just $ fromXMLDocument $ XML.Document (Prologue [] Nothing []) el []
159
elementToDoc el = either (const Nothing) Just $ fromXMLDocument $ XML.Document (Prologue [] Nothing []) el []
111
false
true
0
9
24
69
33
36
null
null
frontrowed/stratosphere
library-gen/Stratosphere/Resources/ServiceCatalogLaunchTemplateConstraint.hs
mit
-- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicecatalog-launchtemplateconstraint.html#cfn-servicecatalog-launchtemplateconstraint-rules scltcRules :: Lens' ServiceCatalogLaunchTemplateConstraint (Val Text) scltcRules = lens _serviceCatalogLaunchTemplateConstraintRules (\s a -> s { _serviceCatalogLaunchTemplateConstraintRules = a })
372
scltcRules :: Lens' ServiceCatalogLaunchTemplateConstraint (Val Text) scltcRules = lens _serviceCatalogLaunchTemplateConstraintRules (\s a -> s { _serviceCatalogLaunchTemplateConstraintRules = a })
197
scltcRules = lens _serviceCatalogLaunchTemplateConstraintRules (\s a -> s { _serviceCatalogLaunchTemplateConstraintRules = a })
127
true
true
0
9
21
46
25
21
null
null
eriksvedang/Carp
src/Types.hs
mpl-2.0
tyToCManglePtr _ (FuncTy argTys retTy) = "Fn__" ++ joinWithUnderscore (map (tyToCManglePtr True) argTys) ++ "_" ++ tyToCManglePtr True retTy
140
tyToCManglePtr _ (FuncTy argTys retTy) = "Fn__" ++ joinWithUnderscore (map (tyToCManglePtr True) argTys) ++ "_" ++ tyToCManglePtr True retTy
140
tyToCManglePtr _ (FuncTy argTys retTy) = "Fn__" ++ joinWithUnderscore (map (tyToCManglePtr True) argTys) ++ "_" ++ tyToCManglePtr True retTy
140
false
false
1
12
18
55
25
30
null
null
conal/hermit
src/HERMIT/Dictionary/Local/Let.hs
bsd-2-clause
letFloatExprR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, BoundVars c, MonadCatch m, MonadUnique m) => Rewrite c m CoreExpr letFloatExprR = setFailMsg "Unsuitable expression for Let floating." $ letFloatArgR <+ letFloatAppR <+ letFloatLetR <+ letFloatLamR <+ letFloatCaseR <+ letFloatCaseAltR Nothing <+ letFloatCastR
376
letFloatExprR :: (ExtendPath c Crumb, ReadPath c Crumb, AddBindings c, BoundVars c, MonadCatch m, MonadUnique m) => Rewrite c m CoreExpr letFloatExprR = setFailMsg "Unsuitable expression for Let floating." $ letFloatArgR <+ letFloatAppR <+ letFloatLetR <+ letFloatLamR <+ letFloatCaseR <+ letFloatCaseAltR Nothing <+ letFloatCastR
376
letFloatExprR = setFailMsg "Unsuitable expression for Let floating." $ letFloatArgR <+ letFloatAppR <+ letFloatLetR <+ letFloatLamR <+ letFloatCaseR <+ letFloatCaseAltR Nothing <+ letFloatCastR
225
false
true
0
12
89
95
47
48
null
null
woffs/haskell-amqp-utils
Network/AMQP/Utils/Options.hs
gpl-3.0
longname 'p' = "plane"
22
longname 'p' = "plane"
22
longname 'p' = "plane"
22
false
false
1
5
3
13
4
9
null
null
damianfral/clay
src/Clay/Render.hs
bsd-3-clause
-- | Configuration to print to a pretty human readable CSS output. pretty :: Config pretty = Config { indentation = " " , newline = "\n" , sep = " " , finalSemicolon = True , warn = True , align = True , banner = True }
285
pretty :: Config pretty = Config { indentation = " " , newline = "\n" , sep = " " , finalSemicolon = True , warn = True , align = True , banner = True }
217
pretty = Config { indentation = " " , newline = "\n" , sep = " " , finalSemicolon = True , warn = True , align = True , banner = True }
200
true
true
0
7
114
66
38
28
null
null
DaMSL/K3
src/Language/K3/Interpreter/Builtins.hs
apache-2.0
genBuiltin "registerSocketDataTrigger" _ = registerNotifier "data"
68
genBuiltin "registerSocketDataTrigger" _ = registerNotifier "data"
68
genBuiltin "registerSocketDataTrigger" _ = registerNotifier "data"
68
false
false
0
5
7
14
6
8
null
null
edofic/core.js
src/Immediate/Desugar.hs
mit
desugarTypeDefinition (C.Data _ _ cdefs) = Data $ fmap mkCons cdefs where mkCons (C.Constr name _ args) = Constructor (renderName name) (length args)
152
desugarTypeDefinition (C.Data _ _ cdefs) = Data $ fmap mkCons cdefs where mkCons (C.Constr name _ args) = Constructor (renderName name) (length args)
152
desugarTypeDefinition (C.Data _ _ cdefs) = Data $ fmap mkCons cdefs where mkCons (C.Constr name _ args) = Constructor (renderName name) (length args)
152
false
false
0
10
25
69
33
36
null
null
nevrenato/Hets_Fork
Maude/Maude2DG.hs
gpl-2.0
applyRenamingTerm sm (Const q s) = Const q s' where s' = applyRenamingType sm s
88
applyRenamingTerm sm (Const q s) = Const q s' where s' = applyRenamingType sm s
88
applyRenamingTerm sm (Const q s) = Const q s' where s' = applyRenamingType sm s
88
false
false
1
6
23
42
17
25
null
null
robx/puzzle-draw
src/Draw/PuzzleTypes.hs
mit
buchstabensalat :: Backend' b => Drawers b (OutsideClues C (Maybe Char), String) (Grid C (Maybe Char)) buchstabensalat = Drawers (p <> n) (p . fst <> placeGrid . fmap char . clues . snd) where p = (placeOutside . fmap (fmap char) <> grid gDefault . Data.outsideGrid) . fst n (ocs, ls) = placeNoteTR (Data.outsideSize ocs) (text' ls # scale noteScale)
380
buchstabensalat :: Backend' b => Drawers b (OutsideClues C (Maybe Char), String) (Grid C (Maybe Char)) buchstabensalat = Drawers (p <> n) (p . fst <> placeGrid . fmap char . clues . snd) where p = (placeOutside . fmap (fmap char) <> grid gDefault . Data.outsideGrid) . fst n (ocs, ls) = placeNoteTR (Data.outsideSize ocs) (text' ls # scale noteScale)
380
buchstabensalat = Drawers (p <> n) (p . fst <> placeGrid . fmap char . clues . snd) where p = (placeOutside . fmap (fmap char) <> grid gDefault . Data.outsideGrid) . fst n (ocs, ls) = placeNoteTR (Data.outsideSize ocs) (text' ls # scale noteScale)
273
false
true
0
12
90
176
87
89
null
null
facebookincubator/duckling
Duckling/AmountOfMoney/ID/Rules.hs
bsd-3-clause
ruleIntersect :: Rule ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isWithoutCents , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
344
ruleIntersect :: Rule ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isWithoutCents , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
344
ruleIntersect = Rule { name = "intersect" , pattern = [ Predicate isWithoutCents , Predicate isNatural ] , prod = \tokens -> case tokens of (Token AmountOfMoney fd: Token Numeral NumeralData{TNumeral.value = c}: _) -> Just . Token AmountOfMoney $ withCents c fd _ -> Nothing }
322
false
true
0
18
95
122
61
61
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
inimically = id
15
inimically = id
15
inimically = id
15
false
false
0
4
2
6
3
3
null
null
conal/shady-tv
src/Shady/RunUI.hs
agpl-3.0
runUI :: Compile src obj => MeshSize -> EyePos -> Out obj -> src -> Action runUI size eye out src = runOutIO "Shady" out (compile src size eye)
145
runUI :: Compile src obj => MeshSize -> EyePos -> Out obj -> src -> Action runUI size eye out src = runOutIO "Shady" out (compile src size eye)
145
runUI size eye out src = runOutIO "Shady" out (compile src size eye)
70
false
true
0
9
30
65
31
34
null
null
craffit/flexdb
src/DB/Flex/Query/Typed.hs
bsd-3-clause
con :: Convertible a SqlValue => a -> ConstantExpr l a con = constant
69
con :: Convertible a SqlValue => a -> ConstantExpr l a con = constant
69
con = constant
14
false
true
0
8
13
35
15
20
null
null
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/tests/builder/Data/ByteString/Builder/Tests.hs
mit
buildAction (W8 w) = lift $ putBuilder $ word8 w
65
buildAction (W8 w) = lift $ putBuilder $ word8 w
65
buildAction (W8 w) = lift $ putBuilder $ word8 w
65
false
false
0
7
26
26
12
14
null
null
nushio3/formura
src/Formura/Utilities.hs
mit
superCopy :: FilePath -> FilePath -> IO () superCopy src dest = do let isUrl = or [x `isPrefixOf` src | x <- ["http://", "https://", "ftp://"]] go :: (String -> IO ()) -> IO () go k | isUrl = withSystemTempFile "tmp" $ \fn h -> do hClose h cmd $ "wget " ++ src ++ " -O " ++ fn k fn | otherwise = k src go $ \fn -> do cmd $ unwords ["scp -r ", fn, dest] return ()
438
superCopy :: FilePath -> FilePath -> IO () superCopy src dest = do let isUrl = or [x `isPrefixOf` src | x <- ["http://", "https://", "ftp://"]] go :: (String -> IO ()) -> IO () go k | isUrl = withSystemTempFile "tmp" $ \fn h -> do hClose h cmd $ "wget " ++ src ++ " -O " ++ fn k fn | otherwise = k src go $ \fn -> do cmd $ unwords ["scp -r ", fn, dest] return ()
438
superCopy src dest = do let isUrl = or [x `isPrefixOf` src | x <- ["http://", "https://", "ftp://"]] go :: (String -> IO ()) -> IO () go k | isUrl = withSystemTempFile "tmp" $ \fn h -> do hClose h cmd $ "wget " ++ src ++ " -O " ++ fn k fn | otherwise = k src go $ \fn -> do cmd $ unwords ["scp -r ", fn, dest] return ()
395
false
true
0
18
158
203
98
105
null
null
mboes/vCard
Text/VCard/Query.hs
lgpl-3.0
filterWithProperty :: (VProperty -> Bool) -> [VCard] -> [VCard] filterWithProperty f = Prelude.filter (not . Map.null . (Map.filter (not . null . Prelude.filter f) . vcard_properties))
188
filterWithProperty :: (VProperty -> Bool) -> [VCard] -> [VCard] filterWithProperty f = Prelude.filter (not . Map.null . (Map.filter (not . null . Prelude.filter f) . vcard_properties))
188
filterWithProperty f = Prelude.filter (not . Map.null . (Map.filter (not . null . Prelude.filter f) . vcard_properties))
124
false
true
0
14
29
81
42
39
null
null
dorchard/camfort
src/Main.hs
apache-2.0
unitsOptions :: Parser UnitsOptions unitsOptions = fmap UnitsOptions readOptions <*> logOptions <*> literalsOption where literalsOption = option parseLiterals $ long "units-literals" <> short 'l' <> metavar "ID" <> completeWith ["Unitless", "Poly", "Mixed"] <> value LitMixed <> help "units-of-measure literals mode. ID = Unitless, Poly, or Mixed" parseLiterals = fmap read str
523
unitsOptions :: Parser UnitsOptions unitsOptions = fmap UnitsOptions readOptions <*> logOptions <*> literalsOption where literalsOption = option parseLiterals $ long "units-literals" <> short 'l' <> metavar "ID" <> completeWith ["Unitless", "Poly", "Mixed"] <> value LitMixed <> help "units-of-measure literals mode. ID = Unitless, Poly, or Mixed" parseLiterals = fmap read str
523
unitsOptions = fmap UnitsOptions readOptions <*> logOptions <*> literalsOption where literalsOption = option parseLiterals $ long "units-literals" <> short 'l' <> metavar "ID" <> completeWith ["Unitless", "Poly", "Mixed"] <> value LitMixed <> help "units-of-measure literals mode. ID = Unitless, Poly, or Mixed" parseLiterals = fmap read str
487
false
true
17
6
196
118
52
66
null
null
wxwxwwxxx/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- | Check whether to use unicode syntax for output useUnicodeSyntax :: DynFlags -> Bool useUnicodeSyntax = gopt Opt_PrintUnicodeSyntax
135
useUnicodeSyntax :: DynFlags -> Bool useUnicodeSyntax = gopt Opt_PrintUnicodeSyntax
83
useUnicodeSyntax = gopt Opt_PrintUnicodeSyntax
46
true
true
0
5
18
19
10
9
null
null
snoyberg/ghc
compiler/basicTypes/OccName.hs
bsd-3-clause
mkDataCOcc occ = chooseUniqueOcc VarName ("$c" ++ occNameString occ)
68
mkDataCOcc occ = chooseUniqueOcc VarName ("$c" ++ occNameString occ)
68
mkDataCOcc occ = chooseUniqueOcc VarName ("$c" ++ occNameString occ)
68
false
false
0
8
8
24
11
13
null
null
v0lkan/learning-haskell
session-005/001.back-to-the-future.hs
mit
numDigits :: Int numDigits = length (show reallyBig)
52
numDigits :: Int numDigits = length (show reallyBig)
52
numDigits = length (show reallyBig)
35
false
true
0
7
7
26
11
15
null
null
vincenthz/hs-foundation
basement/Basement/PrimType.hs
bsd-3-clause
primArrayIndex :: Array# ty -> Offset ty -> ty primArrayIndex a o@(Offset (I# ofs)) | aCheck a o = boundCheckError "array-index" o (aLength a) | otherwise = let !(# v #) = indexArray# a ofs in v
203
primArrayIndex :: Array# ty -> Offset ty -> ty primArrayIndex a o@(Offset (I# ofs)) | aCheck a o = boundCheckError "array-index" o (aLength a) | otherwise = let !(# v #) = indexArray# a ofs in v
203
primArrayIndex a o@(Offset (I# ofs)) | aCheck a o = boundCheckError "array-index" o (aLength a) | otherwise = let !(# v #) = indexArray# a ofs in v
156
false
true
0
11
45
98
44
54
null
null
buildsome/buildsome
src/BMake/User.hs
gpl-2.0
parse :: FilePath -> MT.Vars -> IO MT.Makefile parse makefilePath vars = do cache <- newIORef Map.empty ast <- newParse cache (FilePath.takeDirectory makefilePath) makefilePath interpret ast vars
204
parse :: FilePath -> MT.Vars -> IO MT.Makefile parse makefilePath vars = do cache <- newIORef Map.empty ast <- newParse cache (FilePath.takeDirectory makefilePath) makefilePath interpret ast vars
204
parse makefilePath vars = do cache <- newIORef Map.empty ast <- newParse cache (FilePath.takeDirectory makefilePath) makefilePath interpret ast vars
157
false
true
0
11
35
73
33
40
null
null
cmsaperstein/VEBTree
src/Data/VEBTree.hs
mit
successor a (VEBNode _ (Just val_min) _ _ _) | a < val_min = return val_min
76
successor a (VEBNode _ (Just val_min) _ _ _) | a < val_min = return val_min
76
successor a (VEBNode _ (Just val_min) _ _ _) | a < val_min = return val_min
76
false
false
0
9
16
44
20
24
null
null
rueshyna/gogol
gogol-apps-reseller/gen/Network/Google/Resource/Reseller/Customers/Update.hs
mpl-2.0
-- | Creates a value of 'CustomersUpdate' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'cuPayload' -- -- * 'cuCustomerId' customersUpdate :: Customer -- ^ 'cuPayload' -> Text -- ^ 'cuCustomerId' -> CustomersUpdate customersUpdate pCuPayload_ pCuCustomerId_ = CustomersUpdate' { _cuPayload = pCuPayload_ , _cuCustomerId = pCuCustomerId_ }
453
customersUpdate :: Customer -- ^ 'cuPayload' -> Text -- ^ 'cuCustomerId' -> CustomersUpdate customersUpdate pCuPayload_ pCuCustomerId_ = CustomersUpdate' { _cuPayload = pCuPayload_ , _cuCustomerId = pCuCustomerId_ }
243
customersUpdate pCuPayload_ pCuCustomerId_ = CustomersUpdate' { _cuPayload = pCuPayload_ , _cuCustomerId = pCuCustomerId_ }
139
true
true
0
6
92
47
30
17
null
null
TomMD/ghc
compiler/coreSyn/MkCore.hs
bsd-3-clause
-- | Makes a list @(:)@ for lists of the specified type mkConsExpr :: Type -> CoreExpr -> CoreExpr -> CoreExpr mkConsExpr ty hd tl = mkConApp consDataCon [Type ty, hd, tl]
171
mkConsExpr :: Type -> CoreExpr -> CoreExpr -> CoreExpr mkConsExpr ty hd tl = mkConApp consDataCon [Type ty, hd, tl]
115
mkConsExpr ty hd tl = mkConApp consDataCon [Type ty, hd, tl]
60
true
true
0
9
31
54
26
28
null
null
peterb12/nand2tetris
src/Haskell/HackAsm/src/HackCode.hs
bsd-3-clause
encodeComp DAndA = "0000000"
32
encodeComp DAndA = "0000000"
32
encodeComp DAndA = "0000000"
32
false
false
0
5
7
9
4
5
null
null
ChrisPenner/rasa
rasa-ext-views/src/Rasa/Ext/Views/Internal/LineNumbers.hs
gpl-3.0
lineNumbers :: App () lineNumbers = onEveryNewBuffer_ . addLeftBar $ do enabled <- checkLineNumbers if enabled then Just <$> getLineNumbers else return Nothing where getLineNumbers = do numLines <- Y.countNewLines <$> getText return . Y.unlines $ Y.fromString . show <$> [1.. numLines + 1]
321
lineNumbers :: App () lineNumbers = onEveryNewBuffer_ . addLeftBar $ do enabled <- checkLineNumbers if enabled then Just <$> getLineNumbers else return Nothing where getLineNumbers = do numLines <- Y.countNewLines <$> getText return . Y.unlines $ Y.fromString . show <$> [1.. numLines + 1]
321
lineNumbers = onEveryNewBuffer_ . addLeftBar $ do enabled <- checkLineNumbers if enabled then Just <$> getLineNumbers else return Nothing where getLineNumbers = do numLines <- Y.countNewLines <$> getText return . Y.unlines $ Y.fromString . show <$> [1.. numLines + 1]
299
false
true
0
11
75
102
50
52
null
null
nablaa/hirchess
src/UI.hs
gpl-2.0
printPiece :: Piece -> String printPiece (Piece color t) = case color of White -> [toUpper c] Black -> [toLower c] where (Just c) = lookup t pieceChars
217
printPiece :: Piece -> String printPiece (Piece color t) = case color of White -> [toUpper c] Black -> [toLower c] where (Just c) = lookup t pieceChars
217
printPiece (Piece color t) = case color of White -> [toUpper c] Black -> [toLower c] where (Just c) = lookup t pieceChars
187
false
true
0
9
93
79
37
42
null
null
sdiehl/ghc
compiler/simplCore/SetLevels.hs
bsd-3-clause
incMinorLvlFrom :: LevelEnv -> Level incMinorLvlFrom env = incMinorLvl (le_ctxt_lvl env)
88
incMinorLvlFrom :: LevelEnv -> Level incMinorLvlFrom env = incMinorLvl (le_ctxt_lvl env)
88
incMinorLvlFrom env = incMinorLvl (le_ctxt_lvl env)
51
false
true
0
7
10
27
13
14
null
null
jsavatgy/hatupist
code/result-tables-02.hs
gpl-2.0
commonPrefix _ _ = []
21
commonPrefix _ _ = []
21
commonPrefix _ _ = []
21
false
false
1
6
4
14
6
8
null
null
rahulmutt/ghcvm
compiler/Eta/Utils/Outputable.hs
bsd-3-clause
-- | Returns the separated concatenation of the pretty printed things. interppSP :: Outputable a => [a] -> SDoc interppSP xs = sep (map ppr xs)
145
interppSP :: Outputable a => [a] -> SDoc interppSP xs = sep (map ppr xs)
74
interppSP xs = sep (map ppr xs)
32
true
true
0
7
27
40
20
20
null
null
sapek/pandoc
src/Text/Pandoc/Parsing.hs
gpl-2.0
citeKey :: (Stream s m Char, HasLastStrPosition st) => ParserT s st m (Bool, String) citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- letter <|> char '_' let regchar = satisfy (\c -> isAlphaNum c || c == '_') let internal p = try $ p <* lookAhead regchar rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/") let key = firstChar:rest return (suppress_author, key)
470
citeKey :: (Stream s m Char, HasLastStrPosition st) => ParserT s st m (Bool, String) citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- letter <|> char '_' let regchar = satisfy (\c -> isAlphaNum c || c == '_') let internal p = try $ p <* lookAhead regchar rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/") let key = firstChar:rest return (suppress_author, key)
470
citeKey = try $ do guard =<< notAfterString suppress_author <- option False (char '-' *> return True) char '@' firstChar <- letter <|> char '_' let regchar = satisfy (\c -> isAlphaNum c || c == '_') let internal p = try $ p <* lookAhead regchar rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/") let key = firstChar:rest return (suppress_author, key)
377
false
true
0
17
103
210
97
113
null
null
gnn/Hets
Common/Doc.hs
gpl-2.0
anyRecord :: DocRecord a anyRecord = DocRecord { foldEmpty = error "anyRecord.Empty" , foldAnnoDoc = error "anyRecord.AnnoDoc" , foldIdDoc = error "anyRecord.IdDoc" , foldIdApplDoc = error "anyRecord.IdApplDoc" , foldText = error "anyRecord.Text" , foldCat = error "anyRecord.Cat" , foldAttr = error "anyRecord.Attr" , foldChangeGlobalAnnos = error "anyRecord.ChangeGlobalAnnos" }
416
anyRecord :: DocRecord a anyRecord = DocRecord { foldEmpty = error "anyRecord.Empty" , foldAnnoDoc = error "anyRecord.AnnoDoc" , foldIdDoc = error "anyRecord.IdDoc" , foldIdApplDoc = error "anyRecord.IdApplDoc" , foldText = error "anyRecord.Text" , foldCat = error "anyRecord.Cat" , foldAttr = error "anyRecord.Attr" , foldChangeGlobalAnnos = error "anyRecord.ChangeGlobalAnnos" }
416
anyRecord = DocRecord { foldEmpty = error "anyRecord.Empty" , foldAnnoDoc = error "anyRecord.AnnoDoc" , foldIdDoc = error "anyRecord.IdDoc" , foldIdApplDoc = error "anyRecord.IdApplDoc" , foldText = error "anyRecord.Text" , foldCat = error "anyRecord.Cat" , foldAttr = error "anyRecord.Attr" , foldChangeGlobalAnnos = error "anyRecord.ChangeGlobalAnnos" }
391
false
true
0
8
83
97
50
47
null
null
rkoeninger/GameCom
src/lib/CPU.hs
mit
irq = ifs irqFlag id (interrupt breakVector)
44
irq = ifs irqFlag id (interrupt breakVector)
44
irq = ifs irqFlag id (interrupt breakVector)
44
false
false
1
7
6
22
9
13
null
null
kovach/tm
src/Log2.hs
mit
interleave1 = (++)
18
interleave1 = (++)
18
interleave1 = (++)
18
false
false
0
4
2
8
5
3
null
null
diku-dk/futhark
src/Futhark/Builder/Class.hs
isc
attributing :: MonadBuilder m => Attrs -> m a -> m a attributing attrs = censorStms $ fmap onStm where onStm (Let pat aux e) = Let pat aux {stmAuxAttrs = attrs <> stmAuxAttrs aux} e -- | Add the certificates and attributes to any statements added by -- this action.
278
attributing :: MonadBuilder m => Attrs -> m a -> m a attributing attrs = censorStms $ fmap onStm where onStm (Let pat aux e) = Let pat aux {stmAuxAttrs = attrs <> stmAuxAttrs aux} e -- | Add the certificates and attributes to any statements added by -- this action.
278
attributing attrs = censorStms $ fmap onStm where onStm (Let pat aux e) = Let pat aux {stmAuxAttrs = attrs <> stmAuxAttrs aux} e -- | Add the certificates and attributes to any statements added by -- this action.
225
false
true
0
9
63
93
43
50
null
null
Rufflewind/calico-hs
Calico/MonadIO.hs
mit
print' :: (MonadIO m, Show a) => a -> m () print' = liftIO . IO.print'
70
print' :: (MonadIO m, Show a) => a -> m () print' = liftIO . IO.print'
70
print' = liftIO . IO.print'
27
false
true
0
8
15
41
21
20
null
null
willprice/dotfiles-xmonad
lib/XmobarConfig.hs
mit
xmobarConfig :: PP xmobarConfig = defaultPP { ppCurrent = xmobarColor "white" darkGrey . wrapInPipes , ppTitle = xmobarColor lightBlue "" . shorten 120 , ppSep = " | " , ppHidden = xmobarColor lightBlue "" , ppVisible = xmobarColor lightPink "" . wrapInPipes , ppHiddenNoWindows = xmobarColor steelBlue "" }
504
xmobarConfig :: PP xmobarConfig = defaultPP { ppCurrent = xmobarColor "white" darkGrey . wrapInPipes , ppTitle = xmobarColor lightBlue "" . shorten 120 , ppSep = " | " , ppHidden = xmobarColor lightBlue "" , ppVisible = xmobarColor lightPink "" . wrapInPipes , ppHiddenNoWindows = xmobarColor steelBlue "" }
504
xmobarConfig = defaultPP { ppCurrent = xmobarColor "white" darkGrey . wrapInPipes , ppTitle = xmobarColor lightBlue "" . shorten 120 , ppSep = " | " , ppHidden = xmobarColor lightBlue "" , ppVisible = xmobarColor lightPink "" . wrapInPipes , ppHiddenNoWindows = xmobarColor steelBlue "" }
485
false
true
0
8
246
89
48
41
null
null
mcmaniac/ghc
ghc/Main.hs
bsd-3-clause
mkPreStartupMode :: PreStartupMode -> Mode mkPreStartupMode = Left
66
mkPreStartupMode :: PreStartupMode -> Mode mkPreStartupMode = Left
66
mkPreStartupMode = Left
23
false
true
0
7
7
22
9
13
null
null
haskell-distributed/distributed-process-platform
tests/TestRegistry.hs
bsd-3-clause
testMonitorName :: Registry String () -> Process () testMonitorName reg = do (sp, rp) <- newChan pid <- spawnLocal $ do void $ addName reg "proc.name.1" void $ addName reg "proc.name.2" sendChan sp () (expect :: Process ()) >>= return () <- receiveChan rp mRef <- Registry.monitorName reg "proc.name.2" send pid () res <- receiveTimeout (after 2 Seconds) [ matchIf (\(RegistryKeyMonitorNotification k ref _ _) -> k == "proc.name.2" && ref == mRef) (\(RegistryKeyMonitorNotification _ _ ev _) -> return ev) ] res `shouldBe` equalTo (Just (KeyOwnerDied DiedNormal))
633
testMonitorName :: Registry String () -> Process () testMonitorName reg = do (sp, rp) <- newChan pid <- spawnLocal $ do void $ addName reg "proc.name.1" void $ addName reg "proc.name.2" sendChan sp () (expect :: Process ()) >>= return () <- receiveChan rp mRef <- Registry.monitorName reg "proc.name.2" send pid () res <- receiveTimeout (after 2 Seconds) [ matchIf (\(RegistryKeyMonitorNotification k ref _ _) -> k == "proc.name.2" && ref == mRef) (\(RegistryKeyMonitorNotification _ _ ev _) -> return ev) ] res `shouldBe` equalTo (Just (KeyOwnerDied DiedNormal))
633
testMonitorName reg = do (sp, rp) <- newChan pid <- spawnLocal $ do void $ addName reg "proc.name.1" void $ addName reg "proc.name.2" sendChan sp () (expect :: Process ()) >>= return () <- receiveChan rp mRef <- Registry.monitorName reg "proc.name.2" send pid () res <- receiveTimeout (after 2 Seconds) [ matchIf (\(RegistryKeyMonitorNotification k ref _ _) -> k == "proc.name.2" && ref == mRef) (\(RegistryKeyMonitorNotification _ _ ev _) -> return ev) ] res `shouldBe` equalTo (Just (KeyOwnerDied DiedNormal))
581
false
true
0
15
157
249
118
131
null
null
krystalcode/bloodhound
tests/tests.hs
bsd-3-clause
testServer :: Server testServer = Server "http://localhost:9200"
66
testServer :: Server testServer = Server "http://localhost:9200"
66
testServer = Server "http://localhost:9200"
44
false
true
0
5
8
14
7
7
null
null
HuwCampbell/grenade
test/Test/Grenade/Layers/Internal/Reference.hs
bsd-2-clause
vid2col :: Int -> Int -> Int -> Int -> Int -> Int -> [Matrix Double] -> Matrix Double vid2col nrows ncols srows scols inputrows inputcols ms = let starts = fittingStarts inputrows nrows srows inputcols ncols scols subs = fmap (im2colFit starts nrows ncols) ms in foldl1 (|||) subs
293
vid2col :: Int -> Int -> Int -> Int -> Int -> Int -> [Matrix Double] -> Matrix Double vid2col nrows ncols srows scols inputrows inputcols ms = let starts = fittingStarts inputrows nrows srows inputcols ncols scols subs = fmap (im2colFit starts nrows ncols) ms in foldl1 (|||) subs
293
vid2col nrows ncols srows scols inputrows inputcols ms = let starts = fittingStarts inputrows nrows srows inputcols ncols scols subs = fmap (im2colFit starts nrows ncols) ms in foldl1 (|||) subs
207
false
true
0
14
62
120
57
63
null
null
acowley/ghc
compiler/prelude/PrimOp.hs
bsd-3-clause
mkCompare str ty = Compare (mkVarOccFS str) ty
46
mkCompare str ty = Compare (mkVarOccFS str) ty
46
mkCompare str ty = Compare (mkVarOccFS str) ty
46
false
false
0
7
7
23
10
13
null
null
scast/bigbrother
src/TypeChecking.hs
gpl-2.0
path Char = LCA.cons 2 Char (path Int32)
40
path Char = LCA.cons 2 Char (path Int32)
40
path Char = LCA.cons 2 Char (path Int32)
40
false
false
0
7
7
24
11
13
null
null
cpettitt/tamien
Tamien/GM/Eval.hs
mit
showNode :: GmState -> Addr -> Node -> Doc showNode s a (NNum n) = int n
77
showNode :: GmState -> Addr -> Node -> Doc showNode s a (NNum n) = int n
77
showNode s a (NNum n) = int n
34
false
true
0
7
21
39
19
20
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcType.hs
bsd-3-clause
isOverloadedTy (ForAllTy _ ty) = isOverloadedTy ty
50
isOverloadedTy (ForAllTy _ ty) = isOverloadedTy ty
50
isOverloadedTy (ForAllTy _ ty) = isOverloadedTy ty
50
false
false
0
6
6
21
9
12
null
null
IreneKnapp/larp-base-two
Haskell/Larpbase.hs
mit
help :: IO () help = do putStrLn "Usage: larpbase configuration.json"
71
help :: IO () help = do putStrLn "Usage: larpbase configuration.json"
71
help = do putStrLn "Usage: larpbase configuration.json"
57
false
true
0
8
12
28
11
17
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcType.hs
bsd-3-clause
tcFunResultTy :: Type -> Type tcFunResultTy ty = snd (tcSplitFunTy ty)
70
tcFunResultTy :: Type -> Type tcFunResultTy ty = snd (tcSplitFunTy ty)
70
tcFunResultTy ty = snd (tcSplitFunTy ty)
40
false
true
0
7
10
33
14
19
null
null
nushio3/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
zipIdKey = mkPreludeMiscIdUnique 33
56
zipIdKey = mkPreludeMiscIdUnique 33
56
zipIdKey = mkPreludeMiscIdUnique 33
56
false
false
0
5
24
9
4
5
null
null
AccelerateHS/accelerate-c
Data/Array/Accelerate/C/Exp.hs
bsd-3-clause
-- Generate code to compute the shape of an array. -- -- The array argument here can only be a variable, as arrays are lifted out of expressions in an earlier phase. -- -- The first element (always present) in an array valuation is the array's shape variable. -- shapeToC :: forall sh e aenv. (Shape sh, Elt e) => Env aenv -> OpenAcc aenv (Array sh e) -> [C.Exp] shapeToC aenv (OpenAcc (Avar idx)) = cshape (sizeTupleType . eltType $ (undefined::sh)) [cexp| * $id:(snd . head $ prjEnv idx aenv) |]
544
shapeToC :: forall sh e aenv. (Shape sh, Elt e) => Env aenv -> OpenAcc aenv (Array sh e) -> [C.Exp] shapeToC aenv (OpenAcc (Avar idx)) = cshape (sizeTupleType . eltType $ (undefined::sh)) [cexp| * $id:(snd . head $ prjEnv idx aenv) |]
281
shapeToC aenv (OpenAcc (Avar idx)) = cshape (sizeTupleType . eltType $ (undefined::sh)) [cexp| * $id:(snd . head $ prjEnv idx aenv) |]
181
true
true
0
11
138
111
63
48
null
null
lunaris/hindent
src/HIndent/Styles/Cramer.hs
bsd-3-clause
-- No line break after equal sign extFieldUpdate :: Extend FieldUpdate extFieldUpdate (FieldUpdate _ qname expr) = do pretty qname write " = " pretty expr
166
extFieldUpdate :: Extend FieldUpdate extFieldUpdate (FieldUpdate _ qname expr) = do pretty qname write " = " pretty expr
132
extFieldUpdate (FieldUpdate _ qname expr) = do pretty qname write " = " pretty expr
95
true
true
0
7
37
46
20
26
null
null
mcschroeder/ghc
compiler/prelude/THNames.hs
bsd-3-clause
quoteDecKey = mkPreludeMiscIdUnique 472
40
quoteDecKey = mkPreludeMiscIdUnique 472
40
quoteDecKey = mkPreludeMiscIdUnique 472
40
false
false
0
5
4
9
4
5
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGPathElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathElement.createSVGPathSegCurvetoCubicAbs Mozilla SVGPathElement.createSVGPathSegCurvetoCubicAbs documentation> createSVGPathSegCurvetoCubicAbs :: (MonadDOM m) => SVGPathElement -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> m SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs self x y x1 y1 x2 y2 = liftDOM ((self ^. jsf "createSVGPathSegCurvetoCubicAbs" [toJSVal x, toJSVal y, toJSVal x1, toJSVal y1, toJSVal x2, toJSVal y2]) >>= fromJSValUnchecked)
916
createSVGPathSegCurvetoCubicAbs :: (MonadDOM m) => SVGPathElement -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> Maybe Float -> m SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs self x y x1 y1 x2 y2 = liftDOM ((self ^. jsf "createSVGPathSegCurvetoCubicAbs" [toJSVal x, toJSVal y, toJSVal x1, toJSVal y1, toJSVal x2, toJSVal y2]) >>= fromJSValUnchecked)
743
createSVGPathSegCurvetoCubicAbs self x y x1 y1 x2 y2 = liftDOM ((self ^. jsf "createSVGPathSegCurvetoCubicAbs" [toJSVal x, toJSVal y, toJSVal x1, toJSVal y1, toJSVal x2, toJSVal y2]) >>= fromJSValUnchecked)
244
true
true
0
13
411
143
69
74
null
null
NicolaiNebel/Bachelor-Poc
test/StrategyTest.hs
bsd-3-clause
pChoose :: (String,Kernel) -> IO () pChoose (s, program) = do putStrLn s let strat = chooseStrategy program let strats = makeStrategy (makeAccesses program) putStrLn (show strat) prettyAccesses strats putStrLn "" --pGenerate :: Kernel -> IO () --pGenerate program = do -- let as = makeAccesses program -- prettyGenerate as -- putStrLn ""
353
pChoose :: (String,Kernel) -> IO () pChoose (s, program) = do putStrLn s let strat = chooseStrategy program let strats = makeStrategy (makeAccesses program) putStrLn (show strat) prettyAccesses strats putStrLn "" --pGenerate :: Kernel -> IO () --pGenerate program = do -- let as = makeAccesses program -- prettyGenerate as -- putStrLn ""
353
pChoose (s, program) = do putStrLn s let strat = chooseStrategy program let strats = makeStrategy (makeAccesses program) putStrLn (show strat) prettyAccesses strats putStrLn "" --pGenerate :: Kernel -> IO () --pGenerate program = do -- let as = makeAccesses program -- prettyGenerate as -- putStrLn ""
317
false
true
0
12
68
104
49
55
null
null
fjarri/wigner
examples/master_equation.hs
bsd-3-clause
loss_terms = gamma1 1 * lossTerm (a 1) + gamma1 1 * lossTerm (b 1) + gamma2 1 2 * lossTerm (a 1 * a 2) + gamma2 1 2 * lossTerm (b 1 * b 2) + gamma2 2 2 * lossTerm (a 2 * a 2) + gamma2 2 2 * lossTerm (b 2 * b 2)
234
loss_terms = gamma1 1 * lossTerm (a 1) + gamma1 1 * lossTerm (b 1) + gamma2 1 2 * lossTerm (a 1 * a 2) + gamma2 1 2 * lossTerm (b 1 * b 2) + gamma2 2 2 * lossTerm (a 2 * a 2) + gamma2 2 2 * lossTerm (b 2 * b 2)
234
loss_terms = gamma1 1 * lossTerm (a 1) + gamma1 1 * lossTerm (b 1) + gamma2 1 2 * lossTerm (a 1 * a 2) + gamma2 1 2 * lossTerm (b 1 * b 2) + gamma2 2 2 * lossTerm (a 2 * a 2) + gamma2 2 2 * lossTerm (b 2 * b 2)
234
false
false
0
18
82
158
71
87
null
null
kirstin-rhys/nestedmap
test/Data/Nested/TreeSpec.hs
bsd-3-clause
prop_null_empty ∷ Int β†’ Bool prop_null_empty v = null (empty v) ≑ True
70
prop_null_empty ∷ Int β†’ Bool prop_null_empty v = null (empty v) ≑ True
70
prop_null_empty v = null (empty v) ≑ True
41
false
true
0
8
12
31
15
16
null
null
DavidAlphaFox/ghc
utils/haddock/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Internal.hs
bsd-3-clause
-- | Like 'scan', but generalized to return the final state of the -- scanner. runScanner :: s -> (s -> Word8 -> Maybe s) -> Parser (ByteString, s) runScanner = scan_ $ \s xs -> return (B.concat (reverse xs), s)
211
runScanner :: s -> (s -> Word8 -> Maybe s) -> Parser (ByteString, s) runScanner = scan_ $ \s xs -> return (B.concat (reverse xs), s)
132
runScanner = scan_ $ \s xs -> return (B.concat (reverse xs), s)
63
true
true
0
11
40
80
41
39
null
null
tibbe/ghc
compiler/cmm/CmmSink.hs
bsd-3-clause
okToInline :: DynFlags -> CmmExpr -> CmmNode e x -> Bool okToInline dflags expr node@(CmmUnsafeForeignCall{}) = not (globalRegistersConflict dflags expr node)
162
okToInline :: DynFlags -> CmmExpr -> CmmNode e x -> Bool okToInline dflags expr node@(CmmUnsafeForeignCall{}) = not (globalRegistersConflict dflags expr node)
162
okToInline dflags expr node@(CmmUnsafeForeignCall{}) = not (globalRegistersConflict dflags expr node)
105
false
true
0
8
24
58
29
29
null
null
diku-kmc/repg
src/KMC/SymbolicFST.hs
mit
runBacktracking :: (Monoid m, Function func, SetLike pred (Dom func), Stream s (Dom func)) => (Rng func -> m) -> FST Int pred func -> P s m runBacktracking phi fst' = lfp!(fstI fst') <* eof where lfp = M.fromList [ (q, go q) | q <- S.toList $ fstS fst' ] go q = (if isJoinState fst' q then barrier q else pure ()) *> case fstEvalEpsilonEdges fst' q of [] -> case fstEdges fst' q of [] -> pure mempty es -> consume es -- TODO: Only insert fBarrier if q is on an epsilon-loop es -> fBarrier q *> choose es consume es = foldl1 (<|>) [ (mappend . phi . eval func <$> litp (flip member p)) <*> (lfp!q') | (p, func, q') <- es ] choose [] = empty choose es = foldl1 (<|>) [ mappend (phi y) <$> (lfp!q') | (y, q') <- es ] {- -- | Example: This is how to interpret an action FST interpAction :: (Function func ,SetLike pred Word8 ,Dom func ~ Word8 ,Rng func ~ [Either Word8 RegAction]) => FST Int pred func -> ByteString -> Maybe Action interpAction fst' b = runP' (runBacktracking (mconcat . map adjActionSem) fst') (0::Int, b) -}
1,240
runBacktracking :: (Monoid m, Function func, SetLike pred (Dom func), Stream s (Dom func)) => (Rng func -> m) -> FST Int pred func -> P s m runBacktracking phi fst' = lfp!(fstI fst') <* eof where lfp = M.fromList [ (q, go q) | q <- S.toList $ fstS fst' ] go q = (if isJoinState fst' q then barrier q else pure ()) *> case fstEvalEpsilonEdges fst' q of [] -> case fstEdges fst' q of [] -> pure mempty es -> consume es -- TODO: Only insert fBarrier if q is on an epsilon-loop es -> fBarrier q *> choose es consume es = foldl1 (<|>) [ (mappend . phi . eval func <$> litp (flip member p)) <*> (lfp!q') | (p, func, q') <- es ] choose [] = empty choose es = foldl1 (<|>) [ mappend (phi y) <$> (lfp!q') | (y, q') <- es ] {- -- | Example: This is how to interpret an action FST interpAction :: (Function func ,SetLike pred Word8 ,Dom func ~ Word8 ,Rng func ~ [Either Word8 RegAction]) => FST Int pred func -> ByteString -> Maybe Action interpAction fst' b = runP' (runBacktracking (mconcat . map adjActionSem) fst') (0::Int, b) -}
1,240
runBacktracking phi fst' = lfp!(fstI fst') <* eof where lfp = M.fromList [ (q, go q) | q <- S.toList $ fstS fst' ] go q = (if isJoinState fst' q then barrier q else pure ()) *> case fstEvalEpsilonEdges fst' q of [] -> case fstEdges fst' q of [] -> pure mempty es -> consume es -- TODO: Only insert fBarrier if q is on an epsilon-loop es -> fBarrier q *> choose es consume es = foldl1 (<|>) [ (mappend . phi . eval func <$> litp (flip member p)) <*> (lfp!q') | (p, func, q') <- es ] choose [] = empty choose es = foldl1 (<|>) [ mappend (phi y) <$> (lfp!q') | (y, q') <- es ] {- -- | Example: This is how to interpret an action FST interpAction :: (Function func ,SetLike pred Word8 ,Dom func ~ Word8 ,Rng func ~ [Either Word8 RegAction]) => FST Int pred func -> ByteString -> Maybe Action interpAction fst' b = runP' (runBacktracking (mconcat . map adjActionSem) fst') (0::Int, b) -}
1,079
false
true
0
14
421
381
193
188
null
null
expipiplus1/vulkan
src/Vulkan/Core10/ExtensionDiscovery.hs
bsd-3-clause
-- | vkEnumerateInstanceExtensionProperties - Returns up to requested number -- of global extension properties -- -- = Description -- -- When @pLayerName@ parameter is @NULL@, only extensions provided by the -- Vulkan implementation or by implicitly enabled layers are returned. When -- @pLayerName@ is the name of a layer, the instance extensions provided by -- that layer are returned. -- -- If @pProperties@ is @NULL@, then the number of extensions properties -- available is returned in @pPropertyCount@. Otherwise, @pPropertyCount@ -- /must/ point to a variable set by the user to the number of elements in -- the @pProperties@ array, and on return the variable is overwritten with -- the number of structures actually written to @pProperties@. If -- @pPropertyCount@ is less than the number of extension properties -- available, at most @pPropertyCount@ structures will be written, and -- 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned instead of -- 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not all the -- available properties were returned. -- -- Because the list of available layers may change externally between calls -- to 'enumerateInstanceExtensionProperties', two calls may retrieve -- different results if a @pLayerName@ is available in one call but not in -- another. The extensions supported by a layer may also change between two -- calls, e.g. if the layer implementation is replaced by a different -- version between those calls. -- -- Implementations /must/ not advertise any pair of extensions that cannot -- be enabled together due to behavioral differences, or any extension that -- cannot be enabled against the advertised version. -- -- == Valid Usage (Implicit) -- -- - #VUID-vkEnumerateInstanceExtensionProperties-pLayerName-parameter# -- If @pLayerName@ is not @NULL@, @pLayerName@ /must/ be a -- null-terminated UTF-8 string -- -- - #VUID-vkEnumerateInstanceExtensionProperties-pPropertyCount-parameter# -- @pPropertyCount@ /must/ be a valid pointer to a @uint32_t@ value -- -- - #VUID-vkEnumerateInstanceExtensionProperties-pProperties-parameter# -- If the value referenced by @pPropertyCount@ is not @0@, and -- @pProperties@ is not @NULL@, @pProperties@ /must/ be a valid pointer -- to an array of @pPropertyCount@ 'ExtensionProperties' structures -- -- == Return Codes -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>] -- -- - 'Vulkan.Core10.Enums.Result.SUCCESS' -- -- - 'Vulkan.Core10.Enums.Result.INCOMPLETE' -- -- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>] -- -- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY' -- -- - 'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY' -- -- - 'Vulkan.Core10.Enums.Result.ERROR_LAYER_NOT_PRESENT' -- -- = See Also -- -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_0 VK_VERSION_1_0>, -- 'ExtensionProperties' enumerateInstanceExtensionProperties :: forall io . (MonadIO io) => -- | @pLayerName@ is either @NULL@ or a pointer to a null-terminated UTF-8 -- string naming the layer to retrieve extensions from. ("layerName" ::: Maybe ByteString) -> io (Result, ("properties" ::: Vector ExtensionProperties)) enumerateInstanceExtensionProperties layerName = liftIO . evalContT $ do vkEnumerateInstanceExtensionPropertiesPtr <- lift $ castFunPtr @_ @(("pLayerName" ::: Ptr CChar) -> ("pPropertyCount" ::: Ptr Word32) -> ("pProperties" ::: Ptr ExtensionProperties) -> IO Result) <$> getInstanceProcAddr' nullPtr (Ptr "vkEnumerateInstanceExtensionProperties"#) lift $ unless (vkEnumerateInstanceExtensionPropertiesPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkEnumerateInstanceExtensionProperties is null" Nothing Nothing let vkEnumerateInstanceExtensionProperties' = mkVkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionPropertiesPtr pLayerName <- case (layerName) of Nothing -> pure nullPtr Just j -> ContT $ useAsCString (j) pPPropertyCount <- ContT $ bracket (callocBytes @Word32 4) free r <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) (nullPtr)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pPropertyCount <- lift $ peek @Word32 pPPropertyCount pPProperties <- ContT $ bracket (callocBytes @ExtensionProperties ((fromIntegral (pPropertyCount)) * 260)) free _ <- traverse (\i -> ContT $ pokeZeroCStruct (pPProperties `advancePtrBytes` (i * 260) :: Ptr ExtensionProperties) . ($ ())) [0..(fromIntegral (pPropertyCount)) - 1] r' <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) ((pPProperties))) lift $ when (r' < SUCCESS) (throwIO (VulkanException r')) pPropertyCount' <- lift $ peek @Word32 pPPropertyCount pProperties' <- lift $ generateM (fromIntegral (pPropertyCount')) (\i -> peekCStruct @ExtensionProperties (((pPProperties) `advancePtrBytes` (260 * (i)) :: Ptr ExtensionProperties))) pure $ ((r'), pProperties')
5,462
enumerateInstanceExtensionProperties :: forall io . (MonadIO io) => -- | @pLayerName@ is either @NULL@ or a pointer to a null-terminated UTF-8 -- string naming the layer to retrieve extensions from. ("layerName" ::: Maybe ByteString) -> io (Result, ("properties" ::: Vector ExtensionProperties)) enumerateInstanceExtensionProperties layerName = liftIO . evalContT $ do vkEnumerateInstanceExtensionPropertiesPtr <- lift $ castFunPtr @_ @(("pLayerName" ::: Ptr CChar) -> ("pPropertyCount" ::: Ptr Word32) -> ("pProperties" ::: Ptr ExtensionProperties) -> IO Result) <$> getInstanceProcAddr' nullPtr (Ptr "vkEnumerateInstanceExtensionProperties"#) lift $ unless (vkEnumerateInstanceExtensionPropertiesPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkEnumerateInstanceExtensionProperties is null" Nothing Nothing let vkEnumerateInstanceExtensionProperties' = mkVkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionPropertiesPtr pLayerName <- case (layerName) of Nothing -> pure nullPtr Just j -> ContT $ useAsCString (j) pPPropertyCount <- ContT $ bracket (callocBytes @Word32 4) free r <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) (nullPtr)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pPropertyCount <- lift $ peek @Word32 pPPropertyCount pPProperties <- ContT $ bracket (callocBytes @ExtensionProperties ((fromIntegral (pPropertyCount)) * 260)) free _ <- traverse (\i -> ContT $ pokeZeroCStruct (pPProperties `advancePtrBytes` (i * 260) :: Ptr ExtensionProperties) . ($ ())) [0..(fromIntegral (pPropertyCount)) - 1] r' <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) ((pPProperties))) lift $ when (r' < SUCCESS) (throwIO (VulkanException r')) pPropertyCount' <- lift $ peek @Word32 pPPropertyCount pProperties' <- lift $ generateM (fromIntegral (pPropertyCount')) (\i -> peekCStruct @ExtensionProperties (((pPProperties) `advancePtrBytes` (260 * (i)) :: Ptr ExtensionProperties))) pure $ ((r'), pProperties')
2,395
enumerateInstanceExtensionProperties layerName = liftIO . evalContT $ do vkEnumerateInstanceExtensionPropertiesPtr <- lift $ castFunPtr @_ @(("pLayerName" ::: Ptr CChar) -> ("pPropertyCount" ::: Ptr Word32) -> ("pProperties" ::: Ptr ExtensionProperties) -> IO Result) <$> getInstanceProcAddr' nullPtr (Ptr "vkEnumerateInstanceExtensionProperties"#) lift $ unless (vkEnumerateInstanceExtensionPropertiesPtr /= nullFunPtr) $ throwIO $ IOError Nothing InvalidArgument "" "The function pointer for vkEnumerateInstanceExtensionProperties is null" Nothing Nothing let vkEnumerateInstanceExtensionProperties' = mkVkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionPropertiesPtr pLayerName <- case (layerName) of Nothing -> pure nullPtr Just j -> ContT $ useAsCString (j) pPPropertyCount <- ContT $ bracket (callocBytes @Word32 4) free r <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) (nullPtr)) lift $ when (r < SUCCESS) (throwIO (VulkanException r)) pPropertyCount <- lift $ peek @Word32 pPPropertyCount pPProperties <- ContT $ bracket (callocBytes @ExtensionProperties ((fromIntegral (pPropertyCount)) * 260)) free _ <- traverse (\i -> ContT $ pokeZeroCStruct (pPProperties `advancePtrBytes` (i * 260) :: Ptr ExtensionProperties) . ($ ())) [0..(fromIntegral (pPropertyCount)) - 1] r' <- lift $ traceAroundEvent "vkEnumerateInstanceExtensionProperties" (vkEnumerateInstanceExtensionProperties' pLayerName (pPPropertyCount) ((pPProperties))) lift $ when (r' < SUCCESS) (throwIO (VulkanException r')) pPropertyCount' <- lift $ peek @Word32 pPPropertyCount pProperties' <- lift $ generateM (fromIntegral (pPropertyCount')) (\i -> peekCStruct @ExtensionProperties (((pPProperties) `advancePtrBytes` (260 * (i)) :: Ptr ExtensionProperties))) pure $ ((r'), pProperties')
1,907
true
true
0
19
902
709
390
319
null
null
hvr/cassava
tests/UnitTests.hs
bsd-3-clause
roundTripUnicode :: T.Text -> Assertion roundTripUnicode x = Right (V.fromList record) @=? decode NoHeader (encode record) where record = [(x, dummy)] dummy = 'a'
193
roundTripUnicode :: T.Text -> Assertion roundTripUnicode x = Right (V.fromList record) @=? decode NoHeader (encode record) where record = [(x, dummy)] dummy = 'a'
193
roundTripUnicode x = Right (V.fromList record) @=? decode NoHeader (encode record) where record = [(x, dummy)] dummy = 'a'
153
false
true
1
9
54
70
35
35
null
null
ducis/haAni
hs/common/Graphics/Rendering/OpenGL/GL/Texturing/Environments.hs
gpl-2.0
textureFunction :: StateVar TextureFunction textureFunction = texEnvi unmarshalTextureFunction marshalTextureFunction TextureEnv TexEnvParamTextureEnvMode
157
textureFunction :: StateVar TextureFunction textureFunction = texEnvi unmarshalTextureFunction marshalTextureFunction TextureEnv TexEnvParamTextureEnvMode
157
textureFunction = texEnvi unmarshalTextureFunction marshalTextureFunction TextureEnv TexEnvParamTextureEnvMode
113
false
true
1
5
13
27
11
16
null
null
romanb/amazonka
amazonka-ec2/gen/Network/AWS/EC2/DescribeVolumeAttribute.hs
mpl-2.0
-- | 'DescribeVolumeAttributeResponse' constructor. -- -- The fields accessible through corresponding lenses are: -- -- * 'dvarAutoEnableIO' @::@ 'Maybe' 'AttributeBooleanValue' -- -- * 'dvarProductCodes' @::@ ['ProductCode'] -- -- * 'dvarVolumeId' @::@ 'Maybe' 'Text' -- describeVolumeAttributeResponse :: DescribeVolumeAttributeResponse describeVolumeAttributeResponse = DescribeVolumeAttributeResponse { _dvarVolumeId = Nothing , _dvarAutoEnableIO = Nothing , _dvarProductCodes = mempty }
511
describeVolumeAttributeResponse :: DescribeVolumeAttributeResponse describeVolumeAttributeResponse = DescribeVolumeAttributeResponse { _dvarVolumeId = Nothing , _dvarAutoEnableIO = Nothing , _dvarProductCodes = mempty }
239
describeVolumeAttributeResponse = DescribeVolumeAttributeResponse { _dvarVolumeId = Nothing , _dvarAutoEnableIO = Nothing , _dvarProductCodes = mempty }
172
true
true
0
7
72
45
30
15
null
null
isomorphism/evangelist
Data/Convert/Evangelist/Newtype.hs
bsd-3-clause
(./) :: (Newtype n o) => (o -> t) -> (n -> t) (./) fx = fx . unpack
67
(./) :: (Newtype n o) => (o -> t) -> (n -> t) (./) fx = fx . unpack
67
(./) fx = fx . unpack
21
false
true
1
10
18
58
30
28
null
null
league/postgrest
src/PostgREST/Parsers.hs
mit
lexeme :: Parser a -> Parser a lexeme p = ws *> p <* ws
55
lexeme :: Parser a -> Parser a lexeme p = ws *> p <* ws
55
lexeme p = ws *> p <* ws
24
false
true
0
6
14
32
15
17
null
null
Fuuzetsu/chain-codes
test/Data/ChainCodes/ChainSpec.hs
gpl-3.0
spec :: Spec spec = do describe "parseString" $ do let img = "test/res/a.gif" white = PixelRGB8 255 255 255 red = PixelRGB8 255 0 0 readImg x = readRGB8 x >>= \case Left _ β†’ fail $ "Failed reading " ++ img Right s β†’ return s it "can find a spot" $ do i ← readImg img findSpot i white `shouldBe`Just (0, 0) it "fails with Nothing when it can't find a spot" $ do i ← readImg img findSpot i red `shouldBe` Nothing it "can read in the correct chaincode" $ do i ← readImg img chainCodeWith i white (== white) `shouldBe` Just agifChain
630
spec :: Spec spec = do describe "parseString" $ do let img = "test/res/a.gif" white = PixelRGB8 255 255 255 red = PixelRGB8 255 0 0 readImg x = readRGB8 x >>= \case Left _ β†’ fail $ "Failed reading " ++ img Right s β†’ return s it "can find a spot" $ do i ← readImg img findSpot i white `shouldBe`Just (0, 0) it "fails with Nothing when it can't find a spot" $ do i ← readImg img findSpot i red `shouldBe` Nothing it "can read in the correct chaincode" $ do i ← readImg img chainCodeWith i white (== white) `shouldBe` Just agifChain
630
spec = do describe "parseString" $ do let img = "test/res/a.gif" white = PixelRGB8 255 255 255 red = PixelRGB8 255 0 0 readImg x = readRGB8 x >>= \case Left _ β†’ fail $ "Failed reading " ++ img Right s β†’ return s it "can find a spot" $ do i ← readImg img findSpot i white `shouldBe`Just (0, 0) it "fails with Nothing when it can't find a spot" $ do i ← readImg img findSpot i red `shouldBe` Nothing it "can read in the correct chaincode" $ do i ← readImg img chainCodeWith i white (== white) `shouldBe` Just agifChain
617
false
true
0
18
207
227
103
124
null
null
leshchevds/ganeti
src/Ganeti/OpParams.hs
bsd-2-clause
pMaintdEnableBalancing :: Field pMaintdEnableBalancing = withDoc "Whether the maintenance daemon should also keep the cluster balanced" . optionalField $ simpleField "maint_balance" [t| Bool |]
199
pMaintdEnableBalancing :: Field pMaintdEnableBalancing = withDoc "Whether the maintenance daemon should also keep the cluster balanced" . optionalField $ simpleField "maint_balance" [t| Bool |]
199
pMaintdEnableBalancing = withDoc "Whether the maintenance daemon should also keep the cluster balanced" . optionalField $ simpleField "maint_balance" [t| Bool |]
167
false
true
3
6
29
40
18
22
null
null
foreverbell/unlimited-plt-toys
tapl/fullsimple/PPrint.hs
bsd-3-clause
pprintAtomicTerm ctx (TermRecord fields) = printf "{%s}" (pprintFields ctx fields)
82
pprintAtomicTerm ctx (TermRecord fields) = printf "{%s}" (pprintFields ctx fields)
82
pprintAtomicTerm ctx (TermRecord fields) = printf "{%s}" (pprintFields ctx fields)
82
false
false
0
7
9
30
14
16
null
null
mzini/TcT
source/Tct/Utils/Xml/Encoding.hs
gpl-3.0
complexity :: C.Complexity -> XmlContent complexity (C.Poly Nothing) = elt "polynomial" [] []
95
complexity :: C.Complexity -> XmlContent complexity (C.Poly Nothing) = elt "polynomial" [] []
95
complexity (C.Poly Nothing) = elt "polynomial" [] []
54
false
true
0
8
14
39
19
20
null
null
sleepomeno/TForth
src/TF/Util.hs
apache-2.0
emptyForthEffect = ForthEffect ([(emptySt, emptySt)], emptyIntersect)
69
emptyForthEffect = ForthEffect ([(emptySt, emptySt)], emptyIntersect)
69
emptyForthEffect = ForthEffect ([(emptySt, emptySt)], emptyIntersect)
69
false
false
0
8
5
24
14
10
null
null