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
phischu/fragnix
builtins/base/Data.List.NonEmpty.hs
bsd-3-clause
-- | @'filter' p xs@ removes any elements from @xs@ that do not satisfy @p@. filter :: (a -> Bool) -> NonEmpty a -> [a] filter p = List.filter p . toList
153
filter :: (a -> Bool) -> NonEmpty a -> [a] filter p = List.filter p . toList
76
filter p = List.filter p . toList
33
true
true
0
7
31
45
23
22
null
null
AlexanderPankiv/ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
mkArgInfo :: Id -> [CoreRule] -- Rules for function -> Int -- Number of value args -> SimplCont -- Context of the call -> ArgInfo mkArgInfo fun rules n_val_args call_cont | n_val_args < idArity fun -- Note [Unsaturated functions] = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules, ai_encl = False , ai_strs = vanilla_stricts , ai_discs = vanilla_discounts } | otherwise = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules , ai_encl = interestingArgContext rules call_cont , ai_strs = add_type_str fun_ty arg_stricts , ai_discs = arg_discounts } where fun_ty = idType fun vanilla_discounts, arg_discounts :: [Int] vanilla_discounts = repeat 0 arg_discounts = case idUnfolding fun of CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_args = discounts}} -> discounts ++ vanilla_discounts _ -> vanilla_discounts vanilla_stricts, arg_stricts :: [Bool] vanilla_stricts = repeat False arg_stricts = case splitStrictSig (idStrictness fun) of (demands, result_info) | not (demands `lengthExceeds` n_val_args) -> -- Enough args, use the strictness given. -- For bottoming functions we used to pretend that the arg -- is lazy, so that we don't treat the arg as an -- interesting context. This avoids substituting -- top-level bindings for (say) strings into -- calls to error. But now we are more careful about -- inlining lone variables, so its ok (see SimplUtils.analyseCont) if isBotRes result_info then map isStrictDmd demands -- Finite => result is bottom else map isStrictDmd demands ++ vanilla_stricts | otherwise -> WARN( True, text "More demands than arity" <+> ppr fun <+> ppr (idArity fun) <+> ppr n_val_args <+> ppr demands ) vanilla_stricts -- Not enough args, or no strictness add_type_str :: Type -> [Bool] -> [Bool] -- If the function arg types are strict, record that in the 'strictness bits' -- No need to instantiate because unboxed types (which dominate the strict -- types) can't instantiate type variables. -- add_type_str is done repeatedly (for each call); might be better -- once-for-all in the function -- But beware primops/datacons with no strictness add_type_str _ [] = [] add_type_str fun_ty strs -- Look through foralls | Just (_, fun_ty') <- splitForAllTy_maybe fun_ty -- Includes coercions = add_type_str fun_ty' strs add_type_str fun_ty (str:strs) -- Add strict-type info | Just (arg_ty, fun_ty') <- splitFunTy_maybe fun_ty = (str || isStrictType arg_ty) : add_type_str fun_ty' strs add_type_str _ strs = strs {- Note [Unsaturated functions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider (test eyeball/inline4) x = a:as y = f x where f has arity 2. Then we do not want to inline 'x', because it'll just be floated out again. Even if f has lots of discounts on its first argument -- it must be saturated for these to kick in -} {- ************************************************************************ * * Interesting arguments * * ************************************************************************ Note [Interesting call context] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We want to avoid inlining an expression where there can't possibly be any gain, such as in an argument position. Hence, if the continuation is interesting (eg. a case scrutinee, application etc.) then we inline, otherwise we don't. Previously some_benefit used to return True only if the variable was applied to some value arguments. This didn't work: let x = _coerce_ (T Int) Int (I# 3) in case _coerce_ Int (T Int) x of I# y -> .... we want to inline x, but can't see that it's a constructor in a case scrutinee position, and some_benefit is False. Another example: dMonadST = _/\_ t -> :Monad (g1 _@_ t, g2 _@_ t, g3 _@_ t) .... case dMonadST _@_ x0 of (a,b,c) -> .... we'd really like to inline dMonadST here, but we *don't* want to inline if the case expression is just case x of y { DEFAULT -> ... } since we can just eliminate this case instead (x is in WHNF). Similar applies when x is bound to a lambda expression. Hence contIsInteresting looks for case expressions with just a single default case. -}
5,022
mkArgInfo :: Id -> [CoreRule] -- Rules for function -> Int -- Number of value args -> SimplCont -- Context of the call -> ArgInfo mkArgInfo fun rules n_val_args call_cont | n_val_args < idArity fun -- Note [Unsaturated functions] = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules, ai_encl = False , ai_strs = vanilla_stricts , ai_discs = vanilla_discounts } | otherwise = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules , ai_encl = interestingArgContext rules call_cont , ai_strs = add_type_str fun_ty arg_stricts , ai_discs = arg_discounts } where fun_ty = idType fun vanilla_discounts, arg_discounts :: [Int] vanilla_discounts = repeat 0 arg_discounts = case idUnfolding fun of CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_args = discounts}} -> discounts ++ vanilla_discounts _ -> vanilla_discounts vanilla_stricts, arg_stricts :: [Bool] vanilla_stricts = repeat False arg_stricts = case splitStrictSig (idStrictness fun) of (demands, result_info) | not (demands `lengthExceeds` n_val_args) -> -- Enough args, use the strictness given. -- For bottoming functions we used to pretend that the arg -- is lazy, so that we don't treat the arg as an -- interesting context. This avoids substituting -- top-level bindings for (say) strings into -- calls to error. But now we are more careful about -- inlining lone variables, so its ok (see SimplUtils.analyseCont) if isBotRes result_info then map isStrictDmd demands -- Finite => result is bottom else map isStrictDmd demands ++ vanilla_stricts | otherwise -> WARN( True, text "More demands than arity" <+> ppr fun <+> ppr (idArity fun) <+> ppr n_val_args <+> ppr demands ) vanilla_stricts -- Not enough args, or no strictness add_type_str :: Type -> [Bool] -> [Bool] -- If the function arg types are strict, record that in the 'strictness bits' -- No need to instantiate because unboxed types (which dominate the strict -- types) can't instantiate type variables. -- add_type_str is done repeatedly (for each call); might be better -- once-for-all in the function -- But beware primops/datacons with no strictness add_type_str _ [] = [] add_type_str fun_ty strs -- Look through foralls | Just (_, fun_ty') <- splitForAllTy_maybe fun_ty -- Includes coercions = add_type_str fun_ty' strs add_type_str fun_ty (str:strs) -- Add strict-type info | Just (arg_ty, fun_ty') <- splitFunTy_maybe fun_ty = (str || isStrictType arg_ty) : add_type_str fun_ty' strs add_type_str _ strs = strs {- Note [Unsaturated functions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider (test eyeball/inline4) x = a:as y = f x where f has arity 2. Then we do not want to inline 'x', because it'll just be floated out again. Even if f has lots of discounts on its first argument -- it must be saturated for these to kick in -} {- ************************************************************************ * * Interesting arguments * * ************************************************************************ Note [Interesting call context] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We want to avoid inlining an expression where there can't possibly be any gain, such as in an argument position. Hence, if the continuation is interesting (eg. a case scrutinee, application etc.) then we inline, otherwise we don't. Previously some_benefit used to return True only if the variable was applied to some value arguments. This didn't work: let x = _coerce_ (T Int) Int (I# 3) in case _coerce_ Int (T Int) x of I# y -> .... we want to inline x, but can't see that it's a constructor in a case scrutinee position, and some_benefit is False. Another example: dMonadST = _/\_ t -> :Monad (g1 _@_ t, g2 _@_ t, g3 _@_ t) .... case dMonadST _@_ x0 of (a,b,c) -> .... we'd really like to inline dMonadST here, but we *don't* want to inline if the case expression is just case x of y { DEFAULT -> ... } since we can just eliminate this case instead (x is in WHNF). Similar applies when x is bound to a lambda expression. Hence contIsInteresting looks for case expressions with just a single default case. -}
5,021
mkArgInfo fun rules n_val_args call_cont | n_val_args < idArity fun -- Note [Unsaturated functions] = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules, ai_encl = False , ai_strs = vanilla_stricts , ai_discs = vanilla_discounts } | otherwise = ArgInfo { ai_fun = fun, ai_args = [], ai_type = fun_ty , ai_rules = rules , ai_encl = interestingArgContext rules call_cont , ai_strs = add_type_str fun_ty arg_stricts , ai_discs = arg_discounts } where fun_ty = idType fun vanilla_discounts, arg_discounts :: [Int] vanilla_discounts = repeat 0 arg_discounts = case idUnfolding fun of CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_args = discounts}} -> discounts ++ vanilla_discounts _ -> vanilla_discounts vanilla_stricts, arg_stricts :: [Bool] vanilla_stricts = repeat False arg_stricts = case splitStrictSig (idStrictness fun) of (demands, result_info) | not (demands `lengthExceeds` n_val_args) -> -- Enough args, use the strictness given. -- For bottoming functions we used to pretend that the arg -- is lazy, so that we don't treat the arg as an -- interesting context. This avoids substituting -- top-level bindings for (say) strings into -- calls to error. But now we are more careful about -- inlining lone variables, so its ok (see SimplUtils.analyseCont) if isBotRes result_info then map isStrictDmd demands -- Finite => result is bottom else map isStrictDmd demands ++ vanilla_stricts | otherwise -> WARN( True, text "More demands than arity" <+> ppr fun <+> ppr (idArity fun) <+> ppr n_val_args <+> ppr demands ) vanilla_stricts -- Not enough args, or no strictness add_type_str :: Type -> [Bool] -> [Bool] -- If the function arg types are strict, record that in the 'strictness bits' -- No need to instantiate because unboxed types (which dominate the strict -- types) can't instantiate type variables. -- add_type_str is done repeatedly (for each call); might be better -- once-for-all in the function -- But beware primops/datacons with no strictness add_type_str _ [] = [] add_type_str fun_ty strs -- Look through foralls | Just (_, fun_ty') <- splitForAllTy_maybe fun_ty -- Includes coercions = add_type_str fun_ty' strs add_type_str fun_ty (str:strs) -- Add strict-type info | Just (arg_ty, fun_ty') <- splitFunTy_maybe fun_ty = (str || isStrictType arg_ty) : add_type_str fun_ty' strs add_type_str _ strs = strs {- Note [Unsaturated functions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider (test eyeball/inline4) x = a:as y = f x where f has arity 2. Then we do not want to inline 'x', because it'll just be floated out again. Even if f has lots of discounts on its first argument -- it must be saturated for these to kick in -} {- ************************************************************************ * * Interesting arguments * * ************************************************************************ Note [Interesting call context] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We want to avoid inlining an expression where there can't possibly be any gain, such as in an argument position. Hence, if the continuation is interesting (eg. a case scrutinee, application etc.) then we inline, otherwise we don't. Previously some_benefit used to return True only if the variable was applied to some value arguments. This didn't work: let x = _coerce_ (T Int) Int (I# 3) in case _coerce_ Int (T Int) x of I# y -> .... we want to inline x, but can't see that it's a constructor in a case scrutinee position, and some_benefit is False. Another example: dMonadST = _/\_ t -> :Monad (g1 _@_ t, g2 _@_ t, g3 _@_ t) .... case dMonadST _@_ x0 of (a,b,c) -> .... we'd really like to inline dMonadST here, but we *don't* want to inline if the case expression is just case x of y { DEFAULT -> ... } since we can just eliminate this case instead (x is in WHNF). Similar applies when x is bound to a lambda expression. Hence contIsInteresting looks for case expressions with just a single default case. -}
4,843
false
true
8
16
1,625
589
304
285
null
null
ericmoritz/deps
src/DepTool.hs
bsd-3-clause
(</>) :: String -> String -> String x </> y = x ++ "/" ++ y
59
(</>) :: String -> String -> String x </> y = x ++ "/" ++ y
59
x </> y = x ++ "/" ++ y
23
false
true
0
9
15
36
18
18
null
null
bamboo/idris-cil
src/IRTS/Cil/MaxStack.hs
bsd-3-clause
netStackChange _ Stind_i2 = -2
35
netStackChange _ Stind_i2 = -2
35
netStackChange _ Stind_i2 = -2
35
false
false
0
5
9
13
6
7
null
null
mgrebenets/hackerrank
alg/strings/two-two.hs
mit
main :: IO () main = do n <- readLn :: IO Int testCases <- replicateM n getLine -- print testCases let maxPower = 800 let powerStrings = map show (powers maxPower) print powerStrings let ans = map (twotwo powerStrings 0) testCases -- print ans mapM_ print ans -- mapM_ (print . sum) ans
326
main :: IO () main = do n <- readLn :: IO Int testCases <- replicateM n getLine -- print testCases let maxPower = 800 let powerStrings = map show (powers maxPower) print powerStrings let ans = map (twotwo powerStrings 0) testCases -- print ans mapM_ print ans -- mapM_ (print . sum) ans
326
main = do n <- readLn :: IO Int testCases <- replicateM n getLine -- print testCases let maxPower = 800 let powerStrings = map show (powers maxPower) print powerStrings let ans = map (twotwo powerStrings 0) testCases -- print ans mapM_ print ans -- mapM_ (print . sum) ans
312
false
true
1
8
93
102
50
52
null
null
ocramz/petsc-hs
examples/Test2.hs
gpl-3.0
-- PETSC_EXTERN PetscErrorCode DMCreateLocalVector(DM,Vec*); dmCreateLocalVector dm = withPtr ( \v -> [C.exp|int{DMCreateLocalVector($(DM dm), $(Vec* v))}|]) >>= handleErrTup
174
dmCreateLocalVector dm = withPtr ( \v -> [C.exp|int{DMCreateLocalVector($(DM dm), $(Vec* v))}|]) >>= handleErrTup
113
dmCreateLocalVector dm = withPtr ( \v -> [C.exp|int{DMCreateLocalVector($(DM dm), $(Vec* v))}|]) >>= handleErrTup
113
true
false
0
9
16
31
18
13
null
null
ChartrandEtienne/ai
Main.hs
unlicense
runDbMonad :: DbMonad a -> ServerPart a runDbMonad m = do db <- liftIO $ openConnection "db.sql" runReaderT m db
120
runDbMonad :: DbMonad a -> ServerPart a runDbMonad m = do db <- liftIO $ openConnection "db.sql" runReaderT m db
120
runDbMonad m = do db <- liftIO $ openConnection "db.sql" runReaderT m db
80
false
true
0
9
27
46
20
26
null
null
gergoerdi/sstg
src/Language/SSTG/Syntax.hs
bsd-3-clause
simplifyExpr (StgLam _ xs body) = SStgLam (map getName xs) $ simplifyExpr body
78
simplifyExpr (StgLam _ xs body) = SStgLam (map getName xs) $ simplifyExpr body
78
simplifyExpr (StgLam _ xs body) = SStgLam (map getName xs) $ simplifyExpr body
78
false
false
0
8
12
37
17
20
null
null
gcampax/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
runTcPluginM :: TcPluginM a -> TcM a runTcPluginM (TcPluginM m) = m
67
runTcPluginM :: TcPluginM a -> TcM a runTcPluginM (TcPluginM m) = m
67
runTcPluginM (TcPluginM m) = m
30
false
true
0
7
11
30
14
16
null
null
josefs/sbv
Data/SBV/Core/Concrete.hs
bsd-3-clause
cwSameType :: CW -> CW -> Bool cwSameType x y = kindOf x == kindOf y
68
cwSameType :: CW -> CW -> Bool cwSameType x y = kindOf x == kindOf y
68
cwSameType x y = kindOf x == kindOf y
37
false
true
1
8
15
40
17
23
null
null
anton-k/sharc-timbre
src/Sharc/Instruments/FrenchHornMuted.hs
bsd-3-clause
note14 :: Note note14 = Note (Pitch 164.814 40 "e3") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 60 2.24) (NoteRangeHarmonicFreq 1 164.81)) (NoteRange (NoteRangeAmplitude 988.88 6 6525.0) (NoteRangeHarmonicFreq 60 9888.84))) [Harmonic 1 (-9.1e-2) 974.71 ,Harmonic 2 2.235 3403.08 ,Harmonic 3 (-1.454) 4018.8 ,Harmonic 4 0.926 3600.53 ,Harmonic 5 (-2.431) 884.08 ,Harmonic 6 1.081 6525.0 ,Harmonic 7 2.618 6230.67 ,Harmonic 8 (-1.506) 5433.25 ,Harmonic 9 0.608 4322.92 ,Harmonic 10 2.601 3130.34 ,Harmonic 11 (-0.645) 2423.43 ,Harmonic 12 1.791 2486.68 ,Harmonic 13 (-2.353) 1924.97 ,Harmonic 14 7.9e-2 1615.34 ,Harmonic 15 2.325 1171.75 ,Harmonic 16 (-1.379) 798.57 ,Harmonic 17 0.915 254.83 ,Harmonic 18 (-2.433) 439.81 ,Harmonic 19 (-0.12) 376.18 ,Harmonic 20 1.999 281.67 ,Harmonic 21 (-1.418) 139.11 ,Harmonic 22 1.765 115.71 ,Harmonic 23 (-1.4) 141.73 ,Harmonic 24 0.75 185.61 ,Harmonic 25 3.069 135.19 ,Harmonic 26 (-0.735) 119.13 ,Harmonic 27 1.597 114.06 ,Harmonic 28 (-2.209) 63.08 ,Harmonic 29 0.671 82.42 ,Harmonic 30 2.988 74.0 ,Harmonic 31 (-0.556) 72.14 ,Harmonic 32 1.507 74.06 ,Harmonic 33 (-2.42) 54.89 ,Harmonic 34 0.51 32.25 ,Harmonic 35 2.798 36.07 ,Harmonic 36 (-1.116) 40.1 ,Harmonic 37 1.145 29.23 ,Harmonic 38 (-2.167) 16.52 ,Harmonic 39 0.106 18.2 ,Harmonic 40 2.474 9.34 ,Harmonic 41 (-1.395) 5.56 ,Harmonic 42 1.791 7.14 ,Harmonic 43 (-1.69) 5.72 ,Harmonic 44 0.89 5.42 ,Harmonic 45 (-2.91) 3.8 ,Harmonic 46 9.9e-2 3.57 ,Harmonic 47 2.63 3.85 ,Harmonic 48 0.212 3.46 ,Harmonic 49 2.236 6.45 ,Harmonic 50 (-1.651) 6.36 ,Harmonic 51 0.937 7.11 ,Harmonic 52 (-2.833) 5.38 ,Harmonic 53 (-1.022) 2.42 ,Harmonic 54 1.707 3.52 ,Harmonic 55 (-2.579) 6.1 ,Harmonic 56 (-2.0e-2) 4.89 ,Harmonic 57 2.989 2.6 ,Harmonic 58 (-0.739) 3.25 ,Harmonic 59 2.114 3.66 ,Harmonic 60 (-2.395) 2.24]
2,123
note14 :: Note note14 = Note (Pitch 164.814 40 "e3") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 60 2.24) (NoteRangeHarmonicFreq 1 164.81)) (NoteRange (NoteRangeAmplitude 988.88 6 6525.0) (NoteRangeHarmonicFreq 60 9888.84))) [Harmonic 1 (-9.1e-2) 974.71 ,Harmonic 2 2.235 3403.08 ,Harmonic 3 (-1.454) 4018.8 ,Harmonic 4 0.926 3600.53 ,Harmonic 5 (-2.431) 884.08 ,Harmonic 6 1.081 6525.0 ,Harmonic 7 2.618 6230.67 ,Harmonic 8 (-1.506) 5433.25 ,Harmonic 9 0.608 4322.92 ,Harmonic 10 2.601 3130.34 ,Harmonic 11 (-0.645) 2423.43 ,Harmonic 12 1.791 2486.68 ,Harmonic 13 (-2.353) 1924.97 ,Harmonic 14 7.9e-2 1615.34 ,Harmonic 15 2.325 1171.75 ,Harmonic 16 (-1.379) 798.57 ,Harmonic 17 0.915 254.83 ,Harmonic 18 (-2.433) 439.81 ,Harmonic 19 (-0.12) 376.18 ,Harmonic 20 1.999 281.67 ,Harmonic 21 (-1.418) 139.11 ,Harmonic 22 1.765 115.71 ,Harmonic 23 (-1.4) 141.73 ,Harmonic 24 0.75 185.61 ,Harmonic 25 3.069 135.19 ,Harmonic 26 (-0.735) 119.13 ,Harmonic 27 1.597 114.06 ,Harmonic 28 (-2.209) 63.08 ,Harmonic 29 0.671 82.42 ,Harmonic 30 2.988 74.0 ,Harmonic 31 (-0.556) 72.14 ,Harmonic 32 1.507 74.06 ,Harmonic 33 (-2.42) 54.89 ,Harmonic 34 0.51 32.25 ,Harmonic 35 2.798 36.07 ,Harmonic 36 (-1.116) 40.1 ,Harmonic 37 1.145 29.23 ,Harmonic 38 (-2.167) 16.52 ,Harmonic 39 0.106 18.2 ,Harmonic 40 2.474 9.34 ,Harmonic 41 (-1.395) 5.56 ,Harmonic 42 1.791 7.14 ,Harmonic 43 (-1.69) 5.72 ,Harmonic 44 0.89 5.42 ,Harmonic 45 (-2.91) 3.8 ,Harmonic 46 9.9e-2 3.57 ,Harmonic 47 2.63 3.85 ,Harmonic 48 0.212 3.46 ,Harmonic 49 2.236 6.45 ,Harmonic 50 (-1.651) 6.36 ,Harmonic 51 0.937 7.11 ,Harmonic 52 (-2.833) 5.38 ,Harmonic 53 (-1.022) 2.42 ,Harmonic 54 1.707 3.52 ,Harmonic 55 (-2.579) 6.1 ,Harmonic 56 (-2.0e-2) 4.89 ,Harmonic 57 2.989 2.6 ,Harmonic 58 (-0.739) 3.25 ,Harmonic 59 2.114 3.66 ,Harmonic 60 (-2.395) 2.24]
2,123
note14 = Note (Pitch 164.814 40 "e3") 15 (Range (NoteRange (NoteRangeAmplitude 9888.84 60 2.24) (NoteRangeHarmonicFreq 1 164.81)) (NoteRange (NoteRangeAmplitude 988.88 6 6525.0) (NoteRangeHarmonicFreq 60 9888.84))) [Harmonic 1 (-9.1e-2) 974.71 ,Harmonic 2 2.235 3403.08 ,Harmonic 3 (-1.454) 4018.8 ,Harmonic 4 0.926 3600.53 ,Harmonic 5 (-2.431) 884.08 ,Harmonic 6 1.081 6525.0 ,Harmonic 7 2.618 6230.67 ,Harmonic 8 (-1.506) 5433.25 ,Harmonic 9 0.608 4322.92 ,Harmonic 10 2.601 3130.34 ,Harmonic 11 (-0.645) 2423.43 ,Harmonic 12 1.791 2486.68 ,Harmonic 13 (-2.353) 1924.97 ,Harmonic 14 7.9e-2 1615.34 ,Harmonic 15 2.325 1171.75 ,Harmonic 16 (-1.379) 798.57 ,Harmonic 17 0.915 254.83 ,Harmonic 18 (-2.433) 439.81 ,Harmonic 19 (-0.12) 376.18 ,Harmonic 20 1.999 281.67 ,Harmonic 21 (-1.418) 139.11 ,Harmonic 22 1.765 115.71 ,Harmonic 23 (-1.4) 141.73 ,Harmonic 24 0.75 185.61 ,Harmonic 25 3.069 135.19 ,Harmonic 26 (-0.735) 119.13 ,Harmonic 27 1.597 114.06 ,Harmonic 28 (-2.209) 63.08 ,Harmonic 29 0.671 82.42 ,Harmonic 30 2.988 74.0 ,Harmonic 31 (-0.556) 72.14 ,Harmonic 32 1.507 74.06 ,Harmonic 33 (-2.42) 54.89 ,Harmonic 34 0.51 32.25 ,Harmonic 35 2.798 36.07 ,Harmonic 36 (-1.116) 40.1 ,Harmonic 37 1.145 29.23 ,Harmonic 38 (-2.167) 16.52 ,Harmonic 39 0.106 18.2 ,Harmonic 40 2.474 9.34 ,Harmonic 41 (-1.395) 5.56 ,Harmonic 42 1.791 7.14 ,Harmonic 43 (-1.69) 5.72 ,Harmonic 44 0.89 5.42 ,Harmonic 45 (-2.91) 3.8 ,Harmonic 46 9.9e-2 3.57 ,Harmonic 47 2.63 3.85 ,Harmonic 48 0.212 3.46 ,Harmonic 49 2.236 6.45 ,Harmonic 50 (-1.651) 6.36 ,Harmonic 51 0.937 7.11 ,Harmonic 52 (-2.833) 5.38 ,Harmonic 53 (-1.022) 2.42 ,Harmonic 54 1.707 3.52 ,Harmonic 55 (-2.579) 6.1 ,Harmonic 56 (-2.0e-2) 4.89 ,Harmonic 57 2.989 2.6 ,Harmonic 58 (-0.739) 3.25 ,Harmonic 59 2.114 3.66 ,Harmonic 60 (-2.395) 2.24]
2,108
false
true
0
10
583
828
426
402
null
null
zjhmale/monadme
monad/src/monad/haskell/mpc.hs
epl-1.0
parse18 = parse (many1 digit) "abcdef"
38
parse18 = parse (many1 digit) "abcdef"
38
parse18 = parse (many1 digit) "abcdef"
38
false
false
0
7
5
17
8
9
null
null
holzensp/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
runPhase (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ doCpp dflags1 True{-raw-} input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn) ------------------------------------------------------------------------------- -- HsPp phase
1,543
runPhase (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ doCpp dflags1 True{-raw-} input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn) ------------------------------------------------------------------------------- -- HsPp phase
1,543
runPhase (RealPhase (Cpp sf)) input_fn dflags0 = do src_opts <- liftIO $ getOptionsFromFile dflags0 input_fn (dflags1, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts setDynFlags dflags1 liftIO $ checkProcessArgsResult dflags1 unhandled_flags if not (xopt Opt_Cpp dflags1) then do -- we have to be careful to emit warnings only once. unless (gopt Opt_Pp dflags1) $ liftIO $ handleFlagWarnings dflags1 warns -- no need to preprocess CPP, just pass input file along -- to the next phase of the pipeline. return (RealPhase (HsPp sf), input_fn) else do output_fn <- phaseOutputFilename (HsPp sf) liftIO $ doCpp dflags1 True{-raw-} input_fn output_fn -- re-read the pragmas now that we've preprocessed the file -- See #2464,#3457 src_opts <- liftIO $ getOptionsFromFile dflags0 output_fn (dflags2, unhandled_flags, warns) <- liftIO $ parseDynamicFilePragma dflags0 src_opts liftIO $ checkProcessArgsResult dflags2 unhandled_flags unless (gopt Opt_Pp dflags2) $ liftIO $ handleFlagWarnings dflags2 warns -- the HsPp pass below will emit warnings setDynFlags dflags2 return (RealPhase (HsPp sf), output_fn) ------------------------------------------------------------------------------- -- HsPp phase
1,543
false
false
0
14
481
302
144
158
null
null
snoyberg/ghc
compiler/nativeGen/RegAlloc/Graph/Main.hs
bsd-3-clause
seqRealReg :: RealReg -> () seqRealReg reg = reg `seq` ()
57
seqRealReg :: RealReg -> () seqRealReg reg = reg `seq` ()
57
seqRealReg reg = reg `seq` ()
29
false
true
0
6
10
28
15
13
null
null
limansky/wbxml
src/Wbxml/Serializer.hs
bsd-3-clause
writeAttrs as = mapM_ writeAttr as >> putWord8 0
48
writeAttrs as = mapM_ writeAttr as >> putWord8 0
48
writeAttrs as = mapM_ writeAttr as >> putWord8 0
48
false
false
0
6
8
21
9
12
null
null
ekarayel/HTF
Test/Framework/ThreadPool.hs
lgpl-2.1
writeNamedChan :: Show a => NamedChan a -> a -> IO () writeNamedChan (name, chan) x = do debug ("writeChan[" ++ name ++ "]=" ++ show x) writeChan chan x
163
writeNamedChan :: Show a => NamedChan a -> a -> IO () writeNamedChan (name, chan) x = do debug ("writeChan[" ++ name ++ "]=" ++ show x) writeChan chan x
163
writeNamedChan (name, chan) x = do debug ("writeChan[" ++ name ++ "]=" ++ show x) writeChan chan x
109
false
true
0
12
40
82
37
45
null
null
pgj/bead
src/Bead/Persistence/NoSQLDir.hs
bsd-3-clause
saveEvaluation :: Evaluation -> Persist EvaluationKey saveEvaluation e = do dirName <- createTmpDir evaluationDataDir "ev" let evKey = EvaluationKey . takeBaseName $ dirName save dirName e return evKey
209
saveEvaluation :: Evaluation -> Persist EvaluationKey saveEvaluation e = do dirName <- createTmpDir evaluationDataDir "ev" let evKey = EvaluationKey . takeBaseName $ dirName save dirName e return evKey
209
saveEvaluation e = do dirName <- createTmpDir evaluationDataDir "ev" let evKey = EvaluationKey . takeBaseName $ dirName save dirName e return evKey
155
false
true
0
11
35
64
28
36
null
null
DougBurke/swish
src/Swish/RDF/Vocabulary/FOAF.hs
lgpl-2.1
-- | Maps @foaf@ to <http://xmlns.com/foaf/0.1/>. namespaceFOAF :: Namespace namespaceFOAF = makeNamespace (Just "foaf") foafURI
128
namespaceFOAF :: Namespace namespaceFOAF = makeNamespace (Just "foaf") foafURI
78
namespaceFOAF = makeNamespace (Just "foaf") foafURI
51
true
true
0
7
14
23
12
11
null
null
unclechu/xlib-keys-hack
src/Keys.hs
gpl-3.0
fourthRow :: [KeyName] fourthRow = [ GraveKey , Number1Key , Number2Key , Number3Key , Number4Key , Number5Key , Number6Key , Number7Key , Number8Key , Number9Key , Number0Key , MinusKey , EqualKey , BackSpaceKey ]
228
fourthRow :: [KeyName] fourthRow = [ GraveKey , Number1Key , Number2Key , Number3Key , Number4Key , Number5Key , Number6Key , Number7Key , Number8Key , Number9Key , Number0Key , MinusKey , EqualKey , BackSpaceKey ]
228
fourthRow = [ GraveKey , Number1Key , Number2Key , Number3Key , Number4Key , Number5Key , Number6Key , Number7Key , Number8Key , Number9Key , Number0Key , MinusKey , EqualKey , BackSpaceKey ]
205
false
true
0
5
47
56
36
20
null
null
olsner/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 180
57
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 180
57
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 180
57
false
false
0
5
4
9
4
5
null
null
gscalzo/HaskellTheHardWay
gloss-try/gloss-master/gloss-raster/Graphics/Gloss/Raster/Field.hs
mit
-- | Construct a color from red, green, blue components. rgb8w :: Word8 -> Word8 -> Word8 -> Color rgb8w r g b = makeColor8 (fromIntegral r) (fromIntegral g) (fromIntegral b) 255
178
rgb8w :: Word8 -> Word8 -> Word8 -> Color rgb8w r g b = makeColor8 (fromIntegral r) (fromIntegral g) (fromIntegral b) 255
121
rgb8w r g b = makeColor8 (fromIntegral r) (fromIntegral g) (fromIntegral b) 255
79
true
true
0
7
31
58
29
29
null
null
c089/haskell-craft3e
Chapter5Exercises.hs
mit
capitalizeChar :: Char -> Char capitalizeChar 'a' = 'A'
55
capitalizeChar :: Char -> Char capitalizeChar 'a' = 'A'
55
capitalizeChar 'a' = 'A'
24
false
true
0
5
8
18
9
9
null
null
infotroph/pandoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
block :: (String -> String) -> Int -> Doc -> Doc block filler width = Doc . singleton . Block width . map filler . chop width . render (Just width)
169
block :: (String -> String) -> Int -> Doc -> Doc block filler width = Doc . singleton . Block width . map filler . chop width . render (Just width)
169
block filler width = Doc . singleton . Block width . map filler . chop width . render (Just width)
120
false
true
0
9
52
77
36
41
null
null
AaronFriel/hyhac
src/Database/HyperDex/Internal/Handle.hs
bsd-3-clause
invalidHandle :: Handle invalidHandle = Handle minBound
56
invalidHandle :: Handle invalidHandle = Handle minBound
55
invalidHandle = Handle minBound
31
false
true
0
5
7
14
7
7
null
null
susisu/Grassy
src/Language/Grass/Transpiler/Untyped/Parser.hs
bsd-3-clause
whiteSpace :: Parser () whiteSpace = TP.whiteSpace tp
53
whiteSpace :: Parser () whiteSpace = TP.whiteSpace tp
53
whiteSpace = TP.whiteSpace tp
29
false
true
0
7
7
27
11
16
null
null
batterseapower/parallel-io
Control/Concurrent/ParallelIO/Benchmark.hs
bsd-3-clause
main :: IO () main = do r <- newIORef (0 :: Int) let incRef = atomicModifyIORef r (\a -> (a, a)) time $ parallel_ $ replicate n $ incRef v <- readIORef r stopGlobalPool print v
200
main :: IO () main = do r <- newIORef (0 :: Int) let incRef = atomicModifyIORef r (\a -> (a, a)) time $ parallel_ $ replicate n $ incRef v <- readIORef r stopGlobalPool print v
200
main = do r <- newIORef (0 :: Int) let incRef = atomicModifyIORef r (\a -> (a, a)) time $ parallel_ $ replicate n $ incRef v <- readIORef r stopGlobalPool print v
186
false
true
0
13
60
97
46
51
null
null
rodrigogribeiro/mptc
test/Cases/DataConsInfoTest.hs
bsd-3-clause
-- test file file = baseDir ++ "/mptc/test/Data/Full/Teste1.hs"
64
file = baseDir ++ "/mptc/test/Data/Full/Teste1.hs"
50
file = baseDir ++ "/mptc/test/Data/Full/Teste1.hs"
50
true
false
3
5
8
16
6
10
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2007-Programming_in_Haskell-1st_Edition-Graham_Hutton/ch_07_8.hs
unlicense
{- This doesn't type check because non of the functions have the necessary a -> a type. sumsqreven = compose [ sum -- :: Num a => [a] -> a , map (^2) -- :: Num a => [a] -> [a] , filter even -- :: Integral a => [a] -> [a] ] -} e5 :: [Test] e5 = U.t "e5" (compose [(+1), (*2), (^2)] 2) 9
404
e5 :: [Test] e5 = U.t "e5" (compose [(+1), (*2), (^2)] 2) 9
69
e5 = U.t "e5" (compose [(+1), (*2), (^2)] 2) 9
56
true
true
0
8
185
62
33
29
null
null
unisonweb/platform
unison-core/src/Unison/ABT.hs
mit
compose :: Monoid m => Path s t a b m -> Path a b a' b' m -> Path s t a' b' m compose (Path p1) (Path p2) = Path p3 where p3 s = do (get1,set1,m1) <- p1 s (get2,set2,m2) <- p2 get1 pure (get2, set2 >=> set1, m1 `mappend` m2)
238
compose :: Monoid m => Path s t a b m -> Path a b a' b' m -> Path s t a' b' m compose (Path p1) (Path p2) = Path p3 where p3 s = do (get1,set1,m1) <- p1 s (get2,set2,m2) <- p2 get1 pure (get2, set2 >=> set1, m1 `mappend` m2)
238
compose (Path p1) (Path p2) = Path p3 where p3 s = do (get1,set1,m1) <- p1 s (get2,set2,m2) <- p2 get1 pure (get2, set2 >=> set1, m1 `mappend` m2)
160
false
true
0
11
67
152
76
76
null
null
maueroats/teaching
docs/ap-cs/haskell/connect-four/testcases/UIConnectFour.hs
gpl-3.0
get_number :: String -> Int get_number colIn = case (reads colIn)::[(Int,String)] of [(colnum, "")] -> colnum _ -> -1
150
get_number :: String -> Int get_number colIn = case (reads colIn)::[(Int,String)] of [(colnum, "")] -> colnum _ -> -1
150
get_number colIn = case (reads colIn)::[(Int,String)] of [(colnum, "")] -> colnum _ -> -1
122
false
true
0
9
51
63
35
28
null
null
nomlab/nomnichi-haskell
db_migrate_second_20141016.hs
bsd-2-clause
-- これらはいらない -- Article -- memberName Text -- Comment -- commenter Text -- 移行元tempデータベース database1 = "temp_nomnichi.sqlite3"
133
database1 = "temp_nomnichi.sqlite3"
35
database1 = "temp_nomnichi.sqlite3"
35
true
false
0
4
26
12
9
3
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F28.hs
bsd-3-clause
ptr_glUniformMatrix2x3fvNV :: FunPtr (GLint -> GLsizei -> GLboolean -> Ptr GLfloat -> IO ()) ptr_glUniformMatrix2x3fvNV = unsafePerformIO $ getCommand "glUniformMatrix2x3fvNV"
175
ptr_glUniformMatrix2x3fvNV :: FunPtr (GLint -> GLsizei -> GLboolean -> Ptr GLfloat -> IO ()) ptr_glUniformMatrix2x3fvNV = unsafePerformIO $ getCommand "glUniformMatrix2x3fvNV"
175
ptr_glUniformMatrix2x3fvNV = unsafePerformIO $ getCommand "glUniformMatrix2x3fvNV"
82
false
true
0
12
19
48
23
25
null
null
sjcjoosten/amperspiegel
src/TokenAwareParser.hs
gpl-3.0
deAtomizeString (Fresh i) = Left$"Fresh "<>showT i
50
deAtomizeString (Fresh i) = Left$"Fresh "<>showT i
50
deAtomizeString (Fresh i) = Left$"Fresh "<>showT i
50
false
false
0
7
6
26
12
14
null
null
rzil/honours
LeavittPathAlgebras/Example9.hs
mit
f1 = edge 1 "f"
15
f1 = edge 1 "f"
15
f1 = edge 1 "f"
15
false
false
1
5
4
14
5
9
null
null
Helkafen/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags optionDistPref get set = \showOrParseArgs -> option "" (distPrefFlagName showOrParseArgs) ( "The directory where Cabal puts generated build files " ++ "(default " ++ defaultDistPref ++ ")") get set (reqArgFlag "DIR") where distPrefFlagName ShowArgs = ["builddir"] distPrefFlagName ParseArgs = ["builddir", "distdir", "distpref"]
525
optionDistPref :: (flags -> Flag FilePath) -> (Flag FilePath -> flags -> flags) -> ShowOrParseArgs -> OptionField flags optionDistPref get set = \showOrParseArgs -> option "" (distPrefFlagName showOrParseArgs) ( "The directory where Cabal puts generated build files " ++ "(default " ++ defaultDistPref ++ ")") get set (reqArgFlag "DIR") where distPrefFlagName ShowArgs = ["builddir"] distPrefFlagName ParseArgs = ["builddir", "distdir", "distpref"]
525
optionDistPref get set = \showOrParseArgs -> option "" (distPrefFlagName showOrParseArgs) ( "The directory where Cabal puts generated build files " ++ "(default " ++ defaultDistPref ++ ")") get set (reqArgFlag "DIR") where distPrefFlagName ShowArgs = ["builddir"] distPrefFlagName ParseArgs = ["builddir", "distdir", "distpref"]
360
false
true
1
10
136
131
67
64
null
null
haskell/haddock
haddock-api/src/Haddock/Interface/Json.hs
bsd-2-clause
jsonDoc (DocIdentifierUnchecked modName) = jsonObject [ ("tag", jsonString "DocIdentifierUnchecked") , ("modName", jsonString (showModName modName)) ]
162
jsonDoc (DocIdentifierUnchecked modName) = jsonObject [ ("tag", jsonString "DocIdentifierUnchecked") , ("modName", jsonString (showModName modName)) ]
162
jsonDoc (DocIdentifierUnchecked modName) = jsonObject [ ("tag", jsonString "DocIdentifierUnchecked") , ("modName", jsonString (showModName modName)) ]
162
false
false
0
9
26
48
25
23
null
null
thomie/vector
Data/Vector/Fusion/Stream/Monadic.hs
bsd-3-clause
consume (Stream step t) = consume_loop SPEC t where consume_loop !_ s = do r <- step s case r of Yield _ s' -> consume_loop SPEC s' Skip s' -> consume_loop SPEC s' Done -> return () -- | Execute a monadic action for each element of the 'Stream'
322
consume (Stream step t) = consume_loop SPEC t where consume_loop !_ s = do r <- step s case r of Yield _ s' -> consume_loop SPEC s' Skip s' -> consume_loop SPEC s' Done -> return () -- | Execute a monadic action for each element of the 'Stream'
322
consume (Stream step t) = consume_loop SPEC t where consume_loop !_ s = do r <- step s case r of Yield _ s' -> consume_loop SPEC s' Skip s' -> consume_loop SPEC s' Done -> return () -- | Execute a monadic action for each element of the 'Stream'
322
false
false
0
11
127
94
42
52
null
null
nickspinale/euler
complete/017.hs
mit
"00" = ""
9
"00" = ""
9
"00" = ""
9
false
false
1
5
2
10
3
7
null
null
ksaveljev/hake-2
src/Constants.hs
bsd-3-clause
teWidowBeamOut = 50 :: Int
30
teWidowBeamOut = 50 :: Int
30
teWidowBeamOut = 50 :: Int
30
false
false
0
4
8
9
5
4
null
null
tannerb/99-problems-haskell
app/Problems.hs
bsd-3-clause
-- | problem 4. # of elements in list myLength :: [a] -> Int myLength = foldr (\_ x -> x+1) 0
93
myLength :: [a] -> Int myLength = foldr (\_ x -> x+1) 0
55
myLength = foldr (\_ x -> x+1) 0
32
true
true
0
8
21
45
22
23
null
null
ihc/futhark
src/Futhark/Pass/KernelBabysitting.hs
isc
varianceInStm :: VarianceTable -> Stm InKernel -> VarianceTable varianceInStm variance bnd = foldl' add variance $ patternNames $ stmPattern bnd where add variance' v = M.insert v binding_variance variance' look variance' v = S.insert v $ M.findWithDefault mempty v variance' binding_variance = mconcat $ map (look variance) $ S.toList (freeInStm bnd)
371
varianceInStm :: VarianceTable -> Stm InKernel -> VarianceTable varianceInStm variance bnd = foldl' add variance $ patternNames $ stmPattern bnd where add variance' v = M.insert v binding_variance variance' look variance' v = S.insert v $ M.findWithDefault mempty v variance' binding_variance = mconcat $ map (look variance) $ S.toList (freeInStm bnd)
371
varianceInStm variance bnd = foldl' add variance $ patternNames $ stmPattern bnd where add variance' v = M.insert v binding_variance variance' look variance' v = S.insert v $ M.findWithDefault mempty v variance' binding_variance = mconcat $ map (look variance) $ S.toList (freeInStm bnd)
307
false
true
2
9
70
125
59
66
null
null
alexander-at-github/eta
compiler/ETA/Prelude/PrelNames.hs
bsd-3-clause
mAIN_NAME = mkModuleNameFS (fsLit "Main")
46
mAIN_NAME = mkModuleNameFS (fsLit "Main")
46
mAIN_NAME = mkModuleNameFS (fsLit "Main")
46
false
false
1
7
9
18
7
11
null
null
Airtnp/Freshman_Simple_Haskell_Lib
Idioms/Case-Alter.hs
mit
if_alt x = if' (x < 0) "233" $ if' (x > 0) "2333" $ "23333"
81
if_alt x = if' (x < 0) "233" $ if' (x > 0) "2333" $ "23333"
81
if_alt x = if' (x < 0) "233" $ if' (x > 0) "2333" $ "23333"
81
false
false
1
6
37
46
20
26
null
null
AccelerateHS/accelerate-cuda
Data/Array/Accelerate/CUDA/Compile.hs
bsd-3-clause
compileOpenAfun :: DelayedOpenAfun aenv f -> CIO (PreOpenAfun ExecOpenAcc aenv f) compileOpenAfun (Alam l) = Alam <$> compileOpenAfun l
137
compileOpenAfun :: DelayedOpenAfun aenv f -> CIO (PreOpenAfun ExecOpenAcc aenv f) compileOpenAfun (Alam l) = Alam <$> compileOpenAfun l
137
compileOpenAfun (Alam l) = Alam <$> compileOpenAfun l
55
false
true
0
8
20
49
23
26
null
null
sonyandy/tnt
Control/Monad/Code/Opcode.hs
bsd-3-clause
fcmpl :: Word8 fcmpl = 0x95
27
fcmpl :: Word8 fcmpl = 0x95
27
fcmpl = 0x95
12
false
true
0
4
5
11
6
5
null
null
schell/varying
src/Control/Varying/Tween.hs
mit
-- | Ease out sinusoidal. easeOutSine :: (Floating t, Real f) => Easing t f easeOutSine c t b = let cos' = cos (realToFrac t * (pi / 2)) in c * cos' + b
153
easeOutSine :: (Floating t, Real f) => Easing t f easeOutSine c t b = let cos' = cos (realToFrac t * (pi / 2)) in c * cos' + b
127
easeOutSine c t b = let cos' = cos (realToFrac t * (pi / 2)) in c * cos' + b
77
true
true
0
13
36
83
40
43
null
null
tamasgal/haskell_exercises
ProjectEuler/p031.hs
mit
change [x] _ = 1
19
change [x] _ = 1
19
change [x] _ = 1
19
false
false
0
6
7
14
7
7
null
null
tolysz/prepare-ghcjs
spec-lts8/cabal/cabal-install/Distribution/Client/Dependency/TopDown.hs
bsd-3-clause
addTopLevelConstraints (PackageConstraintFlags _ _ :deps) cs = addTopLevelConstraints deps cs
100
addTopLevelConstraints (PackageConstraintFlags _ _ :deps) cs = addTopLevelConstraints deps cs
100
addTopLevelConstraints (PackageConstraintFlags _ _ :deps) cs = addTopLevelConstraints deps cs
100
false
false
0
8
16
28
13
15
null
null
ryantm/ghc
libraries/base/Foreign/Marshal/Alloc.hs
bsd-3-clause
allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b allocaBytesAligned (I# size) (I# align) action = IO $ \ s0 -> case newAlignedPinnedByteArray# size align s0 of { (# s1, mbarr# #) -> case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) -> let addr = Ptr (byteArrayContents# barr#) in case action addr of { IO action' -> case action' s2 of { (# s3, r #) -> case touch# barr# s3 of { s4 -> (# s4, r #) }}}}}
468
allocaBytesAligned :: Int -> Int -> (Ptr a -> IO b) -> IO b allocaBytesAligned (I# size) (I# align) action = IO $ \ s0 -> case newAlignedPinnedByteArray# size align s0 of { (# s1, mbarr# #) -> case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) -> let addr = Ptr (byteArrayContents# barr#) in case action addr of { IO action' -> case action' s2 of { (# s3, r #) -> case touch# barr# s3 of { s4 -> (# s4, r #) }}}}}
468
allocaBytesAligned (I# size) (I# align) action = IO $ \ s0 -> case newAlignedPinnedByteArray# size align s0 of { (# s1, mbarr# #) -> case unsafeFreezeByteArray# mbarr# s1 of { (# s2, barr# #) -> let addr = Ptr (byteArrayContents# barr#) in case action addr of { IO action' -> case action' s2 of { (# s3, r #) -> case touch# barr# s3 of { s4 -> (# s4, r #) }}}}}
408
false
true
0
24
133
193
99
94
null
null
Teaspot-Studio/gore-and-ash-game
src/client/Math/Plane.hs
bsd-3-clause
colinearAll2D :: Vector (V2 Float) -> Bool colinearAll2D vs2 | V.length vs2 < 3 = False | otherwise = muts where vs = fmap (\(V2 x y) -> (V3 x y 0)) vs2 muts = and $ V.concatMap (\a -> V.concatMap (\b -> fmap (colinear a b) . V.filter (\v -> (v /= a) && (v /= b)) $ vs ) . V.filter (/= a) $ vs) vs
311
colinearAll2D :: Vector (V2 Float) -> Bool colinearAll2D vs2 | V.length vs2 < 3 = False | otherwise = muts where vs = fmap (\(V2 x y) -> (V3 x y 0)) vs2 muts = and $ V.concatMap (\a -> V.concatMap (\b -> fmap (colinear a b) . V.filter (\v -> (v /= a) && (v /= b)) $ vs ) . V.filter (/= a) $ vs) vs
311
colinearAll2D vs2 | V.length vs2 < 3 = False | otherwise = muts where vs = fmap (\(V2 x y) -> (V3 x y 0)) vs2 muts = and $ V.concatMap (\a -> V.concatMap (\b -> fmap (colinear a b) . V.filter (\v -> (v /= a) && (v /= b)) $ vs ) . V.filter (/= a) $ vs) vs
268
false
true
2
21
81
193
98
95
null
null
tamarin-prover/tamarin-prover
src/Web/Hamlet.hs
gpl-3.0
-- | Theory path, displayed when loading main screen for first time. pathDiffTpl :: RenderUrl -> DiffTheoryInfo -- ^ The theory -> DiffTheoryPath -- ^ Path to display on load -> IO Widget pathDiffTpl renderUrl info path = return $ [whamlet| $newline never #{htmlDiffThyPath renderUrl info path} |]
373
pathDiffTpl :: RenderUrl -> DiffTheoryInfo -- ^ The theory -> DiffTheoryPath -- ^ Path to display on load -> IO Widget pathDiffTpl renderUrl info path = return $ [whamlet| $newline never #{htmlDiffThyPath renderUrl info path} |]
304
pathDiffTpl renderUrl info path = return $ [whamlet| $newline never #{htmlDiffThyPath renderUrl info path} |]
145
true
true
0
8
123
44
25
19
null
null
TomMD/ghc
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
bsd-3-clause
{- | @reifyFixity nm@ returns the fixity of @nm@. If a fixity value cannot be found, 'defaultFixity' is returned. -} reifyFixity :: Name -> Q Fixity reifyFixity nm = Q (qReifyFixity nm)
185
reifyFixity :: Name -> Q Fixity reifyFixity nm = Q (qReifyFixity nm)
68
reifyFixity nm = Q (qReifyFixity nm)
36
true
true
0
7
31
35
16
19
null
null
haslab/SecreC
src/Language/SecreC/TypeChecker/Statement.hs
gpl-3.0
tcStmt ret (AnnStatement l ann) = tcStmtBlock l "annotation statement" $ do (ann') <- mapM tcStmtAnn ann let t = StmtType $ Set.singleton $ StmtFallthru $ ComplexT Void return (AnnStatement (Typed l t) ann',t)
221
tcStmt ret (AnnStatement l ann) = tcStmtBlock l "annotation statement" $ do (ann') <- mapM tcStmtAnn ann let t = StmtType $ Set.singleton $ StmtFallthru $ ComplexT Void return (AnnStatement (Typed l t) ann',t)
221
tcStmt ret (AnnStatement l ann) = tcStmtBlock l "annotation statement" $ do (ann') <- mapM tcStmtAnn ann let t = StmtType $ Set.singleton $ StmtFallthru $ ComplexT Void return (AnnStatement (Typed l t) ann',t)
221
false
false
0
14
45
94
44
50
null
null
swift-nav/ecstatic
Development/Ecstatic/BoundsCheck.hs
bsd-2-clause
-- for loop of the form: for (i = lower; i <= upper; i++) { s; } subForL' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s = if ii == i && iii == i -- substitute lower bound on i == lower then subForL $ substitute i lower s else s
295
subForL' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s = if ii == i && iii == i -- substitute lower bound on i == lower then subForL $ substitute i lower s else s
230
subForL' i lower (Just (CBinary CLeqOp (CVar ii n1) upper n2)) (Just (CUnary CPostIncOp (CVar iii n3) n4)) s = if ii == i && iii == i -- substitute lower bound on i == lower then subForL $ substitute i lower s else s
230
true
false
0
11
75
100
51
49
null
null
blanu/arbre-go
Arbre/OldNative.hs
gpl-2.0
functionToMethod :: String -> Def functionToMethod op = Def op (BlockExp $ Block ["x"] (NativeCall op [(Symref Value ""), (Symref Local "x")]))
143
functionToMethod :: String -> Def functionToMethod op = Def op (BlockExp $ Block ["x"] (NativeCall op [(Symref Value ""), (Symref Local "x")]))
143
functionToMethod op = Def op (BlockExp $ Block ["x"] (NativeCall op [(Symref Value ""), (Symref Local "x")]))
109
false
true
0
13
21
73
36
37
null
null
bergmark/clay
src/Clay/Transform.hs
bsd-3-clause
rotateZ z = Transformation ("rotateZ(" <> value z <> ")")
57
rotateZ z = Transformation ("rotateZ(" <> value z <> ")")
57
rotateZ z = Transformation ("rotateZ(" <> value z <> ")")
57
false
false
0
9
9
26
12
14
null
null
HIPERFIT/futhark
src/Language/Futhark/Interpreter.hs
isc
breakOnNaN :: [PrimValue] -> PrimValue -> EvalM () breakOnNaN inputs result | not (any nanValue inputs) && nanValue result = do backtrace <- asks fst case NE.nonEmpty backtrace of Nothing -> return () Just backtrace' -> let loc = stackFrameLoc $ NE.head backtrace' in liftF $ ExtOpBreak loc BreakNaN backtrace' ()
352
breakOnNaN :: [PrimValue] -> PrimValue -> EvalM () breakOnNaN inputs result | not (any nanValue inputs) && nanValue result = do backtrace <- asks fst case NE.nonEmpty backtrace of Nothing -> return () Just backtrace' -> let loc = stackFrameLoc $ NE.head backtrace' in liftF $ ExtOpBreak loc BreakNaN backtrace' ()
352
breakOnNaN inputs result | not (any nanValue inputs) && nanValue result = do backtrace <- asks fst case NE.nonEmpty backtrace of Nothing -> return () Just backtrace' -> let loc = stackFrameLoc $ NE.head backtrace' in liftF $ ExtOpBreak loc BreakNaN backtrace' ()
301
false
true
0
17
89
133
60
73
null
null
vipo/TicTacToe
src/Domain.hs
bsd-3-clause
fromArrayOfMaps _ = Nothing
27
fromArrayOfMaps _ = Nothing
27
fromArrayOfMaps _ = Nothing
27
false
false
0
5
3
9
4
5
null
null
Frefreak/hearthstone-cardsearch
client/src/JavaScript/JQuery.hs
bsd-3-clause
getOuterWidth :: Bool -- ^ include margin? -> JQuery -> IO Double getOuterWidth b = jq_getOuterWidth b
133
getOuterWidth :: Bool -- ^ include margin? -> JQuery -> IO Double getOuterWidth b = jq_getOuterWidth b
133
getOuterWidth b = jq_getOuterWidth b
36
false
true
0
8
47
33
15
18
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileSub :: Expr a -> Expr a -> String compileSub = compileInfixSubExpr "-"
77
compileSub :: Expr a -> Expr a -> String compileSub = compileInfixSubExpr "-"
77
compileSub = compileInfixSubExpr "-"
36
false
true
0
7
12
28
13
15
null
null
athanclark/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
pexp t = PExp 1 [] (sMN 0 "arg") t
34
pexp t = PExp 1 [] (sMN 0 "arg") t
34
pexp t = PExp 1 [] (sMN 0 "arg") t
34
false
false
1
7
9
32
13
19
null
null
exclipy/pdata
Data/BitUtil.hs
bsd-3-clause
bitCount8 229 = 5
17
bitCount8 229 = 5
17
bitCount8 229 = 5
17
false
false
0
5
3
9
4
5
null
null
tadeuzagallo/verve-lang
src/Bytecode/Compiler.hs
mit
updateCurrentBlock :: (Block -> Block) -> BC () updateCurrentBlock f = modify $ \s -> s { currentBlock = f (currentBlock s) }
127
updateCurrentBlock :: (Block -> Block) -> BC () updateCurrentBlock f = modify $ \s -> s { currentBlock = f (currentBlock s) }
127
updateCurrentBlock f = modify $ \s -> s { currentBlock = f (currentBlock s) }
79
false
true
2
10
24
65
31
34
null
null
DaMSL/K3
src/Language/K3/Interpreter/Data/Accessors.hs
apache-2.0
getWatchedVariables :: UID -> Interpretation [Identifier] getWatchedVariables uid = get >>= return . maybe [] id . lookup uid . watchedVars . getTracer
151
getWatchedVariables :: UID -> Interpretation [Identifier] getWatchedVariables uid = get >>= return . maybe [] id . lookup uid . watchedVars . getTracer
151
getWatchedVariables uid = get >>= return . maybe [] id . lookup uid . watchedVars . getTracer
93
false
true
0
10
22
54
26
28
null
null
jchmrt/btjchm
Parsers.hs
mit
parseNickMessage :: IRCParser () parseNickMessage = do char ':' oldNick <- parseTill '!' parseWord parseWord char ':' newNick <- parseWord onlineUsers <- getOnlineUsers let maybeMsg = M.findWithDefault Nothing oldNick onlineUsers removeOnlineUser oldNick case maybeMsg of Nothing -> addOnlineUser newNick Just msg -> addAfkUserWithMessage newNick msg
376
parseNickMessage :: IRCParser () parseNickMessage = do char ':' oldNick <- parseTill '!' parseWord parseWord char ':' newNick <- parseWord onlineUsers <- getOnlineUsers let maybeMsg = M.findWithDefault Nothing oldNick onlineUsers removeOnlineUser oldNick case maybeMsg of Nothing -> addOnlineUser newNick Just msg -> addAfkUserWithMessage newNick msg
376
parseNickMessage = do char ':' oldNick <- parseTill '!' parseWord parseWord char ':' newNick <- parseWord onlineUsers <- getOnlineUsers let maybeMsg = M.findWithDefault Nothing oldNick onlineUsers removeOnlineUser oldNick case maybeMsg of Nothing -> addOnlineUser newNick Just msg -> addAfkUserWithMessage newNick msg
343
false
true
1
12
70
111
47
64
null
null
abayley/netpoll
src/Network/Protocol/SNMP/UDP.hs
gpl-3.0
snmpTypeVarbindNoInstance :: Word.Word8 snmpTypeVarbindNoInstance = 129
71
snmpTypeVarbindNoInstance :: Word.Word8 snmpTypeVarbindNoInstance = 129
71
snmpTypeVarbindNoInstance = 129
31
false
true
0
5
5
13
7
6
null
null
asivitz/Hickory
Hickory/Graphics/Debug.hs
mit
colors = [rgb 1 1 0, rgb 0 1 1, rgb 1 0 1, rgb 1 1 1, rgb 1 0.7 0.4, rgb 1 0.4 0.7, rgb 0.7 1 0.4, rgb 0.7 0.4 1, rgb 0.4 1 0.7, rgb 0.4 0.7 1 ]
244
colors = [rgb 1 1 0, rgb 0 1 1, rgb 1 0 1, rgb 1 1 1, rgb 1 0.7 0.4, rgb 1 0.4 0.7, rgb 0.7 1 0.4, rgb 0.7 0.4 1, rgb 0.4 1 0.7, rgb 0.4 0.7 1 ]
244
colors = [rgb 1 1 0, rgb 0 1 1, rgb 1 0 1, rgb 1 1 1, rgb 1 0.7 0.4, rgb 1 0.4 0.7, rgb 0.7 1 0.4, rgb 0.7 0.4 1, rgb 0.4 1 0.7, rgb 0.4 0.7 1 ]
244
false
false
1
7
142
110
53
57
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/GTEQ_1.hs
mit
esEsOrdering EQ LT = MyFalse
28
esEsOrdering EQ LT = MyFalse
28
esEsOrdering EQ LT = MyFalse
28
false
false
0
5
4
11
5
6
null
null
ihc/futhark
src/Futhark/Analysis/HORepresentation/MapNest.hs
isc
typeOf (MapNest w _ (nest:_) _) = map (`arrayOfRow` w) $ nestingReturnType nest
81
typeOf (MapNest w _ (nest:_) _) = map (`arrayOfRow` w) $ nestingReturnType nest
81
typeOf (MapNest w _ (nest:_) _) = map (`arrayOfRow` w) $ nestingReturnType nest
81
false
false
0
9
14
44
23
21
null
null
garetxe/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
uploadCommand :: CommandUI UploadFlags uploadCommand = CommandUI { commandName = "upload", commandSynopsis = "Uploads source packages or documentation to Hackage.", commandDescription = Nothing, commandNotes = Just $ \_ -> "You can store your Hackage login in the ~/.cabal/config file\n" ++ relevantConfigValuesText ["username", "password"], commandUsage = \pname -> "Usage: " ++ pname ++ " upload [FLAGS] TARFILES\n", commandDefaultFlags = defaultUploadFlags, commandOptions = \_ -> [optionVerbosity uploadVerbosity (\v flags -> flags { uploadVerbosity = v }) ,option ['c'] ["check"] "Do not upload, just do QA checks." uploadCheck (\v flags -> flags { uploadCheck = v }) trueArg ,option ['d'] ["documentation"] "Upload documentation instead of a source package. Cannot be used together with --check." uploadDoc (\v flags -> flags { uploadDoc = v }) trueArg ,option ['u'] ["username"] "Hackage username." uploadUsername (\v flags -> flags { uploadUsername = v }) (reqArg' "USERNAME" (toFlag . Username) (flagToList . fmap unUsername)) ,option ['p'] ["password"] "Hackage password." uploadPassword (\v flags -> flags { uploadPassword = v }) (reqArg' "PASSWORD" (toFlag . Password) (flagToList . fmap unPassword)) ,option ['P'] ["password-command"] "Command to get Hackage password." uploadPasswordCmd (\v flags -> flags { uploadPasswordCmd = v }) (reqArg' "PASSWORD" (Flag . words) (fromMaybe [] . flagToMaybe)) ] }
1,725
uploadCommand :: CommandUI UploadFlags uploadCommand = CommandUI { commandName = "upload", commandSynopsis = "Uploads source packages or documentation to Hackage.", commandDescription = Nothing, commandNotes = Just $ \_ -> "You can store your Hackage login in the ~/.cabal/config file\n" ++ relevantConfigValuesText ["username", "password"], commandUsage = \pname -> "Usage: " ++ pname ++ " upload [FLAGS] TARFILES\n", commandDefaultFlags = defaultUploadFlags, commandOptions = \_ -> [optionVerbosity uploadVerbosity (\v flags -> flags { uploadVerbosity = v }) ,option ['c'] ["check"] "Do not upload, just do QA checks." uploadCheck (\v flags -> flags { uploadCheck = v }) trueArg ,option ['d'] ["documentation"] "Upload documentation instead of a source package. Cannot be used together with --check." uploadDoc (\v flags -> flags { uploadDoc = v }) trueArg ,option ['u'] ["username"] "Hackage username." uploadUsername (\v flags -> flags { uploadUsername = v }) (reqArg' "USERNAME" (toFlag . Username) (flagToList . fmap unUsername)) ,option ['p'] ["password"] "Hackage password." uploadPassword (\v flags -> flags { uploadPassword = v }) (reqArg' "PASSWORD" (toFlag . Password) (flagToList . fmap unPassword)) ,option ['P'] ["password-command"] "Command to get Hackage password." uploadPasswordCmd (\v flags -> flags { uploadPasswordCmd = v }) (reqArg' "PASSWORD" (Flag . words) (fromMaybe [] . flagToMaybe)) ] }
1,725
uploadCommand = CommandUI { commandName = "upload", commandSynopsis = "Uploads source packages or documentation to Hackage.", commandDescription = Nothing, commandNotes = Just $ \_ -> "You can store your Hackage login in the ~/.cabal/config file\n" ++ relevantConfigValuesText ["username", "password"], commandUsage = \pname -> "Usage: " ++ pname ++ " upload [FLAGS] TARFILES\n", commandDefaultFlags = defaultUploadFlags, commandOptions = \_ -> [optionVerbosity uploadVerbosity (\v flags -> flags { uploadVerbosity = v }) ,option ['c'] ["check"] "Do not upload, just do QA checks." uploadCheck (\v flags -> flags { uploadCheck = v }) trueArg ,option ['d'] ["documentation"] "Upload documentation instead of a source package. Cannot be used together with --check." uploadDoc (\v flags -> flags { uploadDoc = v }) trueArg ,option ['u'] ["username"] "Hackage username." uploadUsername (\v flags -> flags { uploadUsername = v }) (reqArg' "USERNAME" (toFlag . Username) (flagToList . fmap unUsername)) ,option ['p'] ["password"] "Hackage password." uploadPassword (\v flags -> flags { uploadPassword = v }) (reqArg' "PASSWORD" (toFlag . Password) (flagToList . fmap unPassword)) ,option ['P'] ["password-command"] "Command to get Hackage password." uploadPasswordCmd (\v flags -> flags { uploadPasswordCmd = v }) (reqArg' "PASSWORD" (Flag . words) (fromMaybe [] . flagToMaybe)) ] }
1,686
false
true
1
16
508
411
231
180
null
null
yesodweb/persistent
persistent/test/main.hs
mit
main :: IO () main = hspec $ do describe "Database" $ describe "Persist" $ do THSpec.spec QuasiSpec.spec ClassSpec.spec PersistValueSpec.spec
177
main :: IO () main = hspec $ do describe "Database" $ describe "Persist" $ do THSpec.spec QuasiSpec.spec ClassSpec.spec PersistValueSpec.spec
177
main = hspec $ do describe "Database" $ describe "Persist" $ do THSpec.spec QuasiSpec.spec ClassSpec.spec PersistValueSpec.spec
163
false
true
2
11
55
64
26
38
null
null
kawamuray/ganeti
src/Ganeti/OpParams.hs
gpl-2.0
pNetworkAddress4 :: Field pNetworkAddress4 = withDoc "Network address (IPv4 subnet)" . renameField "NetworkAddress4" $ simpleField "network" [t| IPv4Network |]
165
pNetworkAddress4 :: Field pNetworkAddress4 = withDoc "Network address (IPv4 subnet)" . renameField "NetworkAddress4" $ simpleField "network" [t| IPv4Network |]
165
pNetworkAddress4 = withDoc "Network address (IPv4 subnet)" . renameField "NetworkAddress4" $ simpleField "network" [t| IPv4Network |]
139
false
true
0
7
24
34
18
16
null
null
julienschmaltz/madl
src/Parser/MadlTypeChecker.hs
mit
typecheckTransitionContent :: Context -> (ProcessContext, [WithSourceInfo TransitionContent]) -> WithSourceInfo TransitionContent -> Checked (ProcessContext, [WithSourceInfo TransitionContent]) typecheckTransitionContent context (pcontext, checkedcontents) content = case removeSourceInfo content of TransitionRead channelname vtype vname -> combine checkedContext checkedContent where checkedContent = liftM3 TransitionRead checkedChannel checkedType (Right vname) checkedContext = addVariableToProcessContext context pcontext (setSource vname) vtype checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedType = typecheckTypeExpression context $ setSource vtype TransitionWrite channelname dataexpr -> combine (Right pcontext) checkedContent where checkedContent = liftM2 TransitionWrite checkedChannel checkedData checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedData = typecheckDataExpression context (toFunctionContext context pcontext) $ setSource dataexpr TransitionNext state arguments -> combine (Right pcontext) checkedContent where checkedContent = fmap (TransitionNext state) checkedArguments checkedArguments = typecheckVariablesMatch context fcontext (setSource arguments) =<< inputTypes fcontext = toFunctionContext context pcontext inputTypes = case Hash.lookup state $ processStates pcontext of Nothing -> Left . setSource $ UnknownStateError state Just (_, ts) -> Right ts TransitionGuard bool -> combine (Right pcontext) checkedContent where checkedContent = fmap TransitionGuard checkedBool checkedBool = typecheckBooleanExpression context (toFunctionContext context pcontext) $ setSource bool where combine = liftM2 (\cntxt cntnt -> (cntxt, (setSource cntnt):checkedcontents)) checkChannelSize (chan, size) = case size of 1 -> Right chan; s -> Left $ setSourceInfo (IllegalProcessChannelError chan s) content setSource = flip setSourceInfo content -- | Context of a process
2,217
typecheckTransitionContent :: Context -> (ProcessContext, [WithSourceInfo TransitionContent]) -> WithSourceInfo TransitionContent -> Checked (ProcessContext, [WithSourceInfo TransitionContent]) typecheckTransitionContent context (pcontext, checkedcontents) content = case removeSourceInfo content of TransitionRead channelname vtype vname -> combine checkedContext checkedContent where checkedContent = liftM3 TransitionRead checkedChannel checkedType (Right vname) checkedContext = addVariableToProcessContext context pcontext (setSource vname) vtype checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedType = typecheckTypeExpression context $ setSource vtype TransitionWrite channelname dataexpr -> combine (Right pcontext) checkedContent where checkedContent = liftM2 TransitionWrite checkedChannel checkedData checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedData = typecheckDataExpression context (toFunctionContext context pcontext) $ setSource dataexpr TransitionNext state arguments -> combine (Right pcontext) checkedContent where checkedContent = fmap (TransitionNext state) checkedArguments checkedArguments = typecheckVariablesMatch context fcontext (setSource arguments) =<< inputTypes fcontext = toFunctionContext context pcontext inputTypes = case Hash.lookup state $ processStates pcontext of Nothing -> Left . setSource $ UnknownStateError state Just (_, ts) -> Right ts TransitionGuard bool -> combine (Right pcontext) checkedContent where checkedContent = fmap TransitionGuard checkedBool checkedBool = typecheckBooleanExpression context (toFunctionContext context pcontext) $ setSource bool where combine = liftM2 (\cntxt cntnt -> (cntxt, (setSource cntnt):checkedcontents)) checkChannelSize (chan, size) = case size of 1 -> Right chan; s -> Left $ setSourceInfo (IllegalProcessChannelError chan s) content setSource = flip setSourceInfo content -- | Context of a process
2,217
typecheckTransitionContent context (pcontext, checkedcontents) content = case removeSourceInfo content of TransitionRead channelname vtype vname -> combine checkedContext checkedContent where checkedContent = liftM3 TransitionRead checkedChannel checkedType (Right vname) checkedContext = addVariableToProcessContext context pcontext (setSource vname) vtype checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedType = typecheckTypeExpression context $ setSource vtype TransitionWrite channelname dataexpr -> combine (Right pcontext) checkedContent where checkedContent = liftM2 TransitionWrite checkedChannel checkedData checkedChannel = checkChannelSize =<< typecheckChannelVariable context (setSource channelname) checkedData = typecheckDataExpression context (toFunctionContext context pcontext) $ setSource dataexpr TransitionNext state arguments -> combine (Right pcontext) checkedContent where checkedContent = fmap (TransitionNext state) checkedArguments checkedArguments = typecheckVariablesMatch context fcontext (setSource arguments) =<< inputTypes fcontext = toFunctionContext context pcontext inputTypes = case Hash.lookup state $ processStates pcontext of Nothing -> Left . setSource $ UnknownStateError state Just (_, ts) -> Right ts TransitionGuard bool -> combine (Right pcontext) checkedContent where checkedContent = fmap TransitionGuard checkedBool checkedBool = typecheckBooleanExpression context (toFunctionContext context pcontext) $ setSource bool where combine = liftM2 (\cntxt cntnt -> (cntxt, (setSource cntnt):checkedcontents)) checkChannelSize (chan, size) = case size of 1 -> Right chan; s -> Left $ setSourceInfo (IllegalProcessChannelError chan s) content setSource = flip setSourceInfo content -- | Context of a process
1,997
false
true
2
14
436
546
265
281
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/Types/RefType.hs
bsd-3-clause
subsFrees m s zs t = foldl' (flip(subsFree m s)) t zs
53
subsFrees m s zs t = foldl' (flip(subsFree m s)) t zs
53
subsFrees m s zs t = foldl' (flip(subsFree m s)) t zs
53
false
false
1
9
11
42
17
25
null
null
mimi1vx/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkArithmeticOpCommand2 = verify checkArithmeticOpCommand "foo=bar * 2"
78
prop_checkArithmeticOpCommand2 = verify checkArithmeticOpCommand "foo=bar * 2"
78
prop_checkArithmeticOpCommand2 = verify checkArithmeticOpCommand "foo=bar * 2"
78
false
false
1
5
6
14
5
9
null
null
k-bx/stack
src/Stack/PackageDump.hs
bsd-3-clause
-- | Load a @InstalledCache@ from disk, swallowing any errors and returning an -- empty cache. loadInstalledCache :: MonadIO m => Path Abs File -> m InstalledCache loadInstalledCache path = do m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty) liftIO $ fmap InstalledCache $ newIORef m -- | Save a @InstalledCache@ to disk
363
loadInstalledCache :: MonadIO m => Path Abs File -> m InstalledCache loadInstalledCache path = do m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty) liftIO $ fmap InstalledCache $ newIORef m -- | Save a @InstalledCache@ to disk
268
loadInstalledCache path = do m <- taggedDecodeOrLoad (toFilePath path) (return $ InstalledCacheInner Map.empty) liftIO $ fmap InstalledCache $ newIORef m -- | Save a @InstalledCache@ to disk
199
true
true
0
12
62
83
39
44
null
null
alekhin0w/unicorn
bindings/haskell/src/Unicorn.hs
gpl-2.0
errno :: Engine -- ^ 'Unicorn' engine handle -> Emulator Error -- ^ The last 'Error' code errno = lift . ucErrno
130
errno :: Engine -- ^ 'Unicorn' engine handle -> Emulator Error errno = lift . ucErrno
103
errno = lift . ucErrno
26
true
true
1
7
39
31
14
17
null
null
Dridus/embot
src/Embot/SlackState.hs
bsd-3-clause
imsWire :: forall m. MinimalEmbotMonad m => RtmStartRp -> EmbotWire m (Event RtmEvent) (Event (Map (ID IM) IM)) imsWire rtmStartRp = accumEM k (Map.fromList . map (view imID &&& id) $ view rtmStartIMs rtmStartRp) >>> filterSameE where k is = (($ is) <$>) . \ case RtmIMCreated (view imCreatedChannel -> i) -> do logIm "IM created" i pure $ Map.insert (view imID i) i RtmIMOpen (view chatUserChannelID -> iID) -> do logId "IM opened" iID is pure $ Map.adjust (imIsOpen .~ True) iID RtmIMClose (view chatUserChannelID -> iID) -> do logId "IM closed" iID is pure $ Map.adjust (imIsOpen .~ False) iID _ -> pure id logIm :: Text -> IM -> m () logIm prefix i = $logInfo $ prefix ++ " " ++ idedName (to $ const "IM") imUser i logId :: Text -> ID IM -> Map (ID IM) IM -> m () logId prefix iID = traverse_ (logIm prefix) . headMay . Map.lookup iID
950
imsWire :: forall m. MinimalEmbotMonad m => RtmStartRp -> EmbotWire m (Event RtmEvent) (Event (Map (ID IM) IM)) imsWire rtmStartRp = accumEM k (Map.fromList . map (view imID &&& id) $ view rtmStartIMs rtmStartRp) >>> filterSameE where k is = (($ is) <$>) . \ case RtmIMCreated (view imCreatedChannel -> i) -> do logIm "IM created" i pure $ Map.insert (view imID i) i RtmIMOpen (view chatUserChannelID -> iID) -> do logId "IM opened" iID is pure $ Map.adjust (imIsOpen .~ True) iID RtmIMClose (view chatUserChannelID -> iID) -> do logId "IM closed" iID is pure $ Map.adjust (imIsOpen .~ False) iID _ -> pure id logIm :: Text -> IM -> m () logIm prefix i = $logInfo $ prefix ++ " " ++ idedName (to $ const "IM") imUser i logId :: Text -> ID IM -> Map (ID IM) IM -> m () logId prefix iID = traverse_ (logIm prefix) . headMay . Map.lookup iID
950
imsWire rtmStartRp = accumEM k (Map.fromList . map (view imID &&& id) $ view rtmStartIMs rtmStartRp) >>> filterSameE where k is = (($ is) <$>) . \ case RtmIMCreated (view imCreatedChannel -> i) -> do logIm "IM created" i pure $ Map.insert (view imID i) i RtmIMOpen (view chatUserChannelID -> iID) -> do logId "IM opened" iID is pure $ Map.adjust (imIsOpen .~ True) iID RtmIMClose (view chatUserChannelID -> iID) -> do logId "IM closed" iID is pure $ Map.adjust (imIsOpen .~ False) iID _ -> pure id logIm :: Text -> IM -> m () logIm prefix i = $logInfo $ prefix ++ " " ++ idedName (to $ const "IM") imUser i logId :: Text -> ID IM -> Map (ID IM) IM -> m () logId prefix iID = traverse_ (logIm prefix) . headMay . Map.lookup iID
838
false
true
0
14
269
412
196
216
null
null
manasij7479/hasnake
main.hs
gpl-3.0
myshowList [] = ""
18
myshowList [] = ""
18
myshowList [] = ""
18
false
false
1
5
3
15
5
10
null
null
ekinan/HaskellTurtleGraphics
src/TProgram/Textual.hs
bsd-3-clause
-- Nothing happens in the Idle program animateTextual' tur Pause = animateTurtle id "Turtle pauses!\n" tur
109
animateTextual' tur Pause = animateTurtle id "Turtle pauses!\n" tur
67
animateTextual' tur Pause = animateTurtle id "Turtle pauses!\n" tur
67
true
false
1
5
18
23
9
14
null
null
corngood/cabal
Cabal/Distribution/Simple/Utils.hs
bsd-3-clause
printRawCommandAndArgsAndEnv :: Verbosity -> FilePath -> [String] -> Maybe [(String, String)] -> IO () printRawCommandAndArgsAndEnv verbosity path args menv | verbosity >= deafening = do traverse_ (putStrLn . ("Environment: " ++) . show) menv print (path, args) | verbosity >= verbose = putStrLn $ showCommandForUser path args | otherwise = return ()
498
printRawCommandAndArgsAndEnv :: Verbosity -> FilePath -> [String] -> Maybe [(String, String)] -> IO () printRawCommandAndArgsAndEnv verbosity path args menv | verbosity >= deafening = do traverse_ (putStrLn . ("Environment: " ++) . show) menv print (path, args) | verbosity >= verbose = putStrLn $ showCommandForUser path args | otherwise = return ()
498
printRawCommandAndArgsAndEnv verbosity path args menv | verbosity >= deafening = do traverse_ (putStrLn . ("Environment: " ++) . show) menv print (path, args) | verbosity >= verbose = putStrLn $ showCommandForUser path args | otherwise = return ()
279
false
true
2
13
199
136
67
69
null
null
fpco/schoolofhaskell.com
src/Azure/BlobStorage/Util.hs
mit
asciiLowercase :: ByteString -> ByteString asciiLowercase = Char8.map Char.toLower
82
asciiLowercase :: ByteString -> ByteString asciiLowercase = Char8.map Char.toLower
82
asciiLowercase = Char8.map Char.toLower
39
false
true
0
6
8
22
11
11
null
null
elieux/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
48
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
48
gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
48
false
false
0
7
4
15
7
8
null
null
nevrenato/HetsAlloy
QBF/Sublogic.hs
gpl-2.0
-- | determines sublogic for flattened formula slFlForm :: QBFSL -> [AS_BASIC.FORMULA] -> QBFSL slFlForm ps = foldl sublogicsMax ps . map (\ x -> State.evalState (anaForm ps x) 0)
181
slFlForm :: QBFSL -> [AS_BASIC.FORMULA] -> QBFSL slFlForm ps = foldl sublogicsMax ps . map (\ x -> State.evalState (anaForm ps x) 0)
134
slFlForm ps = foldl sublogicsMax ps . map (\ x -> State.evalState (anaForm ps x) 0)
85
true
true
1
10
31
64
32
32
null
null
haasn/colour
Data/Colour/CIE/Illuminant.hs
mit
-- |North sky Daylight d75 :: (Fractional a) => Chromaticity a d75 = mkChromaticity 0.29902 0.31485
99
d75 :: (Fractional a) => Chromaticity a d75 = mkChromaticity 0.29902 0.31485
76
d75 = mkChromaticity 0.29902 0.31485
36
true
true
0
6
15
29
15
14
null
null
feuerbach/traverse-with-class
Data/Generics/Traversable/Zipper.hs
mit
-- | Apply a generic transformation to the hole. trans :: (forall d . Rec c d => d -> d) -> Zipper c a -> Zipper c a trans f (Zipper hole ctxt) = Zipper (f hole) ctxt
170
trans :: (forall d . Rec c d => d -> d) -> Zipper c a -> Zipper c a trans f (Zipper hole ctxt) = Zipper (f hole) ctxt
121
trans f (Zipper hole ctxt) = Zipper (f hole) ctxt
49
true
true
0
10
42
79
38
41
null
null
Jonplussed/midi-free
src/Sound/MIDI/Values/Note.hs
gpl-3.0
dSharp1 = Note 15
18
dSharp1 = Note 15
18
dSharp1 = Note 15
18
false
false
0
5
4
9
4
5
null
null
rfranek/duckling
Duckling/Time/SV/Rules.hs
bsd-3-clause
ruleUntilTimeofday :: Rule ruleUntilTimeofday = Rule { name = "until <time-of-day>" , pattern = [ regex "innan|f\x00f6re|intill" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ withDirection TTime.Before td _ -> Nothing }
295
ruleUntilTimeofday :: Rule ruleUntilTimeofday = Rule { name = "until <time-of-day>" , pattern = [ regex "innan|f\x00f6re|intill" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ withDirection TTime.Before td _ -> Nothing }
295
ruleUntilTimeofday = Rule { name = "until <time-of-day>" , pattern = [ regex "innan|f\x00f6re|intill" , dimension Time ] , prod = \tokens -> case tokens of (_:Token Time td:_) -> tt $ withDirection TTime.Before td _ -> Nothing }
268
false
true
0
15
81
95
50
45
null
null
mettekou/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
extendScopeList :: [Var] -> DFFV a -> DFFV a extendScopeList vs (DFFV f) = DFFV (\env st -> f (extendVarSetList env vs) st)
123
extendScopeList :: [Var] -> DFFV a -> DFFV a extendScopeList vs (DFFV f) = DFFV (\env st -> f (extendVarSetList env vs) st)
123
extendScopeList vs (DFFV f) = DFFV (\env st -> f (extendVarSetList env vs) st)
78
false
true
0
10
22
70
33
37
null
null
sgillespie/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
-- | Like 'tcSplitPiTys', but splits off only named binders, returning -- just the tycovars. tcSplitForAllTys :: Type -> ([TyVar], Type) tcSplitForAllTys = splitForAllTys
170
tcSplitForAllTys :: Type -> ([TyVar], Type) tcSplitForAllTys = splitForAllTys
77
tcSplitForAllTys = splitForAllTys
33
true
true
0
7
23
26
16
10
null
null
seckcoder/vector
Data/Vector/Storable.hs
bsd-3-clause
unsafeFromForeignPtr fp i n = unsafeFromForeignPtr0 fp' n where fp' = updPtr (`advancePtr` i) fp
108
unsafeFromForeignPtr fp i n = unsafeFromForeignPtr0 fp' n where fp' = updPtr (`advancePtr` i) fp
108
unsafeFromForeignPtr fp i n = unsafeFromForeignPtr0 fp' n where fp' = updPtr (`advancePtr` i) fp
108
false
false
1
6
26
43
19
24
null
null
thomasjm/IHaskell
ghc-parser/generic-src/Language/Haskell/GHC/Parser.hs
mit
parserImport = Parser Parse.fullImport
46
parserImport = Parser Parse.fullImport
46
parserImport = Parser Parse.fullImport
46
false
false
0
6
11
11
5
6
null
null
authchir/SoSe17-FFP-haskell-http2-server
src/Frame/Internal/Padding.hs
gpl-3.0
putLength (Just PaddingDesc { ppLength }) = Put.putWord8 ppLength
65
putLength (Just PaddingDesc { ppLength }) = Put.putWord8 ppLength
65
putLength (Just PaddingDesc { ppLength }) = Put.putWord8 ppLength
65
false
false
0
9
8
26
12
14
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
maxEnergy ZergCreepColony = 0
29
maxEnergy ZergCreepColony = 0
29
maxEnergy ZergCreepColony = 0
29
false
false
0
5
3
9
4
5
null
null
pbevin/toycss
src/HtmlDoc.hs
gpl-2.0
isTextNode :: DomNode -> Bool isTextNode node = domId node == "_text"
69
isTextNode :: DomNode -> Bool isTextNode node = domId node == "_text"
69
isTextNode node = domId node == "_text"
39
false
true
1
7
11
34
14
20
null
null
mineo/lb-scrobbler
src/Main.hs
bsd-3-clause
main :: IO () main = do checkEnv token "LISTENBRAINZ_TOKEN" handleResponse (Right [PlayerS]) Nothing
104
main :: IO () main = do checkEnv token "LISTENBRAINZ_TOKEN" handleResponse (Right [PlayerS]) Nothing
104
main = do checkEnv token "LISTENBRAINZ_TOKEN" handleResponse (Right [PlayerS]) Nothing
90
false
true
0
10
17
41
19
22
null
null
NorfairKing/super-user-spark
src/SuperUserSpark/Deployer/Internal.hs
mit
performClean (CleanDirectory fp) = incase deploySetsReplaceDirectories $ rmDir fp
85
performClean (CleanDirectory fp) = incase deploySetsReplaceDirectories $ rmDir fp
85
performClean (CleanDirectory fp) = incase deploySetsReplaceDirectories $ rmDir fp
85
false
false
0
7
12
25
11
14
null
null
cgaebel/network-bitcoin
src/Network/Bitcoin/Wallet.hs
bsd-3-clause
getBitcoindInfo :: Client -> IO BitcoindInfo getBitcoindInfo client = callApi client "getinfo" []
97
getBitcoindInfo :: Client -> IO BitcoindInfo getBitcoindInfo client = callApi client "getinfo" []
97
getBitcoindInfo client = callApi client "getinfo" []
52
false
true
0
6
12
33
15
18
null
null
ezyang/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLabel _ PicBaseLabel | cGhcWithNativeCodeGen == "YES" = text "1b"
73
pprCLabel _ PicBaseLabel | cGhcWithNativeCodeGen == "YES" = text "1b"
73
pprCLabel _ PicBaseLabel | cGhcWithNativeCodeGen == "YES" = text "1b"
73
false
false
1
8
13
26
10
16
null
null
nimia/bottle
bottlelib/Data/Store/Rev/View.hs
gpl-3.0
transaction :: Monad m => View -> [(Change.Key, Maybe Change.Value)] -> Transaction t m () transaction _ [] = return ()
122
transaction :: Monad m => View -> [(Change.Key, Maybe Change.Value)] -> Transaction t m () transaction _ [] = return ()
122
transaction _ [] = return ()
31
false
true
0
11
23
63
31
32
null
null