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
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
confdNodeRoleRegular :: Int confdNodeRoleRegular = Types.confdNodeRoleToRaw NodeRoleRegular
91
confdNodeRoleRegular :: Int confdNodeRoleRegular = Types.confdNodeRoleToRaw NodeRoleRegular
91
confdNodeRoleRegular = Types.confdNodeRoleToRaw NodeRoleRegular
63
false
true
0
6
6
16
8
8
null
null
cullina/Extractor
src/Util.hs
bsd-3-clause
generalizeToList :: ((a, [a]) -> (a, [a])) -> [a] -> [a] generalizeToList f = fromNonemptyList . fmap f . toNonemptyList
120
generalizeToList :: ((a, [a]) -> (a, [a])) -> [a] -> [a] generalizeToList f = fromNonemptyList . fmap f . toNonemptyList
120
generalizeToList f = fromNonemptyList . fmap f . toNonemptyList
63
false
true
0
9
19
64
36
28
null
null
ezyang/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
-- Things defined outside brackets thLevel :: ThStage -> ThLevel thLevel (Splice _) = 0
91
thLevel :: ThStage -> ThLevel thLevel (Splice _) = 0
55
thLevel (Splice _) = 0
25
true
true
0
7
18
25
13
12
null
null
ezyang/ghc
compiler/cmm/CmmCommonBlockElim.hs
bsd-3-clause
mergeBlockList dflags subst (b:bs) = go mapEmpty b bs where go !new_subst1 b [] = (new_subst1, b) go !new_subst1 b1 (b2:bs) = go new_subst b bs where (new_subst2, b) = mergeBlocks dflags subst b1 b2 new_subst = new_subst1 `mapUnion` new_subst2 -- ----------------------------------------------------------------------------- -- Hashing and equality on blocks -- Below here is mostly boilerplate: hashing blocks ignoring labels, -- and comparing blocks modulo a label mapping. -- To speed up comparisons, we hash each basic block modulo jump labels. -- The hashing is a bit arbitrary (the numbers are completely arbitrary), -- but it should be fast and good enough. -- We want to get as many small buckets as possible, as comparing blocks is -- expensive. So include as much as possible in the hash. Ideally everything -- that is compared with (==) in eqBlockBodyWith. {- Note [Equivalence up to local registers in CBE] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CBE treats two blocks which are equivalent up to alpha-renaming of locally-bound local registers as equivalent. This was not always the case (see #14226) but is quite important for effective CBE. For instance, consider the blocks, c2VZ: // global _c2Yd::I64 = _s2Se::I64 + 1; _s2Sx::I64 = _c2Yd::I64; _s2Se::I64 = _s2Sx::I64; goto c2TE; c2VY: // global _c2Yb::I64 = _s2Se::I64 + 1; _s2Sw::I64 = _c2Yb::I64; _s2Se::I64 = _s2Sw::I64; goto c2TE; These clearly implement precisely the same logic, differing only register naming. This happens quite often in the code produced by GHC. This alpha-equivalence relation must be accounted for in two places: 1. the block hash function (hash_block), which we use for approximate "binning" 2. the exact block comparison function, which computes pair-wise equivalence In (1) we maintain a de Bruijn numbering of each block's locally-bound local registers and compute the hash relative to this numbering. For (2) we maintain a substitution which maps the local registers of one block onto those of the other. We then compare local registers modulo this substitution. -}
2,194
mergeBlockList dflags subst (b:bs) = go mapEmpty b bs where go !new_subst1 b [] = (new_subst1, b) go !new_subst1 b1 (b2:bs) = go new_subst b bs where (new_subst2, b) = mergeBlocks dflags subst b1 b2 new_subst = new_subst1 `mapUnion` new_subst2 -- ----------------------------------------------------------------------------- -- Hashing and equality on blocks -- Below here is mostly boilerplate: hashing blocks ignoring labels, -- and comparing blocks modulo a label mapping. -- To speed up comparisons, we hash each basic block modulo jump labels. -- The hashing is a bit arbitrary (the numbers are completely arbitrary), -- but it should be fast and good enough. -- We want to get as many small buckets as possible, as comparing blocks is -- expensive. So include as much as possible in the hash. Ideally everything -- that is compared with (==) in eqBlockBodyWith. {- Note [Equivalence up to local registers in CBE] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CBE treats two blocks which are equivalent up to alpha-renaming of locally-bound local registers as equivalent. This was not always the case (see #14226) but is quite important for effective CBE. For instance, consider the blocks, c2VZ: // global _c2Yd::I64 = _s2Se::I64 + 1; _s2Sx::I64 = _c2Yd::I64; _s2Se::I64 = _s2Sx::I64; goto c2TE; c2VY: // global _c2Yb::I64 = _s2Se::I64 + 1; _s2Sw::I64 = _c2Yb::I64; _s2Se::I64 = _s2Sw::I64; goto c2TE; These clearly implement precisely the same logic, differing only register naming. This happens quite often in the code produced by GHC. This alpha-equivalence relation must be accounted for in two places: 1. the block hash function (hash_block), which we use for approximate "binning" 2. the exact block comparison function, which computes pair-wise equivalence In (1) we maintain a de Bruijn numbering of each block's locally-bound local registers and compute the hash relative to this numbering. For (2) we maintain a substitution which maps the local registers of one block onto those of the other. We then compare local registers modulo this substitution. -}
2,194
mergeBlockList dflags subst (b:bs) = go mapEmpty b bs where go !new_subst1 b [] = (new_subst1, b) go !new_subst1 b1 (b2:bs) = go new_subst b bs where (new_subst2, b) = mergeBlocks dflags subst b1 b2 new_subst = new_subst1 `mapUnion` new_subst2 -- ----------------------------------------------------------------------------- -- Hashing and equality on blocks -- Below here is mostly boilerplate: hashing blocks ignoring labels, -- and comparing blocks modulo a label mapping. -- To speed up comparisons, we hash each basic block modulo jump labels. -- The hashing is a bit arbitrary (the numbers are completely arbitrary), -- but it should be fast and good enough. -- We want to get as many small buckets as possible, as comparing blocks is -- expensive. So include as much as possible in the hash. Ideally everything -- that is compared with (==) in eqBlockBodyWith. {- Note [Equivalence up to local registers in CBE] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CBE treats two blocks which are equivalent up to alpha-renaming of locally-bound local registers as equivalent. This was not always the case (see #14226) but is quite important for effective CBE. For instance, consider the blocks, c2VZ: // global _c2Yd::I64 = _s2Se::I64 + 1; _s2Sx::I64 = _c2Yd::I64; _s2Se::I64 = _s2Sx::I64; goto c2TE; c2VY: // global _c2Yb::I64 = _s2Se::I64 + 1; _s2Sw::I64 = _c2Yb::I64; _s2Se::I64 = _s2Sw::I64; goto c2TE; These clearly implement precisely the same logic, differing only register naming. This happens quite often in the code produced by GHC. This alpha-equivalence relation must be accounted for in two places: 1. the block hash function (hash_block), which we use for approximate "binning" 2. the exact block comparison function, which computes pair-wise equivalence In (1) we maintain a de Bruijn numbering of each block's locally-bound local registers and compute the hash relative to this numbering. For (2) we maintain a substitution which maps the local registers of one block onto those of the other. We then compare local registers modulo this substitution. -}
2,194
false
false
3
7
438
131
67
64
null
null
energyflowanalysis/efa-2.1
test/EFA/Test/StateAnalysis.hs
bsd-3-clause
prop_checkNode :: Node.Type -> Bool -> Bool -> Bool prop_checkNode nt sucActive preActive = StateAnalysis.checkNodeType nt sucActive preActive == Count.checkNodeType nt True sucActive preActive
202
prop_checkNode :: Node.Type -> Bool -> Bool -> Bool prop_checkNode nt sucActive preActive = StateAnalysis.checkNodeType nt sucActive preActive == Count.checkNodeType nt True sucActive preActive
202
prop_checkNode nt sucActive preActive = StateAnalysis.checkNodeType nt sucActive preActive == Count.checkNodeType nt True sucActive preActive
150
false
true
2
7
32
57
27
30
null
null
wayofthepie/pom-analyzer
src/Maven/Analysis.hs
bsd-3-clause
parsePoms :: [FilePath] -> IO [Pom] parsePoms fs = sequence $ map readAndParse fs
81
parsePoms :: [FilePath] -> IO [Pom] parsePoms fs = sequence $ map readAndParse fs
81
parsePoms fs = sequence $ map readAndParse fs
45
false
true
2
8
13
43
19
24
null
null
guoguo12/haskell-ptable
ptable.hs
apache-2.0
awei "Re" = 186.207
19
awei "Re" = 186.207
19
awei "Re" = 186.207
19
false
false
0
4
3
10
4
6
null
null
tsuraan/hs-blake2
src/Crypto/Hash/Tsuraan/Blake2/Parallel.hs
bsd-3-clause
-- |Hash a 'ByteString' into a digest 'ByteString' using a key. This function -- always runs in parallel, which is slower for very small strings but faster -- as the strings get larger. hash_key :: ByteString -- ^The key to hash with -> Int -- ^The digest size to generate; must be 1-64 -> ByteString -- ^The string to hash -> ByteString hash_key key hashlen bytes = runHasher blake2bp key hashlen bytes
437
hash_key :: ByteString -- ^The key to hash with -> Int -- ^The digest size to generate; must be 1-64 -> ByteString -- ^The string to hash -> ByteString hash_key key hashlen bytes = runHasher blake2bp key hashlen bytes
251
hash_key key hashlen bytes = runHasher blake2bp key hashlen bytes
65
true
true
0
7
105
45
25
20
null
null
urbanslug/ghc
testsuite/tests/codeGen/should_run/cgrun028.hs
bsd-3-clause
main = putStr (shows (f (read "42.0")) "\n")
44
main = putStr (shows (f (read "42.0")) "\n")
44
main = putStr (shows (f (read "42.0")) "\n")
44
false
false
1
11
7
33
14
19
null
null
nevrenato/Hets_Fork
Common/Lib/Tabular.hs
gpl-2.0
-- | besides (^..^) :: Table rh ch a -> SemiTable ch a -> Table rh ch a (^..^) = beside NoLine
94
(^..^) :: Table rh ch a -> SemiTable ch a -> Table rh ch a (^..^) = beside NoLine
81
(^..^) = beside NoLine
22
true
true
0
7
21
46
24
22
null
null
beni55/HaskellNet
src/Network/HaskellNet/POP3.hs
bsd-3-clause
doPop3Port :: String -> PortNumber -> (POP3Connection -> IO a) -> IO a doPop3Port host port execution = bracket (connectPop3Port host port) closePop3 execution
163
doPop3Port :: String -> PortNumber -> (POP3Connection -> IO a) -> IO a doPop3Port host port execution = bracket (connectPop3Port host port) closePop3 execution
163
doPop3Port host port execution = bracket (connectPop3Port host port) closePop3 execution
92
false
true
0
10
27
64
29
35
null
null
alphalambda/codeworld
codeworld-base/src/Extras/Colors.hs
apache-2.0
byName("lightpink") = colorNamed'("#ffb6c1")
44
byName("lightpink") = colorNamed'("#ffb6c1")
44
byName("lightpink") = colorNamed'("#ffb6c1")
44
false
false
0
6
2
18
9
9
null
null
GaloisInc/halvm-ghc
compiler/stgSyn/StgLint.hs
bsd-3-clause
lintAlt :: Type -> (AltCon, [Id], [Bool], StgExpr) -> LintM (Maybe Type) lintAlt _ (DEFAULT, _, _, rhs) = lintStgExpr rhs
122
lintAlt :: Type -> (AltCon, [Id], [Bool], StgExpr) -> LintM (Maybe Type) lintAlt _ (DEFAULT, _, _, rhs) = lintStgExpr rhs
122
lintAlt _ (DEFAULT, _, _, rhs) = lintStgExpr rhs
49
false
true
0
10
21
71
38
33
null
null
rzil/honours
LeavittPathAlgebras/FiniteFields.hs
mit
z2 = [Z2_0 .. Z2_1]
19
z2 = [Z2_0 .. Z2_1]
19
z2 = [Z2_0 .. Z2_1]
19
false
false
1
6
4
16
7
9
null
null
aartifact/aartifact-verifier
src/Exp.hs
mit
uv fvs c (Bind o ns e) = uvq fvs c (Bind o) ns e
48
uv fvs c (Bind o ns e) = uvq fvs c (Bind o) ns e
48
uv fvs c (Bind o ns e) = uvq fvs c (Bind o) ns e
48
false
false
0
7
14
44
19
25
null
null
changlinli/nikki
src/Utils.hs
lgpl-3.0
modifyIORefM :: IORef a -> (a -> IO a) -> IO () modifyIORefM ref cmd = readIORef ref >>= cmd >>= writeIORef ref
123
modifyIORefM :: IORef a -> (a -> IO a) -> IO () modifyIORefM ref cmd = readIORef ref >>= cmd >>= writeIORef ref
123
modifyIORefM ref cmd = readIORef ref >>= cmd >>= writeIORef ref
75
false
true
4
10
34
65
29
36
null
null
nevrenato/Hets_Fork
CASL/CCC/FreeTypes.hs
gpl-2.0
{- check if leading symbols are new (not in the image of morphism), if not, return it as proof obligation -} getOPreds :: Morphism () () () -> [Named (FORMULA ())] -> [FORMULA ()] getOPreds m fsn = let sig = imageOfMorphism m oldPredMap = predMap sig axioms = getAxioms fsn pred_fs = filter (\ f -> case leadingSym f of Just (Right _) -> True _ -> False) axioms find_pt (ident, pt) = MapSet.member ident pt oldPredMap in filter (find_pt . head . filterPred . leadingSym) pred_fs
594
getOPreds :: Morphism () () () -> [Named (FORMULA ())] -> [FORMULA ()] getOPreds m fsn = let sig = imageOfMorphism m oldPredMap = predMap sig axioms = getAxioms fsn pred_fs = filter (\ f -> case leadingSym f of Just (Right _) -> True _ -> False) axioms find_pt (ident, pt) = MapSet.member ident pt oldPredMap in filter (find_pt . head . filterPred . leadingSym) pred_fs
475
getOPreds m fsn = let sig = imageOfMorphism m oldPredMap = predMap sig axioms = getAxioms fsn pred_fs = filter (\ f -> case leadingSym f of Just (Right _) -> True _ -> False) axioms find_pt (ident, pt) = MapSet.member ident pt oldPredMap in filter (find_pt . head . filterPred . leadingSym) pred_fs
404
true
true
0
17
203
179
89
90
null
null
simhu/cubical
Eval.hs
mit
conv k (VSPair u v) (VSPair u' v') = conv k u u' && conv k v v'
67
conv k (VSPair u v) (VSPair u' v') = conv k u u' && conv k v v'
67
conv k (VSPair u v) (VSPair u' v') = conv k u u' && conv k v v'
67
false
false
0
6
21
50
22
28
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/main/TidyPgm.hs
bsd-3-clause
findExternalRules :: Bool -- Omit pragmas -> [CoreBind] -> [CoreRule] -- Local rules for imported fns -> UnfoldEnv -- Ids that are exported, so we need their rules -> ([CoreBind], [CoreRule]) -- See Note [Finding external rules] findExternalRules omit_prags binds imp_id_rules unfold_env = (trimmed_binds, filter keep_rule all_rules) where imp_rules = filter expose_rule imp_id_rules imp_user_rule_fvs = mapUnionVarSet user_rule_rhs_fvs imp_rules user_rule_rhs_fvs rule | isAutoRule rule = emptyVarSet | otherwise = ruleRhsFreeVars rule (trimmed_binds, local_bndrs, _, all_rules) = trim_binds binds keep_rule rule = ruleFreeVars rule `subVarSet` local_bndrs -- Remove rules that make no sense, because they mention a -- local binder (on LHS or RHS) that we have now discarded. -- (NB: ruleFreeVars only includes LocalIds) -- -- LHS: we have alrady filtered out rules that mention internal Ids -- on LHS but that isn't enough because we might have by now -- discarded a binding with an external Id. (How? -- chooseExternalIds is a bit conservative.) -- -- RHS: the auto rules that might mention a binder that has -- been discarded; see Note [Trimming auto-rules] expose_rule rule | omit_prags = False | otherwise = all is_external_id (varSetElems (ruleLhsFreeIds rule)) -- Don't expose a rule whose LHS mentions a locally-defined -- Id that is completely internal (i.e. not visible to an -- importing module). NB: ruleLhsFreeIds only returns LocalIds. -- See Note [Which rules to expose] is_external_id id = case lookupVarEnv unfold_env id of Just (name, _) -> isExternalName name Nothing -> False trim_binds :: [CoreBind] -> ( [CoreBind] -- Trimmed bindings , VarSet -- Binders of those bindings , VarSet -- Free vars of those bindings + rhs of user rules -- (we don't bother to delete the binders) , [CoreRule]) -- All rules, imported + from the bindings -- This function removes unnecessary bindings, and gathers up rules from -- the bindings we keep. See Note [Trimming auto-rules] trim_binds [] -- Base case, start with imp_user_rule_fvs = ([], emptyVarSet, imp_user_rule_fvs, imp_rules) trim_binds (bind:binds) | any needed bndrs -- Keep binding = ( bind : binds', bndr_set', needed_fvs', local_rules ++ rules ) | otherwise -- Discard binding altogether = stuff where stuff@(binds', bndr_set, needed_fvs, rules) = trim_binds binds needed bndr = isExportedId bndr || bndr `elemVarSet` needed_fvs bndrs = bindersOf bind rhss = rhssOfBind bind bndr_set' = bndr_set `extendVarSetList` bndrs needed_fvs' = needed_fvs `unionVarSet` mapUnionVarSet idUnfoldingVars bndrs `unionVarSet` -- Ignore type variables in the type of bndrs mapUnionVarSet exprFreeVars rhss `unionVarSet` mapUnionVarSet user_rule_rhs_fvs local_rules -- In needed_fvs', we don't bother to delete binders from the fv set local_rules = [ rule | id <- bndrs , is_external_id id -- Only collect rules for external Ids , rule <- idCoreRules id , expose_rule rule ] -- and ones that can fire in a client {- ************************************************************************ * * tidyTopName * * ************************************************************************ This is where we set names to local/global based on whether they really are externally visible (see comment at the top of this module). If the name was previously local, we have to give it a unique occurrence name if we intend to externalise it. -}
4,525
findExternalRules :: Bool -- Omit pragmas -> [CoreBind] -> [CoreRule] -- Local rules for imported fns -> UnfoldEnv -- Ids that are exported, so we need their rules -> ([CoreBind], [CoreRule]) findExternalRules omit_prags binds imp_id_rules unfold_env = (trimmed_binds, filter keep_rule all_rules) where imp_rules = filter expose_rule imp_id_rules imp_user_rule_fvs = mapUnionVarSet user_rule_rhs_fvs imp_rules user_rule_rhs_fvs rule | isAutoRule rule = emptyVarSet | otherwise = ruleRhsFreeVars rule (trimmed_binds, local_bndrs, _, all_rules) = trim_binds binds keep_rule rule = ruleFreeVars rule `subVarSet` local_bndrs -- Remove rules that make no sense, because they mention a -- local binder (on LHS or RHS) that we have now discarded. -- (NB: ruleFreeVars only includes LocalIds) -- -- LHS: we have alrady filtered out rules that mention internal Ids -- on LHS but that isn't enough because we might have by now -- discarded a binding with an external Id. (How? -- chooseExternalIds is a bit conservative.) -- -- RHS: the auto rules that might mention a binder that has -- been discarded; see Note [Trimming auto-rules] expose_rule rule | omit_prags = False | otherwise = all is_external_id (varSetElems (ruleLhsFreeIds rule)) -- Don't expose a rule whose LHS mentions a locally-defined -- Id that is completely internal (i.e. not visible to an -- importing module). NB: ruleLhsFreeIds only returns LocalIds. -- See Note [Which rules to expose] is_external_id id = case lookupVarEnv unfold_env id of Just (name, _) -> isExternalName name Nothing -> False trim_binds :: [CoreBind] -> ( [CoreBind] -- Trimmed bindings , VarSet -- Binders of those bindings , VarSet -- Free vars of those bindings + rhs of user rules -- (we don't bother to delete the binders) , [CoreRule]) -- All rules, imported + from the bindings -- This function removes unnecessary bindings, and gathers up rules from -- the bindings we keep. See Note [Trimming auto-rules] trim_binds [] -- Base case, start with imp_user_rule_fvs = ([], emptyVarSet, imp_user_rule_fvs, imp_rules) trim_binds (bind:binds) | any needed bndrs -- Keep binding = ( bind : binds', bndr_set', needed_fvs', local_rules ++ rules ) | otherwise -- Discard binding altogether = stuff where stuff@(binds', bndr_set, needed_fvs, rules) = trim_binds binds needed bndr = isExportedId bndr || bndr `elemVarSet` needed_fvs bndrs = bindersOf bind rhss = rhssOfBind bind bndr_set' = bndr_set `extendVarSetList` bndrs needed_fvs' = needed_fvs `unionVarSet` mapUnionVarSet idUnfoldingVars bndrs `unionVarSet` -- Ignore type variables in the type of bndrs mapUnionVarSet exprFreeVars rhss `unionVarSet` mapUnionVarSet user_rule_rhs_fvs local_rules -- In needed_fvs', we don't bother to delete binders from the fv set local_rules = [ rule | id <- bndrs , is_external_id id -- Only collect rules for external Ids , rule <- idCoreRules id , expose_rule rule ] -- and ones that can fire in a client {- ************************************************************************ * * tidyTopName * * ************************************************************************ This is where we set names to local/global based on whether they really are externally visible (see comment at the top of this module). If the name was previously local, we have to give it a unique occurrence name if we intend to externalise it. -}
4,488
findExternalRules omit_prags binds imp_id_rules unfold_env = (trimmed_binds, filter keep_rule all_rules) where imp_rules = filter expose_rule imp_id_rules imp_user_rule_fvs = mapUnionVarSet user_rule_rhs_fvs imp_rules user_rule_rhs_fvs rule | isAutoRule rule = emptyVarSet | otherwise = ruleRhsFreeVars rule (trimmed_binds, local_bndrs, _, all_rules) = trim_binds binds keep_rule rule = ruleFreeVars rule `subVarSet` local_bndrs -- Remove rules that make no sense, because they mention a -- local binder (on LHS or RHS) that we have now discarded. -- (NB: ruleFreeVars only includes LocalIds) -- -- LHS: we have alrady filtered out rules that mention internal Ids -- on LHS but that isn't enough because we might have by now -- discarded a binding with an external Id. (How? -- chooseExternalIds is a bit conservative.) -- -- RHS: the auto rules that might mention a binder that has -- been discarded; see Note [Trimming auto-rules] expose_rule rule | omit_prags = False | otherwise = all is_external_id (varSetElems (ruleLhsFreeIds rule)) -- Don't expose a rule whose LHS mentions a locally-defined -- Id that is completely internal (i.e. not visible to an -- importing module). NB: ruleLhsFreeIds only returns LocalIds. -- See Note [Which rules to expose] is_external_id id = case lookupVarEnv unfold_env id of Just (name, _) -> isExternalName name Nothing -> False trim_binds :: [CoreBind] -> ( [CoreBind] -- Trimmed bindings , VarSet -- Binders of those bindings , VarSet -- Free vars of those bindings + rhs of user rules -- (we don't bother to delete the binders) , [CoreRule]) -- All rules, imported + from the bindings -- This function removes unnecessary bindings, and gathers up rules from -- the bindings we keep. See Note [Trimming auto-rules] trim_binds [] -- Base case, start with imp_user_rule_fvs = ([], emptyVarSet, imp_user_rule_fvs, imp_rules) trim_binds (bind:binds) | any needed bndrs -- Keep binding = ( bind : binds', bndr_set', needed_fvs', local_rules ++ rules ) | otherwise -- Discard binding altogether = stuff where stuff@(binds', bndr_set, needed_fvs, rules) = trim_binds binds needed bndr = isExportedId bndr || bndr `elemVarSet` needed_fvs bndrs = bindersOf bind rhss = rhssOfBind bind bndr_set' = bndr_set `extendVarSetList` bndrs needed_fvs' = needed_fvs `unionVarSet` mapUnionVarSet idUnfoldingVars bndrs `unionVarSet` -- Ignore type variables in the type of bndrs mapUnionVarSet exprFreeVars rhss `unionVarSet` mapUnionVarSet user_rule_rhs_fvs local_rules -- In needed_fvs', we don't bother to delete binders from the fv set local_rules = [ rule | id <- bndrs , is_external_id id -- Only collect rules for external Ids , rule <- idCoreRules id , expose_rule rule ] -- and ones that can fire in a client {- ************************************************************************ * * tidyTopName * * ************************************************************************ This is where we set names to local/global based on whether they really are externally visible (see comment at the top of this module). If the name was previously local, we have to give it a unique occurrence name if we intend to externalise it. -}
4,217
true
true
8
12
1,646
573
300
273
null
null
acowley/ghc
compiler/coreSyn/TrieMap.hs
bsd-3-clause
xtE (D env (Type t)) f m = m { cm_type = cm_type m |> xtG (D env t) f }
132
xtE (D env (Type t)) f m = m { cm_type = cm_type m |> xtG (D env t) f }
132
xtE (D env (Type t)) f m = m { cm_type = cm_type m |> xtG (D env t) f }
132
false
false
1
11
81
58
27
31
null
null
forked-upstream-packages-for-ghcjs/ghc
testsuite/tests/concurrent/should_run/conc032.hs
bsd-3-clause
awk x False False = 3
25
awk x False False = 3
25
awk x False False = 3
25
false
false
0
5
9
14
6
8
null
null
alvisespano/Lw
extras/hml-prototype/Types.hs
gpl-3.0
quantIds qs = map quantId qs
28
quantIds qs = map quantId qs
28
quantIds qs = map quantId qs
28
false
false
0
5
5
14
6
8
null
null
zepto-lang/zepto-js
src/Zepto/Primitives/ListPrimitives.hs
gpl-2.0
allAppend [badType] = throwError $ NumArgs 2 [badType]
54
allAppend [badType] = throwError $ NumArgs 2 [badType]
54
allAppend [badType] = throwError $ NumArgs 2 [badType]
54
false
false
0
7
7
24
12
12
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcTypeNats.hs
bsd-3-clause
(.*.) :: Type -> Type -> Type s .*. t = mkTyConApp typeNatMulTyCon [s,t]
72
(.*.) :: Type -> Type -> Type s .*. t = mkTyConApp typeNatMulTyCon [s,t]
72
s .*. t = mkTyConApp typeNatMulTyCon [s,t]
42
false
true
0
9
13
43
21
22
null
null
DougBurke/swish
tests/RDFGraphTest.hs
lgpl-2.1
gt2f3a = setFormulae ftm3 gt2
29
gt2f3a = setFormulae ftm3 gt2
29
gt2f3a = setFormulae ftm3 gt2
29
false
false
0
5
4
11
5
6
null
null
erochest/cabal-new
CabalNew/Sandbox.hs
apache-2.0
sandboxProject :: CabalNew -> FilePath -> Sh (Sh ()) sandboxProject config projectDir = do withCommit (projectGitLevel config) "sandbox init" $ sandboxInit config return $ do templateFile config "templates/env.mustache" ".env" unless (projectGitLevel config == Gitless) $ copyDataFile "templates/gitignore" ".gitignore" when (projectGitLevel config == GitHere) $ copyDataFile "templates/ctags" ".git/hooks/ctags" run "stylish-haskell" ["--defaults"] >>= writefile ".stylish-haskell.yaml"
559
sandboxProject :: CabalNew -> FilePath -> Sh (Sh ()) sandboxProject config projectDir = do withCommit (projectGitLevel config) "sandbox init" $ sandboxInit config return $ do templateFile config "templates/env.mustache" ".env" unless (projectGitLevel config == Gitless) $ copyDataFile "templates/gitignore" ".gitignore" when (projectGitLevel config == GitHere) $ copyDataFile "templates/ctags" ".git/hooks/ctags" run "stylish-haskell" ["--defaults"] >>= writefile ".stylish-haskell.yaml"
559
sandboxProject config projectDir = do withCommit (projectGitLevel config) "sandbox init" $ sandboxInit config return $ do templateFile config "templates/env.mustache" ".env" unless (projectGitLevel config == Gitless) $ copyDataFile "templates/gitignore" ".gitignore" when (projectGitLevel config == GitHere) $ copyDataFile "templates/ctags" ".git/hooks/ctags" run "stylish-haskell" ["--defaults"] >>= writefile ".stylish-haskell.yaml"
506
false
true
0
14
124
141
63
78
null
null
mstksg/hledger
hledger-lib/Hledger/Reports/PostingsReport.hs
gpl-3.0
-- | Select postings from the journal and add running balance and other -- information to make a postings report. Used by eg hledger's register command. postingsReport :: ReportOpts -> Query -> Journal -> PostingsReport postingsReport opts q j = (totallabel, items) where reportspan = adjustReportDates opts q j whichdate = whichDateFromOpts opts depth = queryDepth q -- postings to be included in the report, and similarly-matched postings before the report start date (precedingps, reportps) = matchedPostingsBeforeAndDuring opts q j reportspan -- postings or pseudo postings to be displayed displayps | interval == NoInterval = map (,Nothing) reportps | otherwise = summarisePostingsByInterval interval whichdate depth showempty reportspan reportps where interval = interval_ opts -- XXX showempty = empty_ opts || average_ opts -- posting report items ready for display items = dbg1 "postingsReport items" $ postingsReportItems displayps (nullposting,Nothing) whichdate depth startbal runningcalc startnum where historical = balancetype_ opts == HistoricalBalance precedingsum = sumPostings precedingps precedingavg | null precedingps = 0 | otherwise = precedingsum `divideMixedAmount` (fromIntegral $ length precedingps) startbal | average_ opts = if historical then precedingavg else 0 | otherwise = if historical then precedingsum else 0 startnum = if historical then length precedingps + 1 else 1 runningcalc | average_ opts = \i avg amt -> avg + (amt - avg) `divideMixedAmount` (fromIntegral i) -- running average | otherwise = \_ bal amt -> bal + amt -- running total
1,887
postingsReport :: ReportOpts -> Query -> Journal -> PostingsReport postingsReport opts q j = (totallabel, items) where reportspan = adjustReportDates opts q j whichdate = whichDateFromOpts opts depth = queryDepth q -- postings to be included in the report, and similarly-matched postings before the report start date (precedingps, reportps) = matchedPostingsBeforeAndDuring opts q j reportspan -- postings or pseudo postings to be displayed displayps | interval == NoInterval = map (,Nothing) reportps | otherwise = summarisePostingsByInterval interval whichdate depth showempty reportspan reportps where interval = interval_ opts -- XXX showempty = empty_ opts || average_ opts -- posting report items ready for display items = dbg1 "postingsReport items" $ postingsReportItems displayps (nullposting,Nothing) whichdate depth startbal runningcalc startnum where historical = balancetype_ opts == HistoricalBalance precedingsum = sumPostings precedingps precedingavg | null precedingps = 0 | otherwise = precedingsum `divideMixedAmount` (fromIntegral $ length precedingps) startbal | average_ opts = if historical then precedingavg else 0 | otherwise = if historical then precedingsum else 0 startnum = if historical then length precedingps + 1 else 1 runningcalc | average_ opts = \i avg amt -> avg + (amt - avg) `divideMixedAmount` (fromIntegral i) -- running average | otherwise = \_ bal amt -> bal + amt -- running total
1,734
postingsReport opts q j = (totallabel, items) where reportspan = adjustReportDates opts q j whichdate = whichDateFromOpts opts depth = queryDepth q -- postings to be included in the report, and similarly-matched postings before the report start date (precedingps, reportps) = matchedPostingsBeforeAndDuring opts q j reportspan -- postings or pseudo postings to be displayed displayps | interval == NoInterval = map (,Nothing) reportps | otherwise = summarisePostingsByInterval interval whichdate depth showempty reportspan reportps where interval = interval_ opts -- XXX showempty = empty_ opts || average_ opts -- posting report items ready for display items = dbg1 "postingsReport items" $ postingsReportItems displayps (nullposting,Nothing) whichdate depth startbal runningcalc startnum where historical = balancetype_ opts == HistoricalBalance precedingsum = sumPostings precedingps precedingavg | null precedingps = 0 | otherwise = precedingsum `divideMixedAmount` (fromIntegral $ length precedingps) startbal | average_ opts = if historical then precedingavg else 0 | otherwise = if historical then precedingsum else 0 startnum = if historical then length precedingps + 1 else 1 runningcalc | average_ opts = \i avg amt -> avg + (amt - avg) `divideMixedAmount` (fromIntegral i) -- running average | otherwise = \_ bal amt -> bal + amt -- running total
1,667
true
true
14
9
542
409
202
207
null
null
timstclair/experimental
haskell/99_problems/arithmetic.hs
unlicense
factor :: (Integral a) => a -> (a, a) factor x = helper x (floor $ sqrt (fromIntegral x)) where helper x 1 = (x, 1) helper x y = if (y * (x `div` y) == x) then ((x `div` y), y) else helper x (y - 1) -- Q 32: Determine the greatest common divisor of two positive integer numbers.
293
factor :: (Integral a) => a -> (a, a) factor x = helper x (floor $ sqrt (fromIntegral x)) where helper x 1 = (x, 1) helper x y = if (y * (x `div` y) == x) then ((x `div` y), y) else helper x (y - 1) -- Q 32: Determine the greatest common divisor of two positive integer numbers.
293
factor x = helper x (floor $ sqrt (fromIntegral x)) where helper x 1 = (x, 1) helper x y = if (y * (x `div` y) == x) then ((x `div` y), y) else helper x (y - 1) -- Q 32: Determine the greatest common divisor of two positive integer numbers.
255
false
true
1
11
76
142
78
64
null
null
bitemyapp/ghc
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
bsd-3-clause
tupleDataName n = mk_tup_name (n-1) DataName
44
tupleDataName n = mk_tup_name (n-1) DataName
44
tupleDataName n = mk_tup_name (n-1) DataName
44
false
false
0
7
5
21
10
11
null
null
adinapoli/api-tools
tests/Data/API/Test/Migration.hs
bsd-3-clause
testDatabaseMigrationSchema :: TestDatabaseMigration -> NormAPI -> Maybe NormAPI testDatabaseMigrationSchema DuplicateBar _ = Nothing
133
testDatabaseMigrationSchema :: TestDatabaseMigration -> NormAPI -> Maybe NormAPI testDatabaseMigrationSchema DuplicateBar _ = Nothing
133
testDatabaseMigrationSchema DuplicateBar _ = Nothing
52
false
true
0
7
12
27
13
14
null
null
spechub/Hets
OWL2/ProverState.hs
gpl-2.0
owlProverState :: Sign -> [Named Axiom] -> [FreeDefMorphism Axiom OWLMorphism] -- ^ freeness constraints -> ProverState owlProverState sig oSens _ = ProverState { ontologySign = sig, initialState = filter isAxiom oSens }
236
owlProverState :: Sign -> [Named Axiom] -> [FreeDefMorphism Axiom OWLMorphism] -- ^ freeness constraints -> ProverState owlProverState sig oSens _ = ProverState { ontologySign = sig, initialState = filter isAxiom oSens }
236
owlProverState sig oSens _ = ProverState { ontologySign = sig, initialState = filter isAxiom oSens }
108
false
true
0
9
47
64
34
30
null
null
winterland1989/mysql-haskell
Database/MySQL/Protocol/Escape.hs
bsd-3-clause
escapeText :: Text -> Text escapeText (T.Text arr off len) | len <= 0 = T.empty | otherwise = let (arr', len') = TA.run2 $ do marr <- TA.new (len * 2) loop arr (off + len) marr off 0 in T.Text arr' 0 len' where escape c marr ix = do TA.unsafeWrite marr ix 92 TA.unsafeWrite marr (ix+1) c loop oarr oend marr !ix !ix' | ix == oend = return (marr, ix') | otherwise = do let c = TA.unsafeIndex oarr ix go1 = loop oarr oend marr (ix+1) (ix'+1) go2 = loop oarr oend marr (ix+1) (ix'+2) if | c >= 0xD800 && c <= 0xDBFF -> do let c2 = TA.unsafeIndex oarr (ix+1) TA.unsafeWrite marr ix' c TA.unsafeWrite marr (ix'+1) c2 loop oarr oend marr (ix+2) (ix'+2) | c == 0 || c == 39 || c == 34 -> escape c marr ix' >> go2 -- \0 \' \" | c == 8 -> escape 98 marr ix' >> go2 -- \b | c == 10 -> escape 110 marr ix' >> go2 -- \n | c == 13 -> escape 114 marr ix' >> go2 -- \r | c == 9 -> escape 116 marr ix' >> go2 -- \t | c == 26 -> escape 90 marr ix' >> go2 -- \Z | c == 92 -> escape 92 marr ix' >> go2 -- \\ | otherwise -> TA.unsafeWrite marr ix' c >> go1
1,561
escapeText :: Text -> Text escapeText (T.Text arr off len) | len <= 0 = T.empty | otherwise = let (arr', len') = TA.run2 $ do marr <- TA.new (len * 2) loop arr (off + len) marr off 0 in T.Text arr' 0 len' where escape c marr ix = do TA.unsafeWrite marr ix 92 TA.unsafeWrite marr (ix+1) c loop oarr oend marr !ix !ix' | ix == oend = return (marr, ix') | otherwise = do let c = TA.unsafeIndex oarr ix go1 = loop oarr oend marr (ix+1) (ix'+1) go2 = loop oarr oend marr (ix+1) (ix'+2) if | c >= 0xD800 && c <= 0xDBFF -> do let c2 = TA.unsafeIndex oarr (ix+1) TA.unsafeWrite marr ix' c TA.unsafeWrite marr (ix'+1) c2 loop oarr oend marr (ix+2) (ix'+2) | c == 0 || c == 39 || c == 34 -> escape c marr ix' >> go2 -- \0 \' \" | c == 8 -> escape 98 marr ix' >> go2 -- \b | c == 10 -> escape 110 marr ix' >> go2 -- \n | c == 13 -> escape 114 marr ix' >> go2 -- \r | c == 9 -> escape 116 marr ix' >> go2 -- \t | c == 26 -> escape 90 marr ix' >> go2 -- \Z | c == 92 -> escape 92 marr ix' >> go2 -- \\ | otherwise -> TA.unsafeWrite marr ix' c >> go1
1,561
escapeText (T.Text arr off len) | len <= 0 = T.empty | otherwise = let (arr', len') = TA.run2 $ do marr <- TA.new (len * 2) loop arr (off + len) marr off 0 in T.Text arr' 0 len' where escape c marr ix = do TA.unsafeWrite marr ix 92 TA.unsafeWrite marr (ix+1) c loop oarr oend marr !ix !ix' | ix == oend = return (marr, ix') | otherwise = do let c = TA.unsafeIndex oarr ix go1 = loop oarr oend marr (ix+1) (ix'+1) go2 = loop oarr oend marr (ix+1) (ix'+2) if | c >= 0xD800 && c <= 0xDBFF -> do let c2 = TA.unsafeIndex oarr (ix+1) TA.unsafeWrite marr ix' c TA.unsafeWrite marr (ix'+1) c2 loop oarr oend marr (ix+2) (ix'+2) | c == 0 || c == 39 || c == 34 -> escape c marr ix' >> go2 -- \0 \' \" | c == 8 -> escape 98 marr ix' >> go2 -- \b | c == 10 -> escape 110 marr ix' >> go2 -- \n | c == 13 -> escape 114 marr ix' >> go2 -- \r | c == 9 -> escape 116 marr ix' >> go2 -- \t | c == 26 -> escape 90 marr ix' >> go2 -- \Z | c == 92 -> escape 92 marr ix' >> go2 -- \\ | otherwise -> TA.unsafeWrite marr ix' c >> go1
1,534
false
true
3
17
765
614
294
320
null
null
fferreira/hnh
ProgramUtils.hs
gpl-3.0
procK (HaltK i) = putId i
25
procK (HaltK i) = putId i
25
procK (HaltK i) = putId i
25
false
false
0
6
5
19
8
11
null
null
biegunka/biegunka
src/Control/Biegunka/Source/Git/Internal.hs
mit
defaultConfig :: Config NoUrl NoPath defaultConfig = Config { configUrl = NoUrl , configPath = NoPath , configBranch = "master" , configFailIfAhead = False }
187
defaultConfig :: Config NoUrl NoPath defaultConfig = Config { configUrl = NoUrl , configPath = NoPath , configBranch = "master" , configFailIfAhead = False }
187
defaultConfig = Config { configUrl = NoUrl , configPath = NoPath , configBranch = "master" , configFailIfAhead = False }
150
false
true
0
7
54
51
27
24
null
null
nshimaza/cisco-spark-api
webex-teams-api/src/Network/WebexTeams/Internal.hs
mit
extractNextUrl :: [ByteString] -> [ByteString] extractNextUrl = map linkHeaderUrl . filter isNextRel . rights . map (parseOnly linkHeader) where isNextRel = any (\(param, str) -> param == Rel && str == "next") . linkHeaderParams -- | Return URL for next page if it exists in given response.
297
extractNextUrl :: [ByteString] -> [ByteString] extractNextUrl = map linkHeaderUrl . filter isNextRel . rights . map (parseOnly linkHeader) where isNextRel = any (\(param, str) -> param == Rel && str == "next") . linkHeaderParams -- | Return URL for next page if it exists in given response.
297
extractNextUrl = map linkHeaderUrl . filter isNextRel . rights . map (parseOnly linkHeader) where isNextRel = any (\(param, str) -> param == Rel && str == "next") . linkHeaderParams -- | Return URL for next page if it exists in given response.
250
false
true
0
11
53
90
47
43
null
null
Axure/elm-compiler
src/Parse/Pattern.hs
bsd-3-clause
list :: IParser P.RawPattern list = braces $ do (_, patterns, end) <- located (commaSep expr) return (P.list end patterns)
137
list :: IParser P.RawPattern list = braces $ do (_, patterns, end) <- located (commaSep expr) return (P.list end patterns)
137
list = braces $ do (_, patterns, end) <- located (commaSep expr) return (P.list end patterns)
108
false
true
2
11
34
68
31
37
null
null
snoyberg/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
commaSepApplied :: [Name] -> Doc commaSepApplied = commaSepWith (pprName' Applied)
82
commaSepApplied :: [Name] -> Doc commaSepApplied = commaSepWith (pprName' Applied)
82
commaSepApplied = commaSepWith (pprName' Applied)
49
false
true
0
7
9
27
14
13
null
null
nevrenato/Hets_Fork
GUI/ShowLibGraph.hs
gpl-2.0
translate :: GInfo -> IO () translate gi = do b <- warningDialog "Translate library" warnTxt when b $ translate' gi -- | Translate Graph
141
translate :: GInfo -> IO () translate gi = do b <- warningDialog "Translate library" warnTxt when b $ translate' gi -- | Translate Graph
141
translate gi = do b <- warningDialog "Translate library" warnTxt when b $ translate' gi -- | Translate Graph
113
false
true
0
8
29
49
22
27
null
null
dbp/snaplet-wordpress
src/Web/Offset/Splices.hs
bsd-3-clause
wpPostFromObjectFill :: [Field s] -> WPLens b s -> Object -> Maybe (MVar (Maybe IntSet)) -> Fill s wpPostFromObjectFill extraFields wpLens postObj postIdSet = maybeFillChildrenWith' $ do addPostIds postIdSet [fst (extractPostId postObj)] wp <- use wpLens return $ Just (postSubs wp extraFields postObj)
405
wpPostFromObjectFill :: [Field s] -> WPLens b s -> Object -> Maybe (MVar (Maybe IntSet)) -> Fill s wpPostFromObjectFill extraFields wpLens postObj postIdSet = maybeFillChildrenWith' $ do addPostIds postIdSet [fst (extractPostId postObj)] wp <- use wpLens return $ Just (postSubs wp extraFields postObj)
405
wpPostFromObjectFill extraFields wpLens postObj postIdSet = maybeFillChildrenWith' $ do addPostIds postIdSet [fst (extractPostId postObj)] wp <- use wpLens return $ Just (postSubs wp extraFields postObj)
218
false
true
0
13
145
119
55
64
null
null
christiaanb/ghc
compiler/types/TyCon.hs
bsd-3-clause
primRepSizeW dflags (VecRep len rep) = len * primElemRepSizeB rep `quot` wORD_SIZE dflags
89
primRepSizeW dflags (VecRep len rep) = len * primElemRepSizeB rep `quot` wORD_SIZE dflags
89
primRepSizeW dflags (VecRep len rep) = len * primElemRepSizeB rep `quot` wORD_SIZE dflags
89
false
false
0
7
12
37
17
20
null
null
rightfold/snek
src/SNEK/Parse.hs
bsd-3-clause
parseVESpecial _ _ = return Nothing
35
parseVESpecial _ _ = return Nothing
35
parseVESpecial _ _ = return Nothing
35
false
false
1
5
5
14
6
8
null
null
karamellpelle/grid
test/source/Test/_TestGUI.hs
gpl-3.0
testPushString :: TestGUI -> String -> TestGUI testPushString test str = test { testString = testString test ++ str }
137
testPushString :: TestGUI -> String -> TestGUI testPushString test str = test { testString = testString test ++ str }
137
testPushString test str = test { testString = testString test ++ str }
90
false
true
0
8
39
39
20
19
null
null
NicolasDP/hitweb
devel.hs
bsd-3-clause
terminateDevel :: IO () terminateDevel = exitSuccess
52
terminateDevel :: IO () terminateDevel = exitSuccess
52
terminateDevel = exitSuccess
28
false
true
0
7
6
22
9
13
null
null
rvion/ride
jetpack/src/Data/Set/AsSet.hs
bsd-3-clause
-- set_maxView :: forall a. Set a -> Maybe (a, Set a) set_maxView = I.maxView
77
set_maxView = I.maxView
23
set_maxView = I.maxView
23
true
false
0
5
14
9
5
4
null
null
amccausl/Swish
Swish/HaskellRDF/RDFGraphTest.hs
lgpl-2.1
tu01 = arc (Res uris1) (Res urip1) (Res urio1)
47
tu01 = arc (Res uris1) (Res urip1) (Res urio1)
47
tu01 = arc (Res uris1) (Res urip1) (Res urio1)
47
false
false
1
7
9
34
15
19
null
null
ian-ross/c2hs-macos-test
c2hs-0.26.1/src/C2HS/C/Attrs.hs
mit
-- | creating a new object name space -- cObjNS :: CObjNS cObjNS = nameSpace
77
cObjNS :: CObjNS cObjNS = nameSpace
36
cObjNS = nameSpace
19
true
true
0
4
15
13
8
5
null
null
sdiehl/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprExp _ (CompE []) = text "<<Empty CompExp>>"
46
pprExp _ (CompE []) = text "<<Empty CompExp>>"
46
pprExp _ (CompE []) = text "<<Empty CompExp>>"
46
false
false
1
7
7
24
10
14
null
null
valis/hoq
src/TypeChecking/Expressions/Patterns.hs
gpl-2.0
typeCheckPattern _ _ _ = error "typeCheckPattern"
49
typeCheckPattern _ _ _ = error "typeCheckPattern"
49
typeCheckPattern _ _ _ = error "typeCheckPattern"
49
false
false
0
5
6
16
7
9
null
null
ezyang/hoopl
prototypes/Zipper.hs
bsd-3-clause
frontBiasBlock b@(ZCat {}) = rotate b where -- rotate and append ensure every left child of ZCat is ZMiddle -- provided 2nd argument to append already has this property rotate :: ZBlock n O O -> ZBlock n O O append :: ZBlock n O O -> ZBlock n O O -> ZBlock n O O rotate (ZCat h t) = append h (rotate t) rotate b@(ZMiddle {}) = b append b@(ZMiddle {}) t = b `ZCat` t append (ZCat b1 b2) b3 = b1 `append` (b2 `append` b3)
457
frontBiasBlock b@(ZCat {}) = rotate b where -- rotate and append ensure every left child of ZCat is ZMiddle -- provided 2nd argument to append already has this property rotate :: ZBlock n O O -> ZBlock n O O append :: ZBlock n O O -> ZBlock n O O -> ZBlock n O O rotate (ZCat h t) = append h (rotate t) rotate b@(ZMiddle {}) = b append b@(ZMiddle {}) t = b `ZCat` t append (ZCat b1 b2) b3 = b1 `append` (b2 `append` b3)
457
frontBiasBlock b@(ZCat {}) = rotate b where -- rotate and append ensure every left child of ZCat is ZMiddle -- provided 2nd argument to append already has this property rotate :: ZBlock n O O -> ZBlock n O O append :: ZBlock n O O -> ZBlock n O O -> ZBlock n O O rotate (ZCat h t) = append h (rotate t) rotate b@(ZMiddle {}) = b append b@(ZMiddle {}) t = b `ZCat` t append (ZCat b1 b2) b3 = b1 `append` (b2 `append` b3)
457
false
false
10
9
126
186
98
88
null
null
mettekou/ghc
compiler/simplStg/UnariseStg.hs
bsd-3-clause
unariseExpr rho (StgLet bind e) = StgLet <$> unariseBinding rho bind <*> unariseExpr rho e
92
unariseExpr rho (StgLet bind e) = StgLet <$> unariseBinding rho bind <*> unariseExpr rho e
92
unariseExpr rho (StgLet bind e) = StgLet <$> unariseBinding rho bind <*> unariseExpr rho e
92
false
false
0
7
16
37
17
20
null
null
phaazon/leaf
src/Leaf.hs
gpl-3.0
usage :: IO () usage = putStrLn $ usageInfo "usage: leaf [OPTIONS]" cliOptions
78
usage :: IO () usage = putStrLn $ usageInfo "usage: leaf [OPTIONS]" cliOptions
78
usage = putStrLn $ usageInfo "usage: leaf [OPTIONS]" cliOptions
63
false
true
2
7
12
32
13
19
null
null
music-suite/music-pitch-literal
src/Music/Pitch/Literal/Pitch.hs
bsd-3-clause
c'' = fromPitch $ PitchL (0, Nothing, 2)
46
c'' = fromPitch $ PitchL (0, Nothing, 2)
46
c'' = fromPitch $ PitchL (0, Nothing, 2)
46
false
false
3
6
13
26
12
14
null
null
ruudkoot/odin
src/SCSI/Sense.hs
gpl-3.0
parseSenseData :: Parser SenseData parseSenseData = do [valid, responseCode] <- bits8 [1,7] _obsolete <- word8 [fileMark, endOfMedium, incorrectLengthIndicator, reserved, senseKey] <- bits8 [1,1,1,1,4] information <- word64BE additionalSenseLength <- fromIntegral <$> word8 commandSpecificInformation <- word64BE additionalSenseCode <- word8 additionalSenseCodeQualifier <- word8 fieldReplacableUnitCode <- word8 [sksv, sks1] <- bits8 [1,7] sks2 <- word8 sks3 <- word8 additionalSenseBytes <- replicateM (additionalSenseLength - 10) word8 return $ SenseData { responseCode = case responseCode of 0x70 -> Current 0x71 -> Deferred 0x72 -> Current 0x73 -> Deferred, senseKey = toEnum (fromIntegral senseKey), incorrectLengthIndicator = bit2bool incorrectLengthIndicator, endOfMedium = bit2bool endOfMedium, fileMark = bit2bool fileMark, information = if bit2bool valid then Just information else Nothing, commandSpecificInformation = if additionalSenseLength >= 4 then Just commandSpecificInformation else Nothing, additionalSenseCode = if additionalSenseLength >= 5 then Just additionalSenseCode else Nothing, additionalSenseCodeQualifier = if additionalSenseLength >= 6 then Just additionalSenseCodeQualifier else Nothing, fieldReplacableUnitCode = if additionalSenseLength >= 7 then Just fieldReplacableUnitCode else Nothing, senseKeySpecific = if additionalSenseLength >= 8 && bit2bool sksv then Just (sks1, sks2, sks3) else Nothing, additionalSenseBytes = additionalSenseBytes }
3,021
parseSenseData :: Parser SenseData parseSenseData = do [valid, responseCode] <- bits8 [1,7] _obsolete <- word8 [fileMark, endOfMedium, incorrectLengthIndicator, reserved, senseKey] <- bits8 [1,1,1,1,4] information <- word64BE additionalSenseLength <- fromIntegral <$> word8 commandSpecificInformation <- word64BE additionalSenseCode <- word8 additionalSenseCodeQualifier <- word8 fieldReplacableUnitCode <- word8 [sksv, sks1] <- bits8 [1,7] sks2 <- word8 sks3 <- word8 additionalSenseBytes <- replicateM (additionalSenseLength - 10) word8 return $ SenseData { responseCode = case responseCode of 0x70 -> Current 0x71 -> Deferred 0x72 -> Current 0x73 -> Deferred, senseKey = toEnum (fromIntegral senseKey), incorrectLengthIndicator = bit2bool incorrectLengthIndicator, endOfMedium = bit2bool endOfMedium, fileMark = bit2bool fileMark, information = if bit2bool valid then Just information else Nothing, commandSpecificInformation = if additionalSenseLength >= 4 then Just commandSpecificInformation else Nothing, additionalSenseCode = if additionalSenseLength >= 5 then Just additionalSenseCode else Nothing, additionalSenseCodeQualifier = if additionalSenseLength >= 6 then Just additionalSenseCodeQualifier else Nothing, fieldReplacableUnitCode = if additionalSenseLength >= 7 then Just fieldReplacableUnitCode else Nothing, senseKeySpecific = if additionalSenseLength >= 8 && bit2bool sksv then Just (sks1, sks2, sks3) else Nothing, additionalSenseBytes = additionalSenseBytes }
3,021
parseSenseData = do [valid, responseCode] <- bits8 [1,7] _obsolete <- word8 [fileMark, endOfMedium, incorrectLengthIndicator, reserved, senseKey] <- bits8 [1,1,1,1,4] information <- word64BE additionalSenseLength <- fromIntegral <$> word8 commandSpecificInformation <- word64BE additionalSenseCode <- word8 additionalSenseCodeQualifier <- word8 fieldReplacableUnitCode <- word8 [sksv, sks1] <- bits8 [1,7] sks2 <- word8 sks3 <- word8 additionalSenseBytes <- replicateM (additionalSenseLength - 10) word8 return $ SenseData { responseCode = case responseCode of 0x70 -> Current 0x71 -> Deferred 0x72 -> Current 0x73 -> Deferred, senseKey = toEnum (fromIntegral senseKey), incorrectLengthIndicator = bit2bool incorrectLengthIndicator, endOfMedium = bit2bool endOfMedium, fileMark = bit2bool fileMark, information = if bit2bool valid then Just information else Nothing, commandSpecificInformation = if additionalSenseLength >= 4 then Just commandSpecificInformation else Nothing, additionalSenseCode = if additionalSenseLength >= 5 then Just additionalSenseCode else Nothing, additionalSenseCodeQualifier = if additionalSenseLength >= 6 then Just additionalSenseCodeQualifier else Nothing, fieldReplacableUnitCode = if additionalSenseLength >= 7 then Just fieldReplacableUnitCode else Nothing, senseKeySpecific = if additionalSenseLength >= 8 && bit2bool sksv then Just (sks1, sks2, sks3) else Nothing, additionalSenseBytes = additionalSenseBytes }
2,986
false
true
0
13
1,713
422
223
199
null
null
markus-git/co-feldspar
src/Feldspar/Software/Frontend.hs
bsd-3-clause
-- | Value argument valArg :: SoftwarePrimType a => SExp a -> FunArg SExp SoftwarePrimType valArg = Imp.valArg
110
valArg :: SoftwarePrimType a => SExp a -> FunArg SExp SoftwarePrimType valArg = Imp.valArg
90
valArg = Imp.valArg
19
true
true
0
8
17
39
17
22
null
null
iu-parfunc/haskell-hpx
mockups/APISketch.hs
bsd-3-clause
runHPX = undefined
19
runHPX = undefined
19
runHPX = undefined
19
false
false
1
5
3
10
3
7
null
null
ezyang/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
isQuietHsCmd _ = False
22
isQuietHsCmd _ = False
22
isQuietHsCmd _ = False
22
false
false
0
5
3
9
4
5
null
null
rvl/hsoz
src/Network/Iron.hs
bsd-3-clause
-- note: ScrubbedBytes Show doesn't actually show any content -- | Constructs a 'Password'. password :: ByteArrayAccess a => a -> Password password p = passwords p p
166
password :: ByteArrayAccess a => a -> Password password p = passwords p p
73
password p = passwords p p
26
true
true
0
6
28
32
16
16
null
null
utwente-fmt/scoop
src/Usage.hs
bsd-3-clause
getRestrictedChanged :: LPPE -> Int -> [Int] getRestrictedChanged (LPPE name pars summands) i = getRestrictedChanged2 (summands!!i) (zip [0..length(pars) - 1] (map fst pars))
174
getRestrictedChanged :: LPPE -> Int -> [Int] getRestrictedChanged (LPPE name pars summands) i = getRestrictedChanged2 (summands!!i) (zip [0..length(pars) - 1] (map fst pars))
174
getRestrictedChanged (LPPE name pars summands) i = getRestrictedChanged2 (summands!!i) (zip [0..length(pars) - 1] (map fst pars))
129
false
true
0
11
22
80
41
39
null
null
dag/path
src/System/PathName/Internal.hs
bsd-3-clause
-- | 'Backend.takeDirectory' takeDirectory :: PathName -> PathName takeDirectory = unsafeCoerce Backend.takeDirectory
117
takeDirectory :: PathName -> PathName takeDirectory = unsafeCoerce Backend.takeDirectory
88
takeDirectory = unsafeCoerce Backend.takeDirectory
50
true
true
0
6
11
21
11
10
null
null
randen/cabal
Cabal/tests/Test/Distribution/Version.hs
bsd-3-clause
prop_nonNull :: Version -> Bool prop_nonNull = not . null . versionBranch
73
prop_nonNull :: Version -> Bool prop_nonNull = not . null . versionBranch
73
prop_nonNull = not . null . versionBranch
41
false
true
0
6
11
23
12
11
null
null
lancelotsix/hs-tls
core/Network/TLS/State.hs
bsd-3-clause
certVerifyHandshakeTypeMaterial HandshakeType_CertRequest = True
68
certVerifyHandshakeTypeMaterial HandshakeType_CertRequest = True
68
certVerifyHandshakeTypeMaterial HandshakeType_CertRequest = True
68
false
false
0
5
7
9
4
5
null
null
apyrgio/ganeti
src/Ganeti/Query/Instance.hs
bsd-2-clause
-- | Given an incomplete field definition and values that can complete it, -- return a fully functional FieldData. Cannot work for all cases, should be -- extended as necessary. fillIncompleteFields :: (t1 -> t2 -> FieldDefinition, t1 -> FieldGetter a b, QffMode) -> t1 -> t2 -> FieldData a b fillIncompleteFields (iDef, iGet, mode) firstVal secondVal = (iDef firstVal secondVal, iGet firstVal, mode)
515
fillIncompleteFields :: (t1 -> t2 -> FieldDefinition, t1 -> FieldGetter a b, QffMode) -> t1 -> t2 -> FieldData a b fillIncompleteFields (iDef, iGet, mode) firstVal secondVal = (iDef firstVal secondVal, iGet firstVal, mode)
337
fillIncompleteFields (iDef, iGet, mode) firstVal secondVal = (iDef firstVal secondVal, iGet firstVal, mode)
109
true
true
0
8
178
90
49
41
null
null
lachrist/kusasa-hs
semantic.hs
gpl-2.0
apply :: Control -> [Value] -> Kontinuation -> Heap -> Transition apply (Primitive str) vals kont heap = applyPrimitive str vals kont heap
138
apply :: Control -> [Value] -> Kontinuation -> Heap -> Transition apply (Primitive str) vals kont heap = applyPrimitive str vals kont heap
138
apply (Primitive str) vals kont heap = applyPrimitive str vals kont heap
72
false
true
0
8
22
54
27
27
null
null
chadbrewbaker/combinat
Math/Combinat/Numbers/Series.hs
bsd-3-clause
heckAll :: IO () checkAll = do let f :: Testable a => a -> IO () f = quickCheck {- -- these are very slow, because random is slow putStrLn "leftIdentity" ; f prop_leftIdentity putStrLn "rightIdentity" ; f prop_rightIdentity putStrLn "commutativity" ; f prop_commutativity putStrLn "associativity" ; f prop_associativity -} putStrLn "convPSeries1 vs generic" ; f prop_conv1_vs_gen putStrLn "convPSeries2 vs generic" ; f prop_conv2_vs_gen putStrLn "convPSeries3 vs generic" ; f prop_conv3_vs_gen putStrLn "convPSeries1' vs generic" ; f prop_conv1_vs_gen' putStrLn "convPSeries2' vs generic" ; f prop_conv2_vs_gen' putStrLn "convPSeries3' vs generic" ; f prop_conv3_vs_gen' putStrLn "convolve_pseries" ; f prop_convolve_pseries putStrLn "convolve_pseries'" ; f prop_convolve_pseries' putStrLn "coinSeries vs pseries" ; f prop_coin_vs_pseries putStrLn "coinSeries vs pseries'" ; f prop_coin_vs_pseries'
943
checkAll :: IO () checkAll = do let f :: Testable a => a -> IO () f = quickCheck {- -- these are very slow, because random is slow putStrLn "leftIdentity" ; f prop_leftIdentity putStrLn "rightIdentity" ; f prop_rightIdentity putStrLn "commutativity" ; f prop_commutativity putStrLn "associativity" ; f prop_associativity -} putStrLn "convPSeries1 vs generic" ; f prop_conv1_vs_gen putStrLn "convPSeries2 vs generic" ; f prop_conv2_vs_gen putStrLn "convPSeries3 vs generic" ; f prop_conv3_vs_gen putStrLn "convPSeries1' vs generic" ; f prop_conv1_vs_gen' putStrLn "convPSeries2' vs generic" ; f prop_conv2_vs_gen' putStrLn "convPSeries3' vs generic" ; f prop_conv3_vs_gen' putStrLn "convolve_pseries" ; f prop_convolve_pseries putStrLn "convolve_pseries'" ; f prop_convolve_pseries' putStrLn "coinSeries vs pseries" ; f prop_coin_vs_pseries putStrLn "coinSeries vs pseries'" ; f prop_coin_vs_pseries'
943
checkAll = do let f :: Testable a => a -> IO () f = quickCheck {- -- these are very slow, because random is slow putStrLn "leftIdentity" ; f prop_leftIdentity putStrLn "rightIdentity" ; f prop_rightIdentity putStrLn "commutativity" ; f prop_commutativity putStrLn "associativity" ; f prop_associativity -} putStrLn "convPSeries1 vs generic" ; f prop_conv1_vs_gen putStrLn "convPSeries2 vs generic" ; f prop_conv2_vs_gen putStrLn "convPSeries3 vs generic" ; f prop_conv3_vs_gen putStrLn "convPSeries1' vs generic" ; f prop_conv1_vs_gen' putStrLn "convPSeries2' vs generic" ; f prop_conv2_vs_gen' putStrLn "convPSeries3' vs generic" ; f prop_conv3_vs_gen' putStrLn "convolve_pseries" ; f prop_convolve_pseries putStrLn "convolve_pseries'" ; f prop_convolve_pseries' putStrLn "coinSeries vs pseries" ; f prop_coin_vs_pseries putStrLn "coinSeries vs pseries'" ; f prop_coin_vs_pseries'
925
false
true
0
13
161
177
73
104
null
null
nightscape/platform
shared/src/Unison/Term.hs
mit
-- some smart constructors var :: v -> Term v var = ABT.var
60
var :: v -> Term v var = ABT.var
32
var = ABT.var
13
true
true
0
7
13
27
12
15
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Luxi (Local UniX Interface) related constants luxiEom :: PythonChar luxiEom = PythonChar '\x03'
101
luxiEom :: PythonChar luxiEom = PythonChar '\x03'
49
luxiEom = PythonChar '\x03'
27
true
true
0
6
15
22
9
13
null
null
forked-upstream-packages-for-ghcjs/ghc
compiler/deSugar/Check.hs
bsd-3-clause
get_lit _ = Nothing
67
get_lit _ = Nothing
67
get_lit _ = Nothing
67
false
false
0
4
51
10
4
6
null
null
christiaanb/Idris-dev
src/Idris/ElabTerm.hs
bsd-3-clause
reifyApp ist t [n, t'] | t == reflm "LetTac" = do n' <- reifyTTName n t'' <- reifyTT t' return $ LetTac n' (delab ist t')
215
reifyApp ist t [n, t'] | t == reflm "LetTac" = do n' <- reifyTTName n t'' <- reifyTT t' return $ LetTac n' (delab ist t')
215
reifyApp ist t [n, t'] | t == reflm "LetTac" = do n' <- reifyTTName n t'' <- reifyTT t' return $ LetTac n' (delab ist t')
215
false
false
0
11
120
73
32
41
null
null
robdockins/edison
edison-core/src/Data/Edison/Assoc/PatriciaLoMap.hs
mit
mapWithKey :: (Int -> a -> b) -> FM a -> FM b mapWithKey _ E = E
64
mapWithKey :: (Int -> a -> b) -> FM a -> FM b mapWithKey _ E = E
64
mapWithKey _ E = E
18
false
true
0
8
17
41
20
21
null
null
batterseapower/chsc
Core/Syntax.hs
bsd-3-clause
varApps :: Symantics ann => Var -> [Var] -> ann (TermF ann) varApps h xs = var h `apps` xs
90
varApps :: Symantics ann => Var -> [Var] -> ann (TermF ann) varApps h xs = var h `apps` xs
90
varApps h xs = var h `apps` xs
30
false
true
0
11
19
59
28
31
null
null
devalot/hs-exceptions
src/bottom.hs
bsd-3-clause
-- {END} -------------------------------------------------------------------------------- main :: IO () main = print (head bools)
130
main :: IO () main = print (head bools)
39
main = print (head bools)
25
true
true
0
7
12
27
14
13
null
null
dmjio/TinyMap
src/Data/TinyMap.hs
mit
toList :: (Serialize v, Hashable k) => TinyMap k v -> [(k,v)] toList (TinyMap hmap) = P.map (second f) . H.toList $ hmap where f compressed = case decodeLazy (decompress compressed) of Left msg -> error msg Right !decoded -> decoded
275
toList :: (Serialize v, Hashable k) => TinyMap k v -> [(k,v)] toList (TinyMap hmap) = P.map (second f) . H.toList $ hmap where f compressed = case decodeLazy (decompress compressed) of Left msg -> error msg Right !decoded -> decoded
275
toList (TinyMap hmap) = P.map (second f) . H.toList $ hmap where f compressed = case decodeLazy (decompress compressed) of Left msg -> error msg Right !decoded -> decoded
213
false
true
0
9
83
124
59
65
null
null
diminishedprime/.org
programmey_stuff/write_yourself_a_scheme/ch_03/hello.hs
mit
parseUnQuote :: Parser LispVal parseUnQuote = (\e -> List [Atom "unquote", e]) <$> (char ',' >> parseExpr)
106
parseUnQuote :: Parser LispVal parseUnQuote = (\e -> List [Atom "unquote", e]) <$> (char ',' >> parseExpr)
106
parseUnQuote = (\e -> List [Atom "unquote", e]) <$> (char ',' >> parseExpr)
75
false
true
0
10
16
48
25
23
null
null
lexml/lexml-linker
src/main/haskell/LexML/Linker/Estados.hs
gpl-2.0
unTrie (Trie r) = r
19
unTrie (Trie r) = r
19
unTrie (Trie r) = r
19
false
false
0
7
4
15
7
8
null
null
jyp/imbib
lib/BibDB.hs
gpl-2.0
saveBibliography :: InitFile -> [Entry] -> IO () saveBibliography cfg bib = do let formatted = formatBib bib writeFile (bibfile cfg) formatted putStrLn $ show (length bib) ++ " entries saved to " ++ (bibfile cfg)
219
saveBibliography :: InitFile -> [Entry] -> IO () saveBibliography cfg bib = do let formatted = formatBib bib writeFile (bibfile cfg) formatted putStrLn $ show (length bib) ++ " entries saved to " ++ (bibfile cfg)
219
saveBibliography cfg bib = do let formatted = formatBib bib writeFile (bibfile cfg) formatted putStrLn $ show (length bib) ++ " entries saved to " ++ (bibfile cfg)
170
false
true
0
12
42
88
41
47
null
null
rahulmutt/ghcvm
compiler/Eta/CodeGen/Rts.hs
bsd-3-clause
ftWrapper ft = error $ "ftWrapper: Not a base type: " ++ show ft
64
ftWrapper ft = error $ "ftWrapper: Not a base type: " ++ show ft
64
ftWrapper ft = error $ "ftWrapper: Not a base type: " ++ show ft
64
false
false
0
6
13
20
9
11
null
null
fmthoma/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
ident_RDR = dataQual_RDR lEX (fsLit "Ident")
58
ident_RDR = dataQual_RDR lEX (fsLit "Ident")
58
ident_RDR = dataQual_RDR lEX (fsLit "Ident")
58
false
false
0
7
19
17
8
9
null
null
klangner/radium
src/Radium/Element.hs
bsd-2-clause
excite :: [OrbitalState] -> Maybe [OrbitalState] excite conf = fmap removeEmptyShells excConf where increase (State l s e) = State l s (e + 1) decrease (State l s e) = State l s (e - 1) expConf = appendEmptyShells conf excConf = case (highestPaired &&& lowestFree) expConf of (Nothing, _) -> Nothing (_, Nothing) -> Nothing (Just h, Just l) -> if orbitalLayer (conf !! h) == orbitalLayer (expConf !! l) then Just . toList . update l (increase $ expConf !! l) . update h (decrease $ expConf !! h) $ fromList expConf else Nothing
802
excite :: [OrbitalState] -> Maybe [OrbitalState] excite conf = fmap removeEmptyShells excConf where increase (State l s e) = State l s (e + 1) decrease (State l s e) = State l s (e - 1) expConf = appendEmptyShells conf excConf = case (highestPaired &&& lowestFree) expConf of (Nothing, _) -> Nothing (_, Nothing) -> Nothing (Just h, Just l) -> if orbitalLayer (conf !! h) == orbitalLayer (expConf !! l) then Just . toList . update l (increase $ expConf !! l) . update h (decrease $ expConf !! h) $ fromList expConf else Nothing
802
excite conf = fmap removeEmptyShells excConf where increase (State l s e) = State l s (e + 1) decrease (State l s e) = State l s (e - 1) expConf = appendEmptyShells conf excConf = case (highestPaired &&& lowestFree) expConf of (Nothing, _) -> Nothing (_, Nothing) -> Nothing (Just h, Just l) -> if orbitalLayer (conf !! h) == orbitalLayer (expConf !! l) then Just . toList . update l (increase $ expConf !! l) . update h (decrease $ expConf !! h) $ fromList expConf else Nothing
753
false
true
3
16
371
251
128
123
null
null
DavidAlphaFox/ghc
libraries/haskeline/System/Console/Haskeline/Backend/Posix/Encoder.hs
bsd-3-clause
newEncoders = return (Encoder,Decoder)
38
newEncoders = return (Encoder,Decoder)
38
newEncoders = return (Encoder,Decoder)
38
false
false
1
5
3
18
8
10
null
null
maruks/haskell-book
src/Chapter15_monoids_2.hs
gpl-3.0
monoidLeftIdCombine :: Combine String String -> Bool monoidLeftIdCombine a = (unCombine (mempty <> a)) "a" == unCombine a "a"
125
monoidLeftIdCombine :: Combine String String -> Bool monoidLeftIdCombine a = (unCombine (mempty <> a)) "a" == unCombine a "a"
125
monoidLeftIdCombine a = (unCombine (mempty <> a)) "a" == unCombine a "a"
72
false
true
0
10
18
53
24
29
null
null
netogallo/polyvariant
src/Analysis/Types/Common.hs
bsd-3-clause
baseEmpty _ = return emptyC
27
baseEmpty _ = return emptyC
27
baseEmpty _ = return emptyC
27
false
false
0
5
4
12
5
7
null
null
niteria/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppHsTyVarBndr :: Unicode -> Qualification -> HsTyVarBndr DocName -> Html ppHsTyVarBndr _ qual (UserTyVar (L _ name)) = ppDocName qual Raw False name
158
ppHsTyVarBndr :: Unicode -> Qualification -> HsTyVarBndr DocName -> Html ppHsTyVarBndr _ qual (UserTyVar (L _ name)) = ppDocName qual Raw False name
158
ppHsTyVarBndr _ qual (UserTyVar (L _ name)) = ppDocName qual Raw False name
85
false
true
0
9
32
56
27
29
null
null
seereason/ghcjs
src/Compiler/DriverPipeline.hs
mit
pipeLoop :: PhasePlus -> FilePath -> CompPipeline (DynFlags, FilePath) pipeLoop phase input_fn = do env <- getPipeEnv dflags <- getDynFlags let happensBefore' = happensBefore dflags stopPhase = stop_phase env case phase of RealPhase realPhase | realPhase `eqPhase` stopPhase -- All done -> -- Sometimes, a compilation phase doesn't actually generate any output -- (eg. the CPP phase when -fcpp is not turned on). If we end on this -- stage, but we wanted to keep the output, then we have to explicitly -- copy the file, remembering to prepend a {-# LINE #-} pragma so that -- further compilation stages can tell what the original filename was. case output_spec env of Temporary -> return (dflags, input_fn) output -> do pst <- getPipeState final_fn <- liftIO $ getOutputFilename stopPhase output (src_basename env) dflags stopPhase (maybe_loc pst) when (final_fn /= input_fn) $ do let msg = ("Copying `" ++ input_fn ++"' to `" ++ final_fn ++ "'") line_prag = Just ("{-# LINE 1 \"" ++ src_filename env ++ "\" #-}\n") liftIO $ copyWithHeader dflags msg line_prag input_fn final_fn return (dflags, final_fn) | not (realPhase `happensBefore'` stopPhase) -- Something has gone wrong. We'll try to cover all the cases when -- this could happen, so if we reach here it is a panic. -- eg. it might happen if the -C flag is used on a source file that -- has {-# OPTIONS -fasm #-}. -> panic ("pipeLoop: at phase " ++ show realPhase ++ " but I wanted to stop at phase " ++ show stopPhase) _ -> do liftIO $ debugTraceMsg dflags 4 (ptext (sLit "Running phase") <+> ppr phase) (next_phase, output_fn) <- runHookedPhase phase input_fn dflags r <- pipeLoop next_phase output_fn case phase of HscOut {} -> whenGeneratingDynamicToo dflags $ do setDynFlags $ dynamicTooMkDynamicDynFlags dflags -- TODO shouldn't ignore result: _ <- pipeLoop phase input_fn return () _ -> return () return r
2,470
pipeLoop :: PhasePlus -> FilePath -> CompPipeline (DynFlags, FilePath) pipeLoop phase input_fn = do env <- getPipeEnv dflags <- getDynFlags let happensBefore' = happensBefore dflags stopPhase = stop_phase env case phase of RealPhase realPhase | realPhase `eqPhase` stopPhase -- All done -> -- Sometimes, a compilation phase doesn't actually generate any output -- (eg. the CPP phase when -fcpp is not turned on). If we end on this -- stage, but we wanted to keep the output, then we have to explicitly -- copy the file, remembering to prepend a {-# LINE #-} pragma so that -- further compilation stages can tell what the original filename was. case output_spec env of Temporary -> return (dflags, input_fn) output -> do pst <- getPipeState final_fn <- liftIO $ getOutputFilename stopPhase output (src_basename env) dflags stopPhase (maybe_loc pst) when (final_fn /= input_fn) $ do let msg = ("Copying `" ++ input_fn ++"' to `" ++ final_fn ++ "'") line_prag = Just ("{-# LINE 1 \"" ++ src_filename env ++ "\" #-}\n") liftIO $ copyWithHeader dflags msg line_prag input_fn final_fn return (dflags, final_fn) | not (realPhase `happensBefore'` stopPhase) -- Something has gone wrong. We'll try to cover all the cases when -- this could happen, so if we reach here it is a panic. -- eg. it might happen if the -C flag is used on a source file that -- has {-# OPTIONS -fasm #-}. -> panic ("pipeLoop: at phase " ++ show realPhase ++ " but I wanted to stop at phase " ++ show stopPhase) _ -> do liftIO $ debugTraceMsg dflags 4 (ptext (sLit "Running phase") <+> ppr phase) (next_phase, output_fn) <- runHookedPhase phase input_fn dflags r <- pipeLoop next_phase output_fn case phase of HscOut {} -> whenGeneratingDynamicToo dflags $ do setDynFlags $ dynamicTooMkDynamicDynFlags dflags -- TODO shouldn't ignore result: _ <- pipeLoop phase input_fn return () _ -> return () return r
2,470
pipeLoop phase input_fn = do env <- getPipeEnv dflags <- getDynFlags let happensBefore' = happensBefore dflags stopPhase = stop_phase env case phase of RealPhase realPhase | realPhase `eqPhase` stopPhase -- All done -> -- Sometimes, a compilation phase doesn't actually generate any output -- (eg. the CPP phase when -fcpp is not turned on). If we end on this -- stage, but we wanted to keep the output, then we have to explicitly -- copy the file, remembering to prepend a {-# LINE #-} pragma so that -- further compilation stages can tell what the original filename was. case output_spec env of Temporary -> return (dflags, input_fn) output -> do pst <- getPipeState final_fn <- liftIO $ getOutputFilename stopPhase output (src_basename env) dflags stopPhase (maybe_loc pst) when (final_fn /= input_fn) $ do let msg = ("Copying `" ++ input_fn ++"' to `" ++ final_fn ++ "'") line_prag = Just ("{-# LINE 1 \"" ++ src_filename env ++ "\" #-}\n") liftIO $ copyWithHeader dflags msg line_prag input_fn final_fn return (dflags, final_fn) | not (realPhase `happensBefore'` stopPhase) -- Something has gone wrong. We'll try to cover all the cases when -- this could happen, so if we reach here it is a panic. -- eg. it might happen if the -C flag is used on a source file that -- has {-# OPTIONS -fasm #-}. -> panic ("pipeLoop: at phase " ++ show realPhase ++ " but I wanted to stop at phase " ++ show stopPhase) _ -> do liftIO $ debugTraceMsg dflags 4 (ptext (sLit "Running phase") <+> ppr phase) (next_phase, output_fn) <- runHookedPhase phase input_fn dflags r <- pipeLoop next_phase output_fn case phase of HscOut {} -> whenGeneratingDynamicToo dflags $ do setDynFlags $ dynamicTooMkDynamicDynFlags dflags -- TODO shouldn't ignore result: _ <- pipeLoop phase input_fn return () _ -> return () return r
2,399
false
true
0
27
912
467
223
244
null
null
kawu/dawg
src/Data/DAWG/Graph.hs
bsd-2-clause
incIngo :: ID -> Graph n -> Graph n incIngo i g = g { ingoMap = M.insertWith' (+) i 1 (ingoMap g) }
99
incIngo :: ID -> Graph n -> Graph n incIngo i g = g { ingoMap = M.insertWith' (+) i 1 (ingoMap g) }
99
incIngo i g = g { ingoMap = M.insertWith' (+) i 1 (ingoMap g) }
63
false
true
0
9
23
57
29
28
null
null
nstoddard/unitcalc
Parse.hs
mit
reservedOps = ["#", "\\", "->"]
31
reservedOps = ["#", "\\", "->"]
31
reservedOps = ["#", "\\", "->"]
31
false
false
0
5
4
15
9
6
null
null
ancientlanguage/haskell-analysis
greek-morph/src/Grammar/Greek/Morph/Smyth/Prepositions.hs
mit
-- Smyth 1700-1702 improperWithGenitive = [accentedWords| ἄνευ ἄτερ ἄχρι μέχρι δίκην δίχα εἴσω ἔσω ἑκάς ἑκατέρωθεν ἐκτός ἔμπροσθεν ἕνεκα ἕνεκεν εἵνεκα εἵνεκεν οὕνεκα ἔνερθε ἐντός ἔξω εὐθύ καταντικρύ κρύφα λάθρᾳ μεταξύ μέχρι νόσφι ὄπισθεν πάρος πέρᾱ πέρᾱν πλήν πόρρω πρόσω πρίν σχεδόν τῆλε χάριν χωρίς |]
305
improperWithGenitive = [accentedWords| ἄνευ ἄτερ ἄχρι μέχρι δίκην δίχα εἴσω ἔσω ἑκάς ἑκατέρωθεν ἐκτός ἔμπροσθεν ἕνεκα ἕνεκεν εἵνεκα εἵνεκεν οὕνεκα ἔνερθε ἐντός ἔξω εὐθύ καταντικρύ κρύφα λάθρᾳ μεταξύ μέχρι νόσφι ὄπισθεν πάρος πέρᾱ πέρᾱν πλήν πόρρω πρόσω πρίν σχεδόν τῆλε χάριν χωρίς |]
286
improperWithGenitive = [accentedWords| ἄνευ ἄτερ ἄχρι μέχρι δίκην δίχα εἴσω ἔσω ἑκάς ἑκατέρωθεν ἐκτός ἔμπροσθεν ἕνεκα ἕνεκεν εἵνεκα εἵνεκεν οὕνεκα ἔνερθε ἐντός ἔξω εὐθύ καταντικρύ κρύφα λάθρᾳ μεταξύ μέχρι νόσφι ὄπισθεν πάρος πέρᾱ πέρᾱν πλήν πόρρω πρόσω πρίν σχεδόν τῆλε χάριν χωρίς |]
286
true
false
0
4
47
11
8
3
null
null
ksaveljev/hake-2
src/Game/Monsters/MTank.hs
bsd-3-clause
tankMoveAttackPostRocket :: MMoveT tankMoveAttackPostRocket = MMoveT "tankMoveAttackPostRocket" frameAttack331 frameAttack353 tankFramesAttackPostRocket (Just tankRun)
167
tankMoveAttackPostRocket :: MMoveT tankMoveAttackPostRocket = MMoveT "tankMoveAttackPostRocket" frameAttack331 frameAttack353 tankFramesAttackPostRocket (Just tankRun)
167
tankMoveAttackPostRocket = MMoveT "tankMoveAttackPostRocket" frameAttack331 frameAttack353 tankFramesAttackPostRocket (Just tankRun)
132
false
true
0
7
11
28
14
14
null
null
HIPERFIT/futhark
src/Futhark/Analysis/HORep/SOAC.hs
isc
toSOAC (Hist w ops lam arrs) = Futhark.Hist w <$> inputsToSubExps arrs <*> pure ops <*> pure lam
98
toSOAC (Hist w ops lam arrs) = Futhark.Hist w <$> inputsToSubExps arrs <*> pure ops <*> pure lam
98
toSOAC (Hist w ops lam arrs) = Futhark.Hist w <$> inputsToSubExps arrs <*> pure ops <*> pure lam
98
false
false
2
7
19
49
21
28
null
null
nyorem/skemmtun
src/MAL/Types/Manga.hs
mit
mangaAttributes :: [Name] mangaAttributes = [ "series_title" , "series_mangadb_id" , "my_status" , "my_read_chapters" , "series_chapters" , "my_read_volumes" , "series_volumes" , "my_score" , "my_tags" , "series_type" , "my_start_date" , "my_finish_date" ]
308
mangaAttributes :: [Name] mangaAttributes = [ "series_title" , "series_mangadb_id" , "my_status" , "my_read_chapters" , "series_chapters" , "my_read_volumes" , "series_volumes" , "my_score" , "my_tags" , "series_type" , "my_start_date" , "my_finish_date" ]
308
mangaAttributes = [ "series_title" , "series_mangadb_id" , "my_status" , "my_read_chapters" , "series_chapters" , "my_read_volumes" , "series_volumes" , "my_score" , "my_tags" , "series_type" , "my_start_date" , "my_finish_date" ]
282
false
true
0
5
81
50
32
18
null
null
Rydgel/advent-of-code-2016
src/Day7.hs
bsd-3-clause
day7' :: IO () day7' = do input <- T.lines . T.pack <$> readFile "resources/day7.txt" let results = rights $ map (parseOnly parseIP) input print $ countF (True ==) $ (\(sn,hn) -> (any (checkHn hn) (zipSn sn))) <$> results where zipSn = zip3 <*> drop 1 <*> drop 2 checkHn h (a,b,c) = a == c && a /= b && substring [b, a, b] h
340
day7' :: IO () day7' = do input <- T.lines . T.pack <$> readFile "resources/day7.txt" let results = rights $ map (parseOnly parseIP) input print $ countF (True ==) $ (\(sn,hn) -> (any (checkHn hn) (zipSn sn))) <$> results where zipSn = zip3 <*> drop 1 <*> drop 2 checkHn h (a,b,c) = a == c && a /= b && substring [b, a, b] h
340
day7' = do input <- T.lines . T.pack <$> readFile "resources/day7.txt" let results = rights $ map (parseOnly parseIP) input print $ countF (True ==) $ (\(sn,hn) -> (any (checkHn hn) (zipSn sn))) <$> results where zipSn = zip3 <*> drop 1 <*> drop 2 checkHn h (a,b,c) = a == c && a /= b && substring [b, a, b] h
325
false
true
1
14
81
189
96
93
null
null
pparkkin/eta
compiler/ETA/Utils/BooleanFormula.hs
bsd-3-clause
simplify f (Or xs) = mkOr (map (simplify f) xs)
47
simplify f (Or xs) = mkOr (map (simplify f) xs)
47
simplify f (Or xs) = mkOr (map (simplify f) xs)
47
false
false
0
9
9
34
16
18
null
null
brendanhay/gogol
gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Bidders/FilterSets/Get.hs
mpl-2.0
-- | V1 error format. bfsgXgafv :: Lens' BiddersFilterSetsGet (Maybe Xgafv) bfsgXgafv = lens _bfsgXgafv (\ s a -> s{_bfsgXgafv = a})
134
bfsgXgafv :: Lens' BiddersFilterSetsGet (Maybe Xgafv) bfsgXgafv = lens _bfsgXgafv (\ s a -> s{_bfsgXgafv = a})
112
bfsgXgafv = lens _bfsgXgafv (\ s a -> s{_bfsgXgafv = a})
58
true
true
0
9
23
48
25
23
null
null
NorfairKing/sus-depot
shared/shared/xmonad/Actions.hs
gpl-2.0
-- Files application files :: X () files = spawn "nautilus --no-desktop"
86
files :: X () files = spawn "nautilus --no-desktop"
65
files = spawn "nautilus --no-desktop"
51
true
true
0
7
25
25
11
14
null
null
keithodulaigh/Hets
LF/Sign.hs
gpl-2.0
-- checks if the symbol is defined or declared in the signature isConstant :: Symbol -> Sign -> Bool isConstant s sig = Set.member s $ getSymbols sig
149
isConstant :: Symbol -> Sign -> Bool isConstant s sig = Set.member s $ getSymbols sig
85
isConstant s sig = Set.member s $ getSymbols sig
48
true
true
0
7
27
41
19
22
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_INTENSITY :: GLenum gl_INTENSITY = 0x8049
44
gl_INTENSITY :: GLenum gl_INTENSITY = 0x8049
44
gl_INTENSITY = 0x8049
21
false
true
0
4
5
11
6
5
null
null
gridaphobe/liquid-fixpoint
src/Language/Fixpoint/Types/Names.hs
bsd-3-clause
dummySymbol = dummyName
23
dummySymbol = dummyName
23
dummySymbol = dummyName
23
false
false
0
4
2
6
3
3
null
null
literate-unitb/literate-unitb
src/Document/Scope.hs
mit
oneInherited :: ( HasDeclSource s DeclSource , HasInhStatus s (InhStatus a)) => s -> s -> Bool oneInherited x y = (x^.declSource == Inherited && y^.declSource == Inherited) || (x^.declSource == Inherited && _InhAdd `is` (x^.inhStatus)) || (y^.declSource == Inherited && _InhAdd `is` (y^.inhStatus))
355
oneInherited :: ( HasDeclSource s DeclSource , HasInhStatus s (InhStatus a)) => s -> s -> Bool oneInherited x y = (x^.declSource == Inherited && y^.declSource == Inherited) || (x^.declSource == Inherited && _InhAdd `is` (x^.inhStatus)) || (y^.declSource == Inherited && _InhAdd `is` (y^.inhStatus))
355
oneInherited x y = (x^.declSource == Inherited && y^.declSource == Inherited) || (x^.declSource == Inherited && _InhAdd `is` (x^.inhStatus)) || (y^.declSource == Inherited && _InhAdd `is` (y^.inhStatus))
231
false
true
0
12
100
136
73
63
null
null
zc1036/Compiler-project
src/Analyzer.hs
gpl-3.0
isIntegral _ = False
20
isIntegral _ = False
20
isIntegral _ = False
20
false
false
0
5
3
9
4
5
null
null
lovasko/swim
src/Command/Show/Perform.hs
bsd-2-clause
createTable :: ShowOptions -- ^ command-line options -> Story -- ^ story -> T.Text -- ^ table layout createTable options story = tabl EnvAscii hdecor vdecor aligns cells where hdecor = DecorUnion [DecorOuter, DecorOnly [1]] vdecor = DecorAll aligns = [AlignLeft, AlignRight] cells = ["Time", "Value"] : selectEntries entries (showOptCount options) entries = map (createEntry (showOptTimestamp options)) story -- | Pretty-print the content of a story file.
518
createTable :: ShowOptions -- ^ command-line options -> Story -- ^ story -> T.Text createTable options story = tabl EnvAscii hdecor vdecor aligns cells where hdecor = DecorUnion [DecorOuter, DecorOnly [1]] vdecor = DecorAll aligns = [AlignLeft, AlignRight] cells = ["Time", "Value"] : selectEntries entries (showOptCount options) entries = map (createEntry (showOptTimestamp options)) story -- | Pretty-print the content of a story file.
495
createTable options story = tabl EnvAscii hdecor vdecor aligns cells where hdecor = DecorUnion [DecorOuter, DecorOnly [1]] vdecor = DecorAll aligns = [AlignLeft, AlignRight] cells = ["Time", "Value"] : selectEntries entries (showOptCount options) entries = map (createEntry (showOptTimestamp options)) story -- | Pretty-print the content of a story file.
382
true
true
4
10
129
131
69
62
null
null
ezyang/ghc
ghc/Main.hs
bsd-3-clause
countFS :: Int -> Int -> Int -> [[FastString]] -> (Int, Int, Int) countFS entries longest has_z [] = (entries, longest, has_z)
126
countFS :: Int -> Int -> Int -> [[FastString]] -> (Int, Int, Int) countFS entries longest has_z [] = (entries, longest, has_z)
126
countFS entries longest has_z [] = (entries, longest, has_z)
60
false
true
0
10
21
67
36
31
null
null