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
frodwith/baduk-formats
src/Codec/Baduk/Emitter/SGF.hs
bsd-3-clause
game2sgf :: Game -> T.Text game2sgf g = let (Player bn br) = (black g) (Player wn wr) = (white g) in T.concat [ "(;" , tag "FF" "4" , tag "GM" "1" , tag "SZ" (showT (size g)) , tag "PB" bn , tag "BR" (printRank br) , tag "PW" wn , tag "WR" (printRank wr) , tag "HA" (showT (handicap g)) , tag "KM" (showT (komi g)) , tag "DT" (printTime (time g)) , tag "RE" (printResult (result g)) , T.concat (map printMove (moves g)) , ")" ]
807
game2sgf :: Game -> T.Text game2sgf g = let (Player bn br) = (black g) (Player wn wr) = (white g) in T.concat [ "(;" , tag "FF" "4" , tag "GM" "1" , tag "SZ" (showT (size g)) , tag "PB" bn , tag "BR" (printRank br) , tag "PW" wn , tag "WR" (printRank wr) , tag "HA" (showT (handicap g)) , tag "KM" (showT (komi g)) , tag "DT" (printTime (time g)) , tag "RE" (printResult (result g)) , T.concat (map printMove (moves g)) , ")" ]
807
game2sgf g = let (Player bn br) = (black g) (Player wn wr) = (white g) in T.concat [ "(;" , tag "FF" "4" , tag "GM" "1" , tag "SZ" (showT (size g)) , tag "PB" bn , tag "BR" (printRank br) , tag "PW" wn , tag "WR" (printRank wr) , tag "HA" (showT (handicap g)) , tag "KM" (showT (komi g)) , tag "DT" (printTime (time g)) , tag "RE" (printResult (result g)) , T.concat (map printMove (moves g)) , ")" ]
780
false
true
0
13
469
259
129
130
null
null
grnet/snf-ganeti
src/Ganeti/Constants.hs
bsd-2-clause
hvKvmExtra :: String hvKvmExtra = "kvm_extra"
45
hvKvmExtra :: String hvKvmExtra = "kvm_extra"
45
hvKvmExtra = "kvm_extra"
24
false
true
0
6
5
18
7
11
null
null
kylcarte/ink-ui
src/Lucid/Ink.hs
bsd-3-clause
-- }}} -- Visibility {{{ showElem_, hideElem_ :: Text showElem_ = sp "show"
77
showElem_, hideElem_ :: Text showElem_ = sp "show"
50
showElem_ = sp "show"
21
true
true
0
5
14
18
11
7
null
null
bravit/Idris-dev
src/Idris/REPL/Parser.hs
bsd-3-clause
cmd_cats :: String -> P.IdrisParser (Either String Command) cmd_cats name = do cs <- sepBy pLogCats (P.whiteSpace) eof return $ Right $ LogCategory (concat cs) where badCat = do c <- fst <$> P.identifier fail $ "Category: " ++ c ++ " is not recognised." pLogCats :: P.IdrisParser [LogCat] pLogCats = try (P.symbol (strLogCat IParse) >> return parserCats) <|> try (P.symbol (strLogCat IElab) >> return elabCats) <|> try (P.symbol (strLogCat ICodeGen) >> return codegenCats) <|> try (P.symbol (strLogCat ICoverage) >> return [ICoverage]) <|> try (P.symbol (strLogCat IIBC) >> return [IIBC]) <|> try (P.symbol (strLogCat IErasure) >> return [IErasure]) <|> badCat
779
cmd_cats :: String -> P.IdrisParser (Either String Command) cmd_cats name = do cs <- sepBy pLogCats (P.whiteSpace) eof return $ Right $ LogCategory (concat cs) where badCat = do c <- fst <$> P.identifier fail $ "Category: " ++ c ++ " is not recognised." pLogCats :: P.IdrisParser [LogCat] pLogCats = try (P.symbol (strLogCat IParse) >> return parserCats) <|> try (P.symbol (strLogCat IElab) >> return elabCats) <|> try (P.symbol (strLogCat ICodeGen) >> return codegenCats) <|> try (P.symbol (strLogCat ICoverage) >> return [ICoverage]) <|> try (P.symbol (strLogCat IIBC) >> return [IIBC]) <|> try (P.symbol (strLogCat IErasure) >> return [IErasure]) <|> badCat
779
cmd_cats name = do cs <- sepBy pLogCats (P.whiteSpace) eof return $ Right $ LogCategory (concat cs) where badCat = do c <- fst <$> P.identifier fail $ "Category: " ++ c ++ " is not recognised." pLogCats :: P.IdrisParser [LogCat] pLogCats = try (P.symbol (strLogCat IParse) >> return parserCats) <|> try (P.symbol (strLogCat IElab) >> return elabCats) <|> try (P.symbol (strLogCat ICodeGen) >> return codegenCats) <|> try (P.symbol (strLogCat ICoverage) >> return [ICoverage]) <|> try (P.symbol (strLogCat IIBC) >> return [IIBC]) <|> try (P.symbol (strLogCat IErasure) >> return [IErasure]) <|> badCat
719
false
true
0
16
218
302
144
158
null
null
vladimir-ipatov/ganeti
src/Ganeti/Constants.hs
gpl-2.0
diskLdDefaults :: Map DiskTemplate (Map String PyValueEx) diskLdDefaults = Map.fromList [ (DTBlock, Map.empty) , (DTDrbd8, Map.fromList [ (ldpBarriers, PyValueEx drbdBarriers) , (ldpDefaultMetavg, PyValueEx defaultVg) , (ldpDelayTarget, PyValueEx defaultDelayTarget) , (ldpDiskCustom, PyValueEx defaultDiskCustom) , (ldpDynamicResync, PyValueEx defaultDiskResync) , (ldpFillTarget, PyValueEx defaultFillTarget) , (ldpMaxRate, PyValueEx classicDrbdSyncSpeed) , (ldpMinRate, PyValueEx defaultMinRate) , (ldpNetCustom, PyValueEx defaultNetCustom) , (ldpNoMetaFlush, PyValueEx drbdNoMetaFlush) , (ldpPlanAhead, PyValueEx defaultPlanAhead) , (ldpProtocol, PyValueEx drbdDefaultNetProtocol) , (ldpResyncRate, PyValueEx classicDrbdSyncSpeed) ]) , (DTExt, Map.empty) , (DTFile, Map.empty) , (DTPlain, Map.fromList [(ldpStripes, PyValueEx lvmStripecount)]) , (DTRbd, Map.fromList [ (ldpPool, PyValueEx defaultRbdPool) , (ldpAccess, PyValueEx diskKernelspace) ]) , (DTSharedFile, Map.empty) ]
1,275
diskLdDefaults :: Map DiskTemplate (Map String PyValueEx) diskLdDefaults = Map.fromList [ (DTBlock, Map.empty) , (DTDrbd8, Map.fromList [ (ldpBarriers, PyValueEx drbdBarriers) , (ldpDefaultMetavg, PyValueEx defaultVg) , (ldpDelayTarget, PyValueEx defaultDelayTarget) , (ldpDiskCustom, PyValueEx defaultDiskCustom) , (ldpDynamicResync, PyValueEx defaultDiskResync) , (ldpFillTarget, PyValueEx defaultFillTarget) , (ldpMaxRate, PyValueEx classicDrbdSyncSpeed) , (ldpMinRate, PyValueEx defaultMinRate) , (ldpNetCustom, PyValueEx defaultNetCustom) , (ldpNoMetaFlush, PyValueEx drbdNoMetaFlush) , (ldpPlanAhead, PyValueEx defaultPlanAhead) , (ldpProtocol, PyValueEx drbdDefaultNetProtocol) , (ldpResyncRate, PyValueEx classicDrbdSyncSpeed) ]) , (DTExt, Map.empty) , (DTFile, Map.empty) , (DTPlain, Map.fromList [(ldpStripes, PyValueEx lvmStripecount)]) , (DTRbd, Map.fromList [ (ldpPool, PyValueEx defaultRbdPool) , (ldpAccess, PyValueEx diskKernelspace) ]) , (DTSharedFile, Map.empty) ]
1,275
diskLdDefaults = Map.fromList [ (DTBlock, Map.empty) , (DTDrbd8, Map.fromList [ (ldpBarriers, PyValueEx drbdBarriers) , (ldpDefaultMetavg, PyValueEx defaultVg) , (ldpDelayTarget, PyValueEx defaultDelayTarget) , (ldpDiskCustom, PyValueEx defaultDiskCustom) , (ldpDynamicResync, PyValueEx defaultDiskResync) , (ldpFillTarget, PyValueEx defaultFillTarget) , (ldpMaxRate, PyValueEx classicDrbdSyncSpeed) , (ldpMinRate, PyValueEx defaultMinRate) , (ldpNetCustom, PyValueEx defaultNetCustom) , (ldpNoMetaFlush, PyValueEx drbdNoMetaFlush) , (ldpPlanAhead, PyValueEx defaultPlanAhead) , (ldpProtocol, PyValueEx drbdDefaultNetProtocol) , (ldpResyncRate, PyValueEx classicDrbdSyncSpeed) ]) , (DTExt, Map.empty) , (DTFile, Map.empty) , (DTPlain, Map.fromList [(ldpStripes, PyValueEx lvmStripecount)]) , (DTRbd, Map.fromList [ (ldpPool, PyValueEx defaultRbdPool) , (ldpAccess, PyValueEx diskKernelspace) ]) , (DTSharedFile, Map.empty) ]
1,217
false
true
1
11
389
312
178
134
null
null
hferreiro/replay
testsuite/tests/esc/TestImport.hs
bsd-3-clause
-- same as TestList.res5 t2a = res2
36
t2a = res2
10
t2a = res2
10
true
false
0
4
7
7
4
3
null
null
Helkafen/haddock
haddock-api/src/Haddock/Version.hs
bsd-2-clause
projectUrl :: String projectUrl = "http://www.haskell.org/haddock/"
68
projectUrl :: String projectUrl = "http://www.haskell.org/haddock/"
68
projectUrl = "http://www.haskell.org/haddock/"
47
false
true
0
4
6
11
6
5
null
null
harrisi/on-being-better
list-expansion/Haskell/course/src/Course/MoreParser.hs
cc0-1.0
-- | Write a parser that parses between the two given characters, separated by a comma character ','. -- -- /Tip:/ Use `betweenCharTok`, `sepby` and `charTok`. -- -- >>> parse (betweenSepbyComma '[' ']' lower) "[a]" -- Result >< "a" -- -- >>> parse (betweenSepbyComma '[' ']' lower) "[]" -- Result >< "" -- -- >>> isErrorResult (parse (betweenSepbyComma '[' ']' lower) "[A]") -- True -- -- >>> isErrorResult (parse (betweenSepbyComma '[' ']' lower) "[abc]") -- True -- -- >>> isErrorResult (parse (betweenSepbyComma '[' ']' lower) "[a") -- True -- -- >>> isErrorResult (parse (betweenSepbyComma '[' ']' lower) "a]") -- True betweenSepbyComma :: Char -> Char -> Parser a -> Parser (List a) betweenSepbyComma = error "todo: Course.MoreParser#betweenSepbyComma"
768
betweenSepbyComma :: Char -> Char -> Parser a -> Parser (List a) betweenSepbyComma = error "todo: Course.MoreParser#betweenSepbyComma"
144
betweenSepbyComma = error "todo: Course.MoreParser#betweenSepbyComma"
71
true
true
0
11
126
61
39
22
null
null
bravit/Idris-dev
src/Idris/Core/Unify.hs
bsd-3-clause
hasv _ = False
14
hasv _ = False
14
hasv _ = False
14
false
false
0
4
3
10
4
6
null
null
ComputationWithBoundedResources/tct-jbc
src/Tct/Jbc/Processor/PolynomialInterpretation.hs
bsd-3-clause
mkInterpretation :: PI.Shape -> S.Set J.PAFun -> (J.PAFun, Int) -> PolyV mkInterpretation shp cs (f, ar) = case f of J.IConst i -> [(IntCoefficient i,[])] -- J.Add -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient 1 , [(Indeterminate 2,1)])] -- J.Sub -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient (-1), [(Indeterminate 2,1)])] _ | f `elem` cs -> P.linear (const RestrictCoefficient) vs | otherwise -> fromShape shp (const mkCoefficient) vs where vs = take ar indeterminates mkCoefficient = if shp == PI.StronglyLinear then RestrictCoefficient else SomeCoefficient fromShape PI.StronglyLinear = P.linear fromShape PI.Linear = P.linear fromShape PI.Quadratic = P.quadratic fromShape (PI.Mixed i) = P.mixed i
818
mkInterpretation :: PI.Shape -> S.Set J.PAFun -> (J.PAFun, Int) -> PolyV mkInterpretation shp cs (f, ar) = case f of J.IConst i -> [(IntCoefficient i,[])] -- J.Add -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient 1 , [(Indeterminate 2,1)])] -- J.Sub -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient (-1), [(Indeterminate 2,1)])] _ | f `elem` cs -> P.linear (const RestrictCoefficient) vs | otherwise -> fromShape shp (const mkCoefficient) vs where vs = take ar indeterminates mkCoefficient = if shp == PI.StronglyLinear then RestrictCoefficient else SomeCoefficient fromShape PI.StronglyLinear = P.linear fromShape PI.Linear = P.linear fromShape PI.Quadratic = P.quadratic fromShape (PI.Mixed i) = P.mixed i
818
mkInterpretation shp cs (f, ar) = case f of J.IConst i -> [(IntCoefficient i,[])] -- J.Add -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient 1 , [(Indeterminate 2,1)])] -- J.Sub -> [(IntCoefficient 1, [(Indeterminate 1,1)]), (IntCoefficient (-1), [(Indeterminate 2,1)])] _ | f `elem` cs -> P.linear (const RestrictCoefficient) vs | otherwise -> fromShape shp (const mkCoefficient) vs where vs = take ar indeterminates mkCoefficient = if shp == PI.StronglyLinear then RestrictCoefficient else SomeCoefficient fromShape PI.StronglyLinear = P.linear fromShape PI.Linear = P.linear fromShape PI.Quadratic = P.quadratic fromShape (PI.Mixed i) = P.mixed i
745
false
true
0
11
182
226
115
111
null
null
Danten/lejf
src/Evaluate/Eval.hs
bsd-3-clause
bindVal' :: Variable -> Val -> Endo (Eval a) bindVal' f p = local (\ e -> e { valEnv = Map.insert f p (valEnv e)})
114
bindVal' :: Variable -> Val -> Endo (Eval a) bindVal' f p = local (\ e -> e { valEnv = Map.insert f p (valEnv e)})
114
bindVal' f p = local (\ e -> e { valEnv = Map.insert f p (valEnv e)})
69
false
true
0
12
25
71
35
36
null
null
fmthoma/ghc
compiler/types/Type.hs
bsd-3-clause
isDictLikeTy ty = case splitTyConApp_maybe ty of Just (tc, tys) | isClassTyCon tc -> True | isTupleTyCon tc -> all isDictLikeTy tys _other -> False {- Note [Dictionary-like types] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Being "dictionary-like" means either a dictionary type or a tuple thereof. In GHC 6.10 we build implication constraints which construct such tuples, and if we land up with a binding t :: (C [a], Eq [a]) t = blah then we want to treat t as cheap under "-fdicts-cheap" for example. (Implication constraints are normally inlined, but sadly not if the occurrence is itself inside an INLINE function! Until we revise the handling of implication constraints, that is.) This turned out to be important in getting good arities in DPH code. Example: class C a class D a where { foo :: a -> a } instance C a => D (Maybe a) where { foo x = x } bar :: (C a, C b) => a -> b -> (Maybe a, Maybe b) {-# INLINE bar #-} bar x y = (foo (Just x), foo (Just y)) Then 'bar' should jolly well have arity 4 (two dicts, two args), but we ended up with something like bar = __inline_me__ (\d1,d2. let t :: (D (Maybe a), D (Maybe b)) = ... in \x,y. <blah>) This is all a bit ad-hoc; eg it relies on knowing that implication constraints build tuples. Decomposing PredType -} -- | A choice of equality relation. This is separate from the type 'Role' -- because 'Phantom' does not define a (non-trivial) equality relation.
1,544
isDictLikeTy ty = case splitTyConApp_maybe ty of Just (tc, tys) | isClassTyCon tc -> True | isTupleTyCon tc -> all isDictLikeTy tys _other -> False {- Note [Dictionary-like types] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Being "dictionary-like" means either a dictionary type or a tuple thereof. In GHC 6.10 we build implication constraints which construct such tuples, and if we land up with a binding t :: (C [a], Eq [a]) t = blah then we want to treat t as cheap under "-fdicts-cheap" for example. (Implication constraints are normally inlined, but sadly not if the occurrence is itself inside an INLINE function! Until we revise the handling of implication constraints, that is.) This turned out to be important in getting good arities in DPH code. Example: class C a class D a where { foo :: a -> a } instance C a => D (Maybe a) where { foo x = x } bar :: (C a, C b) => a -> b -> (Maybe a, Maybe b) {-# INLINE bar #-} bar x y = (foo (Just x), foo (Just y)) Then 'bar' should jolly well have arity 4 (two dicts, two args), but we ended up with something like bar = __inline_me__ (\d1,d2. let t :: (D (Maybe a), D (Maybe b)) = ... in \x,y. <blah>) This is all a bit ad-hoc; eg it relies on knowing that implication constraints build tuples. Decomposing PredType -} -- | A choice of equality relation. This is separate from the type 'Role' -- because 'Phantom' does not define a (non-trivial) equality relation.
1,544
isDictLikeTy ty = case splitTyConApp_maybe ty of Just (tc, tys) | isClassTyCon tc -> True | isTupleTyCon tc -> all isDictLikeTy tys _other -> False {- Note [Dictionary-like types] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Being "dictionary-like" means either a dictionary type or a tuple thereof. In GHC 6.10 we build implication constraints which construct such tuples, and if we land up with a binding t :: (C [a], Eq [a]) t = blah then we want to treat t as cheap under "-fdicts-cheap" for example. (Implication constraints are normally inlined, but sadly not if the occurrence is itself inside an INLINE function! Until we revise the handling of implication constraints, that is.) This turned out to be important in getting good arities in DPH code. Example: class C a class D a where { foo :: a -> a } instance C a => D (Maybe a) where { foo x = x } bar :: (C a, C b) => a -> b -> (Maybe a, Maybe b) {-# INLINE bar #-} bar x y = (foo (Just x), foo (Just y)) Then 'bar' should jolly well have arity 4 (two dicts, two args), but we ended up with something like bar = __inline_me__ (\d1,d2. let t :: (D (Maybe a), D (Maybe b)) = ... in \x,y. <blah>) This is all a bit ad-hoc; eg it relies on knowing that implication constraints build tuples. Decomposing PredType -} -- | A choice of equality relation. This is separate from the type 'Role' -- because 'Phantom' does not define a (non-trivial) equality relation.
1,544
false
false
2
8
401
54
26
28
null
null
glutamate/probably-baysig
src/Math/Probably/Student.hs
bsd-3-clause
--gammaln :: Double -> Double gammaln xx = let tmp' = (xx+5.5) - (xx+0.5)*log(xx+5.5) ser' = foldl (+) ser $ map (\(y,c) -> c/(xx+y)) $ zip [1..] cof in -tmp' + log(2.5066282746310005 * ser' / xx)
226
gammaln xx = let tmp' = (xx+5.5) - (xx+0.5)*log(xx+5.5) ser' = foldl (+) ser $ map (\(y,c) -> c/(xx+y)) $ zip [1..] cof in -tmp' + log(2.5066282746310005 * ser' / xx)
196
gammaln xx = let tmp' = (xx+5.5) - (xx+0.5)*log(xx+5.5) ser' = foldl (+) ser $ map (\(y,c) -> c/(xx+y)) $ zip [1..] cof in -tmp' + log(2.5066282746310005 * ser' / xx)
196
true
false
0
16
65
129
68
61
null
null
brendanhay/gogol
gogol-classroom/gen/Network/Google/Classroom/Types/Product.hs
mpl-2.0
-- | Title for this set. cmsTitle :: Lens' CourseMaterialSet (Maybe Text) cmsTitle = lens _cmsTitle (\ s a -> s{_cmsTitle = a})
127
cmsTitle :: Lens' CourseMaterialSet (Maybe Text) cmsTitle = lens _cmsTitle (\ s a -> s{_cmsTitle = a})
102
cmsTitle = lens _cmsTitle (\ s a -> s{_cmsTitle = a})
53
true
true
2
9
22
55
25
30
null
null
vTurbine/ghc
compiler/rename/RnBinds.hs
bsd-3-clause
rnBind sig_fn bind@(FunBind { fun_id = name , fun_matches = matches }) -- invariant: no free vars here when it's a FunBind = do { let plain_name = unLoc name ; (matches', rhs_fvs) <- bindSigTyVarsFV (sig_fn plain_name) $ -- bindSigTyVars tests for LangExt.ScopedTyVars rnMatchGroup (FunRhs name Prefix) rnLExpr matches ; let is_infix = isInfixFunBind bind ; when is_infix $ checkPrecMatch plain_name matches' ; mod <- getModule ; let fvs' = filterNameSet (nameIsLocalOrFrom mod) rhs_fvs -- Keep locally-defined Names -- As well as dependency analysis, we need these for the -- MonoLocalBinds test in TcBinds.decideGeneralisationPlan ; fvs' `seq` -- See Note [Free-variable space leak] return (bind { fun_matches = matches' , bind_fvs = fvs' }, [plain_name], rhs_fvs) }
1,075
rnBind sig_fn bind@(FunBind { fun_id = name , fun_matches = matches }) -- invariant: no free vars here when it's a FunBind = do { let plain_name = unLoc name ; (matches', rhs_fvs) <- bindSigTyVarsFV (sig_fn plain_name) $ -- bindSigTyVars tests for LangExt.ScopedTyVars rnMatchGroup (FunRhs name Prefix) rnLExpr matches ; let is_infix = isInfixFunBind bind ; when is_infix $ checkPrecMatch plain_name matches' ; mod <- getModule ; let fvs' = filterNameSet (nameIsLocalOrFrom mod) rhs_fvs -- Keep locally-defined Names -- As well as dependency analysis, we need these for the -- MonoLocalBinds test in TcBinds.decideGeneralisationPlan ; fvs' `seq` -- See Note [Free-variable space leak] return (bind { fun_matches = matches' , bind_fvs = fvs' }, [plain_name], rhs_fvs) }
1,075
rnBind sig_fn bind@(FunBind { fun_id = name , fun_matches = matches }) -- invariant: no free vars here when it's a FunBind = do { let plain_name = unLoc name ; (matches', rhs_fvs) <- bindSigTyVarsFV (sig_fn plain_name) $ -- bindSigTyVars tests for LangExt.ScopedTyVars rnMatchGroup (FunRhs name Prefix) rnLExpr matches ; let is_infix = isInfixFunBind bind ; when is_infix $ checkPrecMatch plain_name matches' ; mod <- getModule ; let fvs' = filterNameSet (nameIsLocalOrFrom mod) rhs_fvs -- Keep locally-defined Names -- As well as dependency analysis, we need these for the -- MonoLocalBinds test in TcBinds.decideGeneralisationPlan ; fvs' `seq` -- See Note [Free-variable space leak] return (bind { fun_matches = matches' , bind_fvs = fvs' }, [plain_name], rhs_fvs) }
1,075
false
false
0
12
423
191
103
88
null
null
rueshyna/gogol
gogol-civicinfo/gen/Network/Google/CivicInfo/Types/Product.hs
mpl-2.0
-- | Creates a value of 'DivisionSearchRequest' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'dsrContextParams' divisionSearchRequest :: DivisionSearchRequest divisionSearchRequest = DivisionSearchRequest' { _dsrContextParams = Nothing }
341
divisionSearchRequest :: DivisionSearchRequest divisionSearchRequest = DivisionSearchRequest' { _dsrContextParams = Nothing }
141
divisionSearchRequest = DivisionSearchRequest' { _dsrContextParams = Nothing }
90
true
true
1
6
60
30
17
13
null
null
jrclogic/SMCDEL
src/SMCDEL/Symbolic/K.hs
gpl-2.0
evalViaBdd :: BelScene -> Form -> Bool evalViaBdd (bls@(BlS allprops _ _),s) f = let bdd = bddOf bls f b = restrictSet bdd list list = [ (n, P n `elem` s) | (P n) <- allprops ] in case (b==top,b==bot) of (True,_) -> True (_,True) -> False _ -> error $ "evalViaBdd failed: Composite BDD leftover!\n" ++ " bls: " ++ show bls ++ "\n" ++ " s: " ++ show s ++ "\n" ++ " form: " ++ show f ++ "\n" ++ " bdd: " ++ show bdd ++ "\n" ++ " list: " ++ show list ++ "\n" ++ " b: " ++ show b ++ "\n"
592
evalViaBdd :: BelScene -> Form -> Bool evalViaBdd (bls@(BlS allprops _ _),s) f = let bdd = bddOf bls f b = restrictSet bdd list list = [ (n, P n `elem` s) | (P n) <- allprops ] in case (b==top,b==bot) of (True,_) -> True (_,True) -> False _ -> error $ "evalViaBdd failed: Composite BDD leftover!\n" ++ " bls: " ++ show bls ++ "\n" ++ " s: " ++ show s ++ "\n" ++ " form: " ++ show f ++ "\n" ++ " bdd: " ++ show bdd ++ "\n" ++ " list: " ++ show list ++ "\n" ++ " b: " ++ show b ++ "\n"
592
evalViaBdd (bls@(BlS allprops _ _),s) f = let bdd = bddOf bls f b = restrictSet bdd list list = [ (n, P n `elem` s) | (P n) <- allprops ] in case (b==top,b==bot) of (True,_) -> True (_,True) -> False _ -> error $ "evalViaBdd failed: Composite BDD leftover!\n" ++ " bls: " ++ show bls ++ "\n" ++ " s: " ++ show s ++ "\n" ++ " form: " ++ show f ++ "\n" ++ " bdd: " ++ show bdd ++ "\n" ++ " list: " ++ show list ++ "\n" ++ " b: " ++ show b ++ "\n"
553
false
true
0
28
220
248
127
121
null
null
ancientlanguage/haskell-analysis
prepare/src/Prepare/Decompose.hs
mit
decomposeChar '\x0168' = "\x0055\x0303"
39
decomposeChar '\x0168' = "\x0055\x0303"
39
decomposeChar '\x0168' = "\x0055\x0303"
39
false
false
1
5
3
13
4
9
null
null
ghc-android/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
boolTyConKey = mkPreludeTyConUnique 4
65
boolTyConKey = mkPreludeTyConUnique 4
65
boolTyConKey = mkPreludeTyConUnique 4
65
false
false
0
5
31
9
4
5
null
null
olorin/nagios-perfdata
src/Data/Nagios/Perfdata/GearmanResult.hs
bsd-3-clause
checkMetrics :: CheckResultMap -> Either ParserError MetricList checkMetrics m = case M.lookup "output" m of Nothing -> Left "check output not found" Just s -> do metricPart <- parsePluginOutput (C.pack s) parseMetricString (C.pack metricPart)
287
checkMetrics :: CheckResultMap -> Either ParserError MetricList checkMetrics m = case M.lookup "output" m of Nothing -> Left "check output not found" Just s -> do metricPart <- parsePluginOutput (C.pack s) parseMetricString (C.pack metricPart)
287
checkMetrics m = case M.lookup "output" m of Nothing -> Left "check output not found" Just s -> do metricPart <- parsePluginOutput (C.pack s) parseMetricString (C.pack metricPart)
223
false
true
0
14
77
84
38
46
null
null
Solumin/ScriptNScribe
src/BreveLang.hs
mit
parsePatSnippet :: Parser Pat parsePatSnippet = Psnip <$> b_braces (b_commaSep parsePat)
88
parsePatSnippet :: Parser Pat parsePatSnippet = Psnip <$> b_braces (b_commaSep parsePat)
88
parsePatSnippet = Psnip <$> b_braces (b_commaSep parsePat)
58
false
true
0
8
10
27
13
14
null
null
themoritz/cabal
cabal-install/Distribution/Client/TargetSelector.hs
bsd-3-clause
makeRelativeToCwd :: Applicative m => DirActions m -> FilePath -> m FilePath makeRelativeToCwd DirActions{..} path = makeRelativeCanonical <$> canonicalizePath path <*> getCurrentDirectory
192
makeRelativeToCwd :: Applicative m => DirActions m -> FilePath -> m FilePath makeRelativeToCwd DirActions{..} path = makeRelativeCanonical <$> canonicalizePath path <*> getCurrentDirectory
192
makeRelativeToCwd DirActions{..} path = makeRelativeCanonical <$> canonicalizePath path <*> getCurrentDirectory
115
false
true
0
8
25
54
25
29
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/topic/general/haskellforall/src/X_2012_06_09_why_free_monads_matter.hs
unlicense
sendBullet dir = Game dir
27
sendBullet dir = Game dir
27
sendBullet dir = Game dir
27
false
false
1
5
6
16
5
11
null
null
nick-orton/euler
src/Euler/Primes.hs
gpl-3.0
primes_from_sieve = sieve [2 ..]
32
primes_from_sieve = sieve [2 ..]
32
primes_from_sieve = sieve [2 ..]
32
false
false
1
6
4
16
7
9
null
null
sonsongithub/LearnHaskell
sample.hs
mit
digits :: Int -> Int digits = length . show
43
digits :: Int -> Int digits = length . show
43
digits = length . show
22
false
true
0
5
9
19
10
9
null
null
keithodulaigh/Hets
RelationalScheme/Keywords.hs
gpl-2.0
rsDoubleId :: Id rsDoubleId = stringToId rsDouble
49
rsDoubleId :: Id rsDoubleId = stringToId rsDouble
49
rsDoubleId = stringToId rsDouble
32
false
true
0
6
6
21
8
13
null
null
tolysz/prepare-ghcjs
spec-lts8/base/Foreign/C/Error.hs
bsd-3-clause
eILSEQ = Errno (CONST_EILSEQ)
38
eILSEQ = Errno (CONST_EILSEQ)
38
eILSEQ = Errno (CONST_EILSEQ)
38
false
false
0
6
12
12
6
6
null
null
mapinguari/SC_HS_Proxy
src/Proxy/Query/Unit.hs
mit
isWorker TerranBunker = False
29
isWorker TerranBunker = False
29
isWorker TerranBunker = False
29
false
false
0
5
3
9
4
5
null
null
exercism/xhaskell
exercises/practice/pov/test/Tests.hs
mit
flat' = Node "x" [ Node "root" [ leaf "a" , leaf "b" , leaf "c" ] ]
163
flat' = Node "x" [ Node "root" [ leaf "a" , leaf "b" , leaf "c" ] ]
163
flat' = Node "x" [ Node "root" [ leaf "a" , leaf "b" , leaf "c" ] ]
163
false
false
0
9
113
37
18
19
null
null
jmct/IterativeCompiler
frontend/GMachine.hs
mit
showInstruction Par = IStr "Par"
43
showInstruction Par = IStr "Par"
43
showInstruction Par = IStr "Par"
43
false
false
0
5
15
12
5
7
null
null
jjingram/satori
src/Codegen.hs
bsd-3-clause
entry :: Codegen AST.Name entry = gets currentBlock
51
entry :: Codegen AST.Name entry = gets currentBlock
51
entry = gets currentBlock
25
false
true
0
6
7
19
9
10
null
null
mightymoose/liquidhaskell
benchmarks/llrbtree-0.1.1/Data/Set/WBTree.hs
bsd-3-clause
intersection :: Ord a => WBTree a -> WBTree a -> WBTree a intersection Leaf _ = Leaf
84
intersection :: Ord a => WBTree a -> WBTree a -> WBTree a intersection Leaf _ = Leaf
84
intersection Leaf _ = Leaf
26
false
true
0
8
17
40
18
22
null
null
d3zd3z/HaskellNet-old
Network/HaskellNet/POP3.hs
bsd-3-clause
-- | -- connecting to the pop3 server via a stream connectStream :: BSStream s => s -> IO (POP3Connection s) connectStream st = do (resp, msg) <- response st when (resp == Err) $ fail "cannot connect" let code = last $ BS.words msg if BS.head code == '<' && BS.last code == '>' then return $ POP3C st (BS.unpack code) else return $ POP3C st ""
386
connectStream :: BSStream s => s -> IO (POP3Connection s) connectStream st = do (resp, msg) <- response st when (resp == Err) $ fail "cannot connect" let code = last $ BS.words msg if BS.head code == '<' && BS.last code == '>' then return $ POP3C st (BS.unpack code) else return $ POP3C st ""
335
connectStream st = do (resp, msg) <- response st when (resp == Err) $ fail "cannot connect" let code = last $ BS.words msg if BS.head code == '<' && BS.last code == '>' then return $ POP3C st (BS.unpack code) else return $ POP3C st ""
277
true
true
0
13
110
154
72
82
null
null
fpco/stackage-server
src/Stackage/Database/Query.hs
mit
-- | Get the snapshot from the database. lookupSnapshot :: GetStackageDatabase env m => SnapName -> m (Maybe (Entity Snapshot)) lookupSnapshot name = run $ getBy $ UniqueSnapshot name
183
lookupSnapshot :: GetStackageDatabase env m => SnapName -> m (Maybe (Entity Snapshot)) lookupSnapshot name = run $ getBy $ UniqueSnapshot name
142
lookupSnapshot name = run $ getBy $ UniqueSnapshot name
55
true
true
0
11
28
54
26
28
null
null
reuleaux/pire
src/Pire/Parser/Telescope.hs
bsd-3-clause
escope_ :: (TokenParsing m , LookAheadParsing m , DeltaParsing m , MonadState PiState m ) => m (Telescope T.Text T.Text) -- -- for starters... -- telescope_ = return EmptyTele telescope_ = do -- bindings <- telebindings' -- let bindings' = [b | (o, b, c) <- bindings] -- return $ foldr id Empty' bindings' where bindings <- telebindings_ -- let bindings' = [b | (o, b, c) <- bindings] return $ foldr id EmptyTele bindings where
501
telescope_ :: (TokenParsing m , LookAheadParsing m , DeltaParsing m , MonadState PiState m ) => m (Telescope T.Text T.Text) telescope_ = do -- bindings <- telebindings' -- let bindings' = [b | (o, b, c) <- bindings] -- return $ foldr id Empty' bindings' where bindings <- telebindings_ -- let bindings' = [b | (o, b, c) <- bindings] return $ foldr id EmptyTele bindings where
443
telescope_ = do -- bindings <- telebindings' -- let bindings' = [b | (o, b, c) <- bindings] -- return $ foldr id Empty' bindings' where bindings <- telebindings_ -- let bindings' = [b | (o, b, c) <- bindings] return $ foldr id EmptyTele bindings where
263
true
true
0
9
149
83
44
39
null
null
zoetic-community/zoetic-space-api
src/ZoeticSpace/Persistence.hs
agpl-3.0
port :: Port port = 7474
24
port :: Port port = 7474
24
port = 7474
11
false
true
0
6
5
18
7
11
null
null
ssaavedra/liquidhaskell
src/Language/Haskell/Liquid/GHC/Interface.hs
bsd-3-clause
parseSpec :: FilePath -> IO (ModName, Ms.BareSpec) parseSpec file = do whenLoud $ putStrLn $ "parseSpec: " ++ file either Ex.throw return . specParser file =<< readFile file
182
parseSpec :: FilePath -> IO (ModName, Ms.BareSpec) parseSpec file = do whenLoud $ putStrLn $ "parseSpec: " ++ file either Ex.throw return . specParser file =<< readFile file
182
parseSpec file = do whenLoud $ putStrLn $ "parseSpec: " ++ file either Ex.throw return . specParser file =<< readFile file
131
false
true
0
10
36
68
32
36
null
null
agrafix/legoDSL
NXT/Core.hs
bsd-3-clause
mkProg :: FilePath -> [FunDefinition] -> IO () mkProg filename prog = do writeFile filename $ concatMap prettyFD prog putStrLn "Finished generating NXC code ..." putStrLn $ "Written to " ++ filename
216
mkProg :: FilePath -> [FunDefinition] -> IO () mkProg filename prog = do writeFile filename $ concatMap prettyFD prog putStrLn "Finished generating NXC code ..." putStrLn $ "Written to " ++ filename
216
mkProg filename prog = do writeFile filename $ concatMap prettyFD prog putStrLn "Finished generating NXC code ..." putStrLn $ "Written to " ++ filename
169
false
true
0
9
49
69
30
39
null
null
sdiehl/ghc
compiler/main/DriverPipeline.hs
bsd-3-clause
getHCFilePackages :: FilePath -> IO [InstalledUnitId] getHCFilePackages filename = Exception.bracket (openFile filename ReadMode) hClose $ \h -> do l <- hGetLine h case l of '/':'*':' ':'G':'H':'C':'_':'P':'A':'C':'K':'A':'G':'E':'S':rest -> return (map stringToInstalledUnitId (words rest)) _other -> return [] ----------------------------------------------------------------------------- -- Static linking, of .o files -- The list of packages passed to link is the list of packages on -- which this program depends, as discovered by the compilation -- manager. It is combined with the list of packages that the user -- specifies on the command line with -package flags. -- -- In one-shot linking mode, we can't discover the package -- dependencies (because we haven't actually done any compilation or -- read any interface files), so the user must explicitly specify all -- the packages. {- Note [-Xlinker -rpath vs -Wl,-rpath] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Wl takes a comma-separated list of options which in the case of -Wl,-rpath -Wl,some,path,with,commas parses the path with commas as separate options. Buck, the build system, produces paths with commas in them. -Xlinker doesn't have this disadvantage and as far as I can tell it is supported by both gcc and clang. Anecdotally nvcc supports -Xlinker, but not -Wl. -}
1,381
getHCFilePackages :: FilePath -> IO [InstalledUnitId] getHCFilePackages filename = Exception.bracket (openFile filename ReadMode) hClose $ \h -> do l <- hGetLine h case l of '/':'*':' ':'G':'H':'C':'_':'P':'A':'C':'K':'A':'G':'E':'S':rest -> return (map stringToInstalledUnitId (words rest)) _other -> return [] ----------------------------------------------------------------------------- -- Static linking, of .o files -- The list of packages passed to link is the list of packages on -- which this program depends, as discovered by the compilation -- manager. It is combined with the list of packages that the user -- specifies on the command line with -package flags. -- -- In one-shot linking mode, we can't discover the package -- dependencies (because we haven't actually done any compilation or -- read any interface files), so the user must explicitly specify all -- the packages. {- Note [-Xlinker -rpath vs -Wl,-rpath] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Wl takes a comma-separated list of options which in the case of -Wl,-rpath -Wl,some,path,with,commas parses the path with commas as separate options. Buck, the build system, produces paths with commas in them. -Xlinker doesn't have this disadvantage and as far as I can tell it is supported by both gcc and clang. Anecdotally nvcc supports -Xlinker, but not -Wl. -}
1,381
getHCFilePackages filename = Exception.bracket (openFile filename ReadMode) hClose $ \h -> do l <- hGetLine h case l of '/':'*':' ':'G':'H':'C':'_':'P':'A':'C':'K':'A':'G':'E':'S':rest -> return (map stringToInstalledUnitId (words rest)) _other -> return [] ----------------------------------------------------------------------------- -- Static linking, of .o files -- The list of packages passed to link is the list of packages on -- which this program depends, as discovered by the compilation -- manager. It is combined with the list of packages that the user -- specifies on the command line with -package flags. -- -- In one-shot linking mode, we can't discover the package -- dependencies (because we haven't actually done any compilation or -- read any interface files), so the user must explicitly specify all -- the packages. {- Note [-Xlinker -rpath vs -Wl,-rpath] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Wl takes a comma-separated list of options which in the case of -Wl,-rpath -Wl,some,path,with,commas parses the path with commas as separate options. Buck, the build system, produces paths with commas in them. -Xlinker doesn't have this disadvantage and as far as I can tell it is supported by both gcc and clang. Anecdotally nvcc supports -Xlinker, but not -Wl. -}
1,327
false
true
0
26
240
171
89
82
null
null
weiningl/dataStructure
BinomialHeap.hs
bsd-3-clause
link :: Ord a => Tree a -> Tree a -> Tree a link t1@(Node r1 x1 ts1) t2@(Node r2 x2 ts2) = if x1 <= x2 then Node (r1 + 1) x1 (t2 : ts1) else Node (r2 + 1) x2 (t1 : ts1)
174
link :: Ord a => Tree a -> Tree a -> Tree a link t1@(Node r1 x1 ts1) t2@(Node r2 x2 ts2) = if x1 <= x2 then Node (r1 + 1) x1 (t2 : ts1) else Node (r2 + 1) x2 (t1 : ts1)
174
link t1@(Node r1 x1 ts1) t2@(Node r2 x2 ts2) = if x1 <= x2 then Node (r1 + 1) x1 (t2 : ts1) else Node (r2 + 1) x2 (t1 : ts1)
130
false
true
0
8
50
120
61
59
null
null
robdockins/edison
edison-core/src/Data/Edison/Coll/EnumSet.hs
mit
map :: (Enum a,Enum b) => (a -> b) -> Set a -> Set b map f0 (Set w) = Set $ foldlBits' f 0 w where f z i = setBit z $ check "map" $ fromEnum $ f0 (toEnum i)
166
map :: (Enum a,Enum b) => (a -> b) -> Set a -> Set b map f0 (Set w) = Set $ foldlBits' f 0 w where f z i = setBit z $ check "map" $ fromEnum $ f0 (toEnum i)
166
map f0 (Set w) = Set $ foldlBits' f 0 w where f z i = setBit z $ check "map" $ fromEnum $ f0 (toEnum i)
113
false
true
0
8
51
112
53
59
null
null
ltoth/mtg
Debug.hs
mit
plains :: Card plains = Card{_cardLayout = Normal, _cardTypeLine = "Basic Land \8212 Plains", _cardTypes = [Land], _cardColors = [], _cardMultiverseID = 373654, _cardName = "Plains", _cardNames = [], _cardSupertypes = [Basic], _cardSubtypes = [LandType (BasicLand Plains)], _cardCmc = Nothing, _cardRarity = BasicLandRarity, _cardArtist = "Rob Alexander", _cardPower = Nothing, _cardToughness = Nothing, _cardLoyalty = Nothing, _cardManaCost = Nothing, _cardRulesText = Just "W", _cardAbilities = [ActivatedAbility [CTap] [AddMana Nothing (ManaSymbols [[W]])] Nothing], _cardCardNumber = "230", _cardVariations = [373533, 373582, 373700], _cardImageName = "plains1", _cardWatermark = Nothing, _cardCardBorder = Nothing, _cardSetCode = "THS"}
856
plains :: Card plains = Card{_cardLayout = Normal, _cardTypeLine = "Basic Land \8212 Plains", _cardTypes = [Land], _cardColors = [], _cardMultiverseID = 373654, _cardName = "Plains", _cardNames = [], _cardSupertypes = [Basic], _cardSubtypes = [LandType (BasicLand Plains)], _cardCmc = Nothing, _cardRarity = BasicLandRarity, _cardArtist = "Rob Alexander", _cardPower = Nothing, _cardToughness = Nothing, _cardLoyalty = Nothing, _cardManaCost = Nothing, _cardRulesText = Just "W", _cardAbilities = [ActivatedAbility [CTap] [AddMana Nothing (ManaSymbols [[W]])] Nothing], _cardCardNumber = "230", _cardVariations = [373533, 373582, 373700], _cardImageName = "plains1", _cardWatermark = Nothing, _cardCardBorder = Nothing, _cardSetCode = "THS"}
856
plains = Card{_cardLayout = Normal, _cardTypeLine = "Basic Land \8212 Plains", _cardTypes = [Land], _cardColors = [], _cardMultiverseID = 373654, _cardName = "Plains", _cardNames = [], _cardSupertypes = [Basic], _cardSubtypes = [LandType (BasicLand Plains)], _cardCmc = Nothing, _cardRarity = BasicLandRarity, _cardArtist = "Rob Alexander", _cardPower = Nothing, _cardToughness = Nothing, _cardLoyalty = Nothing, _cardManaCost = Nothing, _cardRulesText = Just "W", _cardAbilities = [ActivatedAbility [CTap] [AddMana Nothing (ManaSymbols [[W]])] Nothing], _cardCardNumber = "230", _cardVariations = [373533, 373582, 373700], _cardImageName = "plains1", _cardWatermark = Nothing, _cardCardBorder = Nothing, _cardSetCode = "THS"}
841
false
true
0
14
206
224
140
84
null
null
nushio3/Paraiso
attic/QuasiQuote/JSON.hs
bsd-3-clause
lexeme :: Parsec String () a -> Parsec String () a lexeme p = skipMany space *> p
82
lexeme :: Parsec String () a -> Parsec String () a lexeme p = skipMany space *> p
81
lexeme p = skipMany space *> p
30
false
true
0
8
18
47
21
26
null
null
tingtun/jmacro
Language/Javascript/JMacro/Base.hs
bsd-3-clause
inIdentSupply :: (State [Ident] a -> State [Ident] b) -> IdentSupply a -> IdentSupply b inIdentSupply f x = IS $ f (runIdentSupply x)
133
inIdentSupply :: (State [Ident] a -> State [Ident] b) -> IdentSupply a -> IdentSupply b inIdentSupply f x = IS $ f (runIdentSupply x)
133
inIdentSupply f x = IS $ f (runIdentSupply x)
45
false
true
0
9
23
66
32
34
null
null
lsund/graph-visualization
src/jsongen/Main.hs
mit
genBondJSONString :: [(Int, Int)] -> String genBondJSONString [] = ""
69
genBondJSONString :: [(Int, Int)] -> String genBondJSONString [] = ""
69
genBondJSONString [] = ""
25
false
true
0
7
9
29
16
13
null
null
robashton/ghcmud
src/CommandParsing.hs
bsd-3-clause
isMoveCommand "go" = True
25
isMoveCommand "go" = True
25
isMoveCommand "go" = True
25
false
false
1
5
3
13
4
9
null
null
CRogers/stack
src/Stack/Config.hs
bsd-3-clause
resolvePackageLocation :: (MonadIO m, MonadThrow m, MonadReader env m, HasHttpManager env, MonadLogger m, MonadCatch m ,MonadBaseControl IO m) => EnvOverride -> Path Abs Dir -- ^ project root -> PackageLocation -> m (Path Abs Dir) resolvePackageLocation _ projRoot (PLFilePath fp) = resolveDir projRoot fp
332
resolvePackageLocation :: (MonadIO m, MonadThrow m, MonadReader env m, HasHttpManager env, MonadLogger m, MonadCatch m ,MonadBaseControl IO m) => EnvOverride -> Path Abs Dir -- ^ project root -> PackageLocation -> m (Path Abs Dir) resolvePackageLocation _ projRoot (PLFilePath fp) = resolveDir projRoot fp
332
resolvePackageLocation _ projRoot (PLFilePath fp) = resolveDir projRoot fp
74
false
true
0
12
70
111
54
57
null
null
keizo042/quic-prototype
Network/QUIC/Error.hs
bsd-3-clause
err2int PeerGoingAway = 0x10
53
err2int PeerGoingAway = 0x10
53
err2int PeerGoingAway = 0x10
53
false
false
0
5
28
9
4
5
null
null
Helkafen/cabal
cabal-install/Distribution/Client/Sandbox.hs
bsd-3-clause
configPackageDB' :: ConfigFlags -> PackageDBStack configPackageDB' cfg = interpretPackageDbFlags userInstall (configPackageDBs cfg) where userInstall = fromFlagOrDefault True (configUserInstall cfg)
208
configPackageDB' :: ConfigFlags -> PackageDBStack configPackageDB' cfg = interpretPackageDbFlags userInstall (configPackageDBs cfg) where userInstall = fromFlagOrDefault True (configUserInstall cfg)
208
configPackageDB' cfg = interpretPackageDbFlags userInstall (configPackageDBs cfg) where userInstall = fromFlagOrDefault True (configUserInstall cfg)
158
false
true
0
7
28
48
23
25
null
null
pparkkin/eta
compiler/ETA/TypeCheck/TcRnTypes.hs
bsd-3-clause
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
82
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
82
pprCtO (LiteralOrigin lit) = hsep [ptext (sLit "the literal"), quotes (ppr lit)]
82
false
false
0
9
13
42
20
22
null
null
kmate/HaRe
old/testing/moveDefBtwMods/D6_TokOut.hs
bsd-3-clause
umSquares [] = 0
17
sumSquares [] = 0
17
sumSquares [] = 0
17
false
false
0
6
4
11
5
6
null
null
ddssff/pandoc
src/Text/Pandoc/Writers/LaTeX.hs
gpl-2.0
toPolyglossia ("en":"GB":_) = ("english", "british")
54
toPolyglossia ("en":"GB":_) = ("english", "british")
54
toPolyglossia ("en":"GB":_) = ("english", "british")
54
false
false
0
8
6
26
14
12
null
null
kowey/GenI
src/NLP/GenI/Automaton.hs
gpl-2.0
-- | The set of all bundled paths. A bundled path is a sequence of -- states through the automaton from the start state to any dead -- end. Any two neighbouring states can have more than one -- possible transition between them, so the bundles can multiply -- out to a lot of different possible paths. -- -- The output is a list of lists of lists: -- -- * Each item in the outer list is a bundled path through the -- automaton, i.e. without distinguishing between the possible -- transitions from any two neighbouring states -- -- * Each item in the middle list is represents the set of -- transitions between two given neighbouring states -- -- * Each item in the inner list represents a transition -- between two given states automatonPathSets :: (Ord st, Ord ab) => (NFA st ab) -> [[ [ab] ]] automatonPathSets aut = helper (startSt aut) where transFor st = Map.toList `fmap` Map.lookup st (transitions aut) -- all the states you can get to from @st@ (and how to get there) -- (one item per state) helper st = maybe [] (concatMap next) $ transFor st next (st2, mtr) = case helper st2 of [] -> [[labels]] res -> map (labels :) res where labels = catMaybes mtr
1,213
automatonPathSets :: (Ord st, Ord ab) => (NFA st ab) -> [[ [ab] ]] automatonPathSets aut = helper (startSt aut) where transFor st = Map.toList `fmap` Map.lookup st (transitions aut) -- all the states you can get to from @st@ (and how to get there) -- (one item per state) helper st = maybe [] (concatMap next) $ transFor st next (st2, mtr) = case helper st2 of [] -> [[labels]] res -> map (labels :) res where labels = catMaybes mtr
460
automatonPathSets aut = helper (startSt aut) where transFor st = Map.toList `fmap` Map.lookup st (transitions aut) -- all the states you can get to from @st@ (and how to get there) -- (one item per state) helper st = maybe [] (concatMap next) $ transFor st next (st2, mtr) = case helper st2 of [] -> [[labels]] res -> map (labels :) res where labels = catMaybes mtr
393
true
true
3
11
271
219
113
106
null
null
thousandsofthem/FrameworkBenchmarks
frameworks/Haskell/spock/src/Main.hs
bsd-3-clause
-- | Test 1: JSON serialization test1 :: MonadIO m => ActionCtxT ctx m a test1 = do setHeader "Content-Type" "application/json" lazyBytes $ encode $ Object (fromList [("message", "Hello, World!")])
206
test1 :: MonadIO m => ActionCtxT ctx m a test1 = do setHeader "Content-Type" "application/json" lazyBytes $ encode $ Object (fromList [("message", "Hello, World!")])
174
test1 = do setHeader "Content-Type" "application/json" lazyBytes $ encode $ Object (fromList [("message", "Hello, World!")])
133
true
true
0
12
38
68
32
36
null
null
olsner/ghc
compiler/types/TyCoRep.hs
bsd-3-clause
tyCoFVsOfCo (KindCo co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in_scope acc
90
tyCoFVsOfCo (KindCo co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in_scope acc
90
tyCoFVsOfCo (KindCo co) fv_cand in_scope acc = tyCoFVsOfCo co fv_cand in_scope acc
90
false
false
0
7
19
30
14
16
null
null
TomMD/cryptol
sbv/Data/SBV/Compilers/CodeGen.hs
bsd-3-clause
cgReturn :: SymWord a => SBV a -> SBVCodeGen () cgReturn v = do _ <- liftSymbolic (output v) sw <- cgSBVToSW v modify (\s -> s { cgReturns = CgAtomic sw : cgReturns s }) -- | Creates a returned (unnamed) array value in the generated code.
271
cgReturn :: SymWord a => SBV a -> SBVCodeGen () cgReturn v = do _ <- liftSymbolic (output v) sw <- cgSBVToSW v modify (\s -> s { cgReturns = CgAtomic sw : cgReturns s }) -- | Creates a returned (unnamed) array value in the generated code.
271
cgReturn v = do _ <- liftSymbolic (output v) sw <- cgSBVToSW v modify (\s -> s { cgReturns = CgAtomic sw : cgReturns s }) -- | Creates a returned (unnamed) array value in the generated code.
223
false
true
0
14
80
97
44
53
null
null
stappit/okasaki-pfds
src/Chap03/Data/RedBlackTree.hs
gpl-3.0
paint :: Colour -> RedBlackTree a -> RedBlackTree a paint _ E = E
75
paint :: Colour -> RedBlackTree a -> RedBlackTree a paint _ E = E
75
paint _ E = E
23
false
true
0
7
23
30
14
16
null
null
fmapfmapfmap/amazonka
amazonka-codepipeline/gen/Network/AWS/CodePipeline/AcknowledgeThirdPartyJob.hs
mpl-2.0
-- | The clientToken portion of the clientId and clientToken pair used to -- verify that the calling entity is allowed access to the job and its -- details. atpjClientToken :: Lens' AcknowledgeThirdPartyJob Text atpjClientToken = lens _atpjClientToken (\ s a -> s{_atpjClientToken = a})
286
atpjClientToken :: Lens' AcknowledgeThirdPartyJob Text atpjClientToken = lens _atpjClientToken (\ s a -> s{_atpjClientToken = a})
129
atpjClientToken = lens _atpjClientToken (\ s a -> s{_atpjClientToken = a})
74
true
true
0
9
44
42
24
18
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
dreadingly = id
15
dreadingly = id
15
dreadingly = id
15
false
false
0
4
2
6
3
3
null
null
herngyi/hmol
Proteins.hs
gpl-3.0
cysteine = aminoAcid L Cysteine
36
cysteine = aminoAcid L Cysteine
36
cysteine = aminoAcid L Cysteine
36
false
false
0
5
9
11
5
6
null
null
spinningfire/aikatsu
src/Smile.hs
bsd-3-clause
groupSmileInUnit::[Character] -> Unit -> Bool groupSmileInUnit charalist unit = all (\x -> elem x (character <$> unit)) $ charalist
131
groupSmileInUnit::[Character] -> Unit -> Bool groupSmileInUnit charalist unit = all (\x -> elem x (character <$> unit)) $ charalist
131
groupSmileInUnit charalist unit = all (\x -> elem x (character <$> unit)) $ charalist
85
false
true
0
11
18
60
29
31
null
null
thalerjonathan/phd
coding/libraries/chimera/examples/ABS/Wildfire/Model.hs
gpl-3.0
randomFuelInitRange :: (Double, Double) randomFuelInitRange = (0.7, 1.0)
72
randomFuelInitRange :: (Double, Double) randomFuelInitRange = (0.7, 1.0)
72
randomFuelInitRange = (0.7, 1.0)
32
false
true
0
5
7
23
14
9
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F24.hs
bsd-3-clause
ptr_glSecondaryColorP3uiv :: FunPtr (GLenum -> Ptr GLuint -> IO ()) ptr_glSecondaryColorP3uiv = unsafePerformIO $ getCommand "glSecondaryColorP3uiv"
148
ptr_glSecondaryColorP3uiv :: FunPtr (GLenum -> Ptr GLuint -> IO ()) ptr_glSecondaryColorP3uiv = unsafePerformIO $ getCommand "glSecondaryColorP3uiv"
148
ptr_glSecondaryColorP3uiv = unsafePerformIO $ getCommand "glSecondaryColorP3uiv"
80
false
true
0
10
15
40
19
21
null
null
headprogrammingczar/cabal
cabal-install/Distribution/Client/Dependency/TopDown.hs
bsd-3-clause
internalError :: String -> a internalError msg = error $ "internal error: " ++ msg
82
internalError :: String -> a internalError msg = error $ "internal error: " ++ msg
82
internalError msg = error $ "internal error: " ++ msg
53
false
true
0
7
14
32
14
18
null
null
castaway/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
blockTags :: [String] blockTags = blockHtmlTags ++ blockDocBookTags
67
blockTags :: [String] blockTags = blockHtmlTags ++ blockDocBookTags
67
blockTags = blockHtmlTags ++ blockDocBookTags
45
false
true
0
5
7
18
10
8
null
null
Jubobs/CommonMark-WIP
src/CommonMark/Util/Parsing.hs
bsd-3-clause
takeWhileHi :: (Char -> Bool) -> Int -> Parser Text takeWhileHi f hi = scan 0 $ \n c -> if n < hi && f c then Just $! n + 1 else Nothing
182
takeWhileHi :: (Char -> Bool) -> Int -> Parser Text takeWhileHi f hi = scan 0 $ \n c -> if n < hi && f c then Just $! n + 1 else Nothing
182
takeWhileHi f hi = scan 0 $ \n c -> if n < hi && f c then Just $! n + 1 else Nothing
130
false
true
0
9
80
75
38
37
null
null
igraves/peparser-haskell
Data/PE/Tools.hs
bsd-3-clause
getdllname :: UArray Word32 Word8 -> ImportDirectoryEntry -> [Char] getdllname ary ientry = case (ientry) of (IDNull) -> "" _ -> runGet getAStr (grabAt (fromIntegral rva) ary) where rva = nameRVA ientry --Building an array to represent the file structure
336
getdllname :: UArray Word32 Word8 -> ImportDirectoryEntry -> [Char] getdllname ary ientry = case (ientry) of (IDNull) -> "" _ -> runGet getAStr (grabAt (fromIntegral rva) ary) where rva = nameRVA ientry --Building an array to represent the file structure
336
getdllname ary ientry = case (ientry) of (IDNull) -> "" _ -> runGet getAStr (grabAt (fromIntegral rva) ary) where rva = nameRVA ientry --Building an array to represent the file structure
268
false
true
1
12
121
93
44
49
null
null
4ZP6Capstone2015/ampersand
src/Database/Design/Ampersand/Prototype/ProtoUtil.hs
gpl-3.0
-- quote s = "`"++quo s++"`" -- where quo ('`':s') = "\\`" ++ quo s' -- quo ('\\':s') = "\\\\" ++ quo s' -- quo (c:s') = c: quo s' -- quo [] = [] -- See http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks commentBlock :: [String]->[String] commentBlock ls = ["/*"++replicate lnth '*'++"*\\"] ++ ["* "++strReplace "*/" "**" line++replicate (lnth - length line) ' '++" *" | line <- ls] ++ ["\\*"++replicate lnth '*'++"*/"] where lnth = foldl max 0 (map length ls)
600
commentBlock :: [String]->[String] commentBlock ls = ["/*"++replicate lnth '*'++"*\\"] ++ ["* "++strReplace "*/" "**" line++replicate (lnth - length line) ' '++" *" | line <- ls] ++ ["\\*"++replicate lnth '*'++"*/"] where lnth = foldl max 0 (map length ls)
306
commentBlock ls = ["/*"++replicate lnth '*'++"*\\"] ++ ["* "++strReplace "*/" "**" line++replicate (lnth - length line) ' '++" *" | line <- ls] ++ ["\\*"++replicate lnth '*'++"*/"] where lnth = foldl max 0 (map length ls)
271
true
true
0
13
169
138
72
66
null
null
laszlopandy/elm-compiler
src/Parse/Binop.hs
bsd-3-clause
getAssoc :: OpTable -> Int -> [(String,Source.Expr)] -> IParser Assoc getAssoc table n eops | all (==L) assocs = return L | all (==R) assocs = return R | all (==N) assocs = case assocs of [_] -> return N _ -> failure (msg "precedence") | otherwise = failure (msg "associativity") where levelOps = filter (hasLevel table n) eops assocs = map (opAssoc table . fst) levelOps msg problem = concat [ "Conflicting " ++ problem ++ " for binary operators (" , List.intercalate ", " (map fst eops), "). " , "Consider adding parentheses to disambiguate." ]
654
getAssoc :: OpTable -> Int -> [(String,Source.Expr)] -> IParser Assoc getAssoc table n eops | all (==L) assocs = return L | all (==R) assocs = return R | all (==N) assocs = case assocs of [_] -> return N _ -> failure (msg "precedence") | otherwise = failure (msg "associativity") where levelOps = filter (hasLevel table n) eops assocs = map (opAssoc table . fst) levelOps msg problem = concat [ "Conflicting " ++ problem ++ " for binary operators (" , List.intercalate ", " (map fst eops), "). " , "Consider adding parentheses to disambiguate." ]
654
getAssoc table n eops | all (==L) assocs = return L | all (==R) assocs = return R | all (==N) assocs = case assocs of [_] -> return N _ -> failure (msg "precedence") | otherwise = failure (msg "associativity") where levelOps = filter (hasLevel table n) eops assocs = map (opAssoc table . fst) levelOps msg problem = concat [ "Conflicting " ++ problem ++ " for binary operators (" , List.intercalate ", " (map fst eops), "). " , "Consider adding parentheses to disambiguate." ]
584
false
true
1
11
205
244
120
124
null
null
bigsleep/Wf
src/Wf/Application/Logger.hs
mit
log :: (Member Logger r) => Wf.Control.Eff.Logger.LogLevel -> String -> Eff r () log = Wf.Control.Eff.Logger.log DefaultLogger
126
log :: (Member Logger r) => Wf.Control.Eff.Logger.LogLevel -> String -> Eff r () log = Wf.Control.Eff.Logger.log DefaultLogger
126
log = Wf.Control.Eff.Logger.log DefaultLogger
45
false
true
0
9
16
50
28
22
null
null
glutamate/vishnu
Vishnu/Cmds/Update.hs
bsd-3-clause
mergePkgs (Array arr) = concat $ map mergePkgs $ V.toList arr
61
mergePkgs (Array arr) = concat $ map mergePkgs $ V.toList arr
61
mergePkgs (Array arr) = concat $ map mergePkgs $ V.toList arr
61
false
false
0
7
10
31
14
17
null
null
m-alvarez/jhc
src/Fixer/VMap.hs
mit
emptyVMap :: (Ord p, Ord n) => VMap p n emptyVMap = VMap { vmapArgs = mempty, vmapNodes = Right mempty }
104
emptyVMap :: (Ord p, Ord n) => VMap p n emptyVMap = VMap { vmapArgs = mempty, vmapNodes = Right mempty }
104
emptyVMap = VMap { vmapArgs = mempty, vmapNodes = Right mempty }
64
false
true
0
8
21
57
28
29
null
null
edsko/hackage-server
Distribution/Server/Users/UserIdSet.hs
bsd-3-clause
member :: UserId -> UserIdSet -> Bool member (UserId uid) (UserIdSet uidset) = IntSet.member uid uidset
103
member :: UserId -> UserIdSet -> Bool member (UserId uid) (UserIdSet uidset) = IntSet.member uid uidset
103
member (UserId uid) (UserIdSet uidset) = IntSet.member uid uidset
65
false
true
0
10
15
48
22
26
null
null
LinuxUser404/haskell-dominion
src/DominionParser.hs
gpl-2.0
parsePlay :: GenParser Char st DominionTypes.Play parsePlay = braces $ readPlay <$> myWords
91
parsePlay :: GenParser Char st DominionTypes.Play parsePlay = braces $ readPlay <$> myWords
91
parsePlay = braces $ readPlay <$> myWords
41
false
true
0
6
12
28
14
14
null
null
Rydgel/advent-of-code
src/Day2.hs
bsd-3-clause
surface :: Sides -> Int surface (l,w,h) = 2*l*w + 2*w*h + 2*h*l
63
surface :: Sides -> Int surface (l,w,h) = 2*l*w + 2*w*h + 2*h*l
63
surface (l,w,h) = 2*l*w + 2*w*h + 2*h*l
39
false
true
0
12
12
59
31
28
null
null
WSCU/JSEuterpea
Euterpea Examples/Rhythm.hs
gpl-3.0
--added sAbacker = sAbackerA * sAbackerB
41
sAbacker = sAbackerA * sAbackerB
32
sAbacker = sAbackerA * sAbackerB
32
true
false
2
5
6
16
6
10
null
null
spechub/Hets
Maude/PreComorphism.hs
gpl-2.0
ifSens :: Id -> [Named CAS.CASLFORMULA] ifSens kind = [form'', neg_form''] where v1 = newVarIndex 1 kind v2 = newVarIndex 2 kind bk = str2id "Bool" bv = newVarIndex 2 bk true_type = CAS.Op_type CAS.Total [] bk nullRange true_id = CAS.Qual_op_name (str2id "true") true_type nullRange true_term = CAS.Application true_id [] nullRange if_type = CAS.Op_type CAS.Total [bk, kind, kind] kind nullRange if_name = str2id "if_then_else_fi" if_id = CAS.Qual_op_name if_name if_type nullRange if_term = CAS.Application if_id [bv, v1, v2] nullRange prem = CAS.mkStEq bv true_term concl = CAS.mkStEq if_term v1 form = CAS.mkImpl prem concl form' = quantifyUniversally form neg_prem = CAS.Negation prem nullRange neg_concl = CAS.mkStEq if_term v2 neg_form = CAS.mkImpl neg_prem neg_concl neg_form' = quantifyUniversally neg_form name1 = show kind ++ "_if_true" name2 = show kind ++ "_if_false" form'' = makeNamed name1 form' neg_form'' = makeNamed name2 neg_form' -- | generates the formulas for the equality
1,334
ifSens :: Id -> [Named CAS.CASLFORMULA] ifSens kind = [form'', neg_form''] where v1 = newVarIndex 1 kind v2 = newVarIndex 2 kind bk = str2id "Bool" bv = newVarIndex 2 bk true_type = CAS.Op_type CAS.Total [] bk nullRange true_id = CAS.Qual_op_name (str2id "true") true_type nullRange true_term = CAS.Application true_id [] nullRange if_type = CAS.Op_type CAS.Total [bk, kind, kind] kind nullRange if_name = str2id "if_then_else_fi" if_id = CAS.Qual_op_name if_name if_type nullRange if_term = CAS.Application if_id [bv, v1, v2] nullRange prem = CAS.mkStEq bv true_term concl = CAS.mkStEq if_term v1 form = CAS.mkImpl prem concl form' = quantifyUniversally form neg_prem = CAS.Negation prem nullRange neg_concl = CAS.mkStEq if_term v2 neg_form = CAS.mkImpl neg_prem neg_concl neg_form' = quantifyUniversally neg_form name1 = show kind ++ "_if_true" name2 = show kind ++ "_if_false" form'' = makeNamed name1 form' neg_form'' = makeNamed name2 neg_form' -- | generates the formulas for the equality
1,334
ifSens kind = [form'', neg_form''] where v1 = newVarIndex 1 kind v2 = newVarIndex 2 kind bk = str2id "Bool" bv = newVarIndex 2 bk true_type = CAS.Op_type CAS.Total [] bk nullRange true_id = CAS.Qual_op_name (str2id "true") true_type nullRange true_term = CAS.Application true_id [] nullRange if_type = CAS.Op_type CAS.Total [bk, kind, kind] kind nullRange if_name = str2id "if_then_else_fi" if_id = CAS.Qual_op_name if_name if_type nullRange if_term = CAS.Application if_id [bv, v1, v2] nullRange prem = CAS.mkStEq bv true_term concl = CAS.mkStEq if_term v1 form = CAS.mkImpl prem concl form' = quantifyUniversally form neg_prem = CAS.Negation prem nullRange neg_concl = CAS.mkStEq if_term v2 neg_form = CAS.mkImpl neg_prem neg_concl neg_form' = quantifyUniversally neg_form name1 = show kind ++ "_if_true" name2 = show kind ++ "_if_false" form'' = makeNamed name1 form' neg_form'' = makeNamed name2 neg_form' -- | generates the formulas for the equality
1,294
false
true
0
9
485
333
171
162
null
null
vTurbine/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
ltDataConId, eqDataConId, gtDataConId :: Id ltDataConId = dataConWorkId ltDataCon
81
ltDataConId, eqDataConId, gtDataConId :: Id ltDataConId = dataConWorkId ltDataCon
81
ltDataConId = dataConWorkId ltDataCon
37
false
true
4
6
8
33
12
21
null
null
sinelaw/lamdu
Lamdu/Main.hs
gpl-3.0
makeRootWidget :: Config -> Settings -> TextEdit.Style -> (forall a. Transaction DbLayout.DbM a -> IO a) -> Widget.Size -> Widget.Id -> StateT Cache (Transaction DbLayout.DbM) (Widget IO) makeRootWidget config settings style dbToIO size cursor = do actions <- lift VersionControl.makeActions mapStateT (runWidgetEnvT cursor style config) $ do codeEdit <- (fmap . Widget.atEvents) (VersionControl.runEvent cursor) . (mapStateT . WE.mapWidgetEnvT) VersionControl.runAction $ CodeEdit.make env rootGuid branchGui <- lift $ VersionControlGUI.make id size actions codeEdit let quitEventMap = Widget.keysEventMap (Config.quitKeys config) (EventMap.Doc ["Quit"]) (error "Quit") return . Widget.atEvents (dbToIO . (attachCursor =<<)) $ Widget.strongerEvents quitEventMap branchGui where env = CodeEdit.Env { CodeEdit.codeProps = DbLayout.codeProps , CodeEdit.totalSize = size , CodeEdit.settings = settings } attachCursor eventResult = do maybe (return ()) (Transaction.setP (DbLayout.cursor DbLayout.revisionProps)) . Monoid.getLast $ eventResult ^. Widget.eCursor return eventResult
1,202
makeRootWidget :: Config -> Settings -> TextEdit.Style -> (forall a. Transaction DbLayout.DbM a -> IO a) -> Widget.Size -> Widget.Id -> StateT Cache (Transaction DbLayout.DbM) (Widget IO) makeRootWidget config settings style dbToIO size cursor = do actions <- lift VersionControl.makeActions mapStateT (runWidgetEnvT cursor style config) $ do codeEdit <- (fmap . Widget.atEvents) (VersionControl.runEvent cursor) . (mapStateT . WE.mapWidgetEnvT) VersionControl.runAction $ CodeEdit.make env rootGuid branchGui <- lift $ VersionControlGUI.make id size actions codeEdit let quitEventMap = Widget.keysEventMap (Config.quitKeys config) (EventMap.Doc ["Quit"]) (error "Quit") return . Widget.atEvents (dbToIO . (attachCursor =<<)) $ Widget.strongerEvents quitEventMap branchGui where env = CodeEdit.Env { CodeEdit.codeProps = DbLayout.codeProps , CodeEdit.totalSize = size , CodeEdit.settings = settings } attachCursor eventResult = do maybe (return ()) (Transaction.setP (DbLayout.cursor DbLayout.revisionProps)) . Monoid.getLast $ eventResult ^. Widget.eCursor return eventResult
1,202
makeRootWidget config settings style dbToIO size cursor = do actions <- lift VersionControl.makeActions mapStateT (runWidgetEnvT cursor style config) $ do codeEdit <- (fmap . Widget.atEvents) (VersionControl.runEvent cursor) . (mapStateT . WE.mapWidgetEnvT) VersionControl.runAction $ CodeEdit.make env rootGuid branchGui <- lift $ VersionControlGUI.make id size actions codeEdit let quitEventMap = Widget.keysEventMap (Config.quitKeys config) (EventMap.Doc ["Quit"]) (error "Quit") return . Widget.atEvents (dbToIO . (attachCursor =<<)) $ Widget.strongerEvents quitEventMap branchGui where env = CodeEdit.Env { CodeEdit.codeProps = DbLayout.codeProps , CodeEdit.totalSize = size , CodeEdit.settings = settings } attachCursor eventResult = do maybe (return ()) (Transaction.setP (DbLayout.cursor DbLayout.revisionProps)) . Monoid.getLast $ eventResult ^. Widget.eCursor return eventResult
1,006
false
true
1
16
253
397
191
206
null
null
quickdudley/hfnn
src/AI/HFNN/Activation.hs
bsd-3-clause
sine :: ActivationFunction sine = nogl { activationFunction = map $ \x -> (sin x, cos x) }
93
sine :: ActivationFunction sine = nogl { activationFunction = map $ \x -> (sin x, cos x) }
93
sine = nogl { activationFunction = map $ \x -> (sin x, cos x) }
66
false
true
0
10
20
40
22
18
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
successfully = id
17
successfully = id
17
successfully = id
17
false
false
0
4
2
6
3
3
null
null
mbudde/jana
src/Jana/Eval.hs
bsd-3-clause
numberToModular :: Value -> Eval Value numberToModular (JInt x) = do flag <- asks (modInt . evalOptions) return $ JInt $ if flag then ((x + 2^31) `mod` 2^32) - 2^31 else x
178
numberToModular :: Value -> Eval Value numberToModular (JInt x) = do flag <- asks (modInt . evalOptions) return $ JInt $ if flag then ((x + 2^31) `mod` 2^32) - 2^31 else x
178
numberToModular (JInt x) = do flag <- asks (modInt . evalOptions) return $ JInt $ if flag then ((x + 2^31) `mod` 2^32) - 2^31 else x
139
false
true
0
16
39
95
49
46
null
null
olsner/ghc
testsuite/tests/perf/compiler/T10370.hs
bsd-3-clause
a915 :: IO (); a915 = forever $ putStrLn "a915"
47
a915 :: IO () a915 = forever $ putStrLn "a915"
46
a915 = forever $ putStrLn "a915"
32
false
true
0
6
9
24
12
12
null
null
reinh/CodeSearch
src/CodeSearch/Util.hs
bsd-3-clause
cartesian :: (Ord m, Monoid m) => Set m -> Set m -> Set m cartesian xs ys = fromList [x `mappend` y | x <- toList xs, y <- toList ys]
133
cartesian :: (Ord m, Monoid m) => Set m -> Set m -> Set m cartesian xs ys = fromList [x `mappend` y | x <- toList xs, y <- toList ys]
133
cartesian xs ys = fromList [x `mappend` y | x <- toList xs, y <- toList ys]
75
false
true
0
9
31
86
41
45
null
null
avieth/diplomacy
Diplomacy/Province.hs
bsd-3-clause
provinceType Munich = Inland
28
provinceType Munich = Inland
28
provinceType Munich = Inland
28
false
false
0
5
3
9
4
5
null
null
DanielOberg/case-in-point
dist/build/autogen/Paths_case_in_point.hs
bsd-3-clause
getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath getBinDir = catch (getEnv "case_in_point_bindir") (\_ -> return bindir)
134
getBinDir, getLibDir, getDataDir, getLibexecDir :: IO FilePath getBinDir = catch (getEnv "case_in_point_bindir") (\_ -> return bindir)
134
getBinDir = catch (getEnv "case_in_point_bindir") (\_ -> return bindir)
71
false
true
0
8
15
42
24
18
null
null
snoyberg/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
-- Random PrelBase functions fromStringName, otherwiseIdName, foldrName, buildName, augmentName, mapName, appendName, assertName, breakpointName, breakpointCondName, breakpointAutoName, opaqueTyConName :: Name fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
300
fromStringName, otherwiseIdName, foldrName, buildName, augmentName, mapName, appendName, assertName, breakpointName, breakpointCondName, breakpointAutoName, opaqueTyConName :: Name fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
271
fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
78
true
true
0
7
36
47
35
12
null
null
sdiehl/ghc
testsuite/tests/driver/T15970/A2.hs
bsd-3-clause
toTypedDataNoDef :: String -> IO Int toTypedDataNoDef s = return $ length s
76
toTypedDataNoDef :: String -> IO Int toTypedDataNoDef s = return $ length s
76
toTypedDataNoDef s = return $ length s
38
false
true
0
6
13
28
13
15
null
null
scolobb/fgl
Data/Graph/Inductive/Query/DFS.hs
bsd-3-clause
udffWith' :: (Graph gr) => CFun a b c -> gr a b -> [Tree c] udffWith' f = fixNodes (udffWith f)
95
udffWith' :: (Graph gr) => CFun a b c -> gr a b -> [Tree c] udffWith' f = fixNodes (udffWith f)
95
udffWith' f = fixNodes (udffWith f)
35
false
true
0
11
21
63
29
34
null
null
k0001/gtk2hs
tools/c2hs/toplevel/C2HSConfig.hs
gpl-3.0
cppoptsdef :: String cppoptsdef = "-imacros"
44
cppoptsdef :: String cppoptsdef = "-imacros"
44
cppoptsdef = "-imacros"
23
false
true
0
4
5
11
6
5
null
null
sherwoodwang/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
fL_ALIGN_TOP_PANE :: Int fL_ALIGN_TOP_PANE = 1
46
fL_ALIGN_TOP_PANE :: Int fL_ALIGN_TOP_PANE = 1
46
fL_ALIGN_TOP_PANE = 1
21
false
true
0
6
5
18
7
11
null
null
PipocaQuemada/ermine
src/Ermine/Syntax/Pattern.hs
bsd-2-clause
_LitP' :: Literal -> Prism' (Pattern t) [Pattern t] _LitP' l = prism (\[] -> LitP l) $ \xs -> case xs of LitP l' | l == l' -> Right [] p -> Left p -- | Paths into a pattern tree. These will be used as the bound variables -- for scopes that have patterns in their binder. No effort has been made -- to enforce statically that pattern paths used in a given scope -- correspond only to well-formed paths into the particular tree; it will -- merely have to be an invariant maintained in the compiler. -- -- LeafPP represents a reference to the variable at a node that binds -- a variable. For instance, LeafPP is a valid path into SigP. It is also -- valid for AsP p for all p, because AsP binds a variable. It is invalid -- for ConP, however. -- -- No effort is made to represent paths with no decision points. This is -- primarily because it is detrimental to the compilation strategy. AsP, -- StrictP and LazyP can be thought of as annotations that are not -- full-fledged patterns in themselves. AsP signals that it is valid to -- make reference to an entire piece of substructure, while StrictP and -- LazyP inform the pattern compilation process. But it is unnecessary to -- distinguish between pointing at an AsP---which is always valid---and -- pointing at the right portion of an AsP---which is invalid unless the -- pattern contains redundancies.
1,357
_LitP' :: Literal -> Prism' (Pattern t) [Pattern t] _LitP' l = prism (\[] -> LitP l) $ \xs -> case xs of LitP l' | l == l' -> Right [] p -> Left p -- | Paths into a pattern tree. These will be used as the bound variables -- for scopes that have patterns in their binder. No effort has been made -- to enforce statically that pattern paths used in a given scope -- correspond only to well-formed paths into the particular tree; it will -- merely have to be an invariant maintained in the compiler. -- -- LeafPP represents a reference to the variable at a node that binds -- a variable. For instance, LeafPP is a valid path into SigP. It is also -- valid for AsP p for all p, because AsP binds a variable. It is invalid -- for ConP, however. -- -- No effort is made to represent paths with no decision points. This is -- primarily because it is detrimental to the compilation strategy. AsP, -- StrictP and LazyP can be thought of as annotations that are not -- full-fledged patterns in themselves. AsP signals that it is valid to -- make reference to an entire piece of substructure, while StrictP and -- LazyP inform the pattern compilation process. But it is unnecessary to -- distinguish between pointing at an AsP---which is always valid---and -- pointing at the right portion of an AsP---which is invalid unless the -- pattern contains redundancies.
1,357
_LitP' l = prism (\[] -> LitP l) $ \xs -> case xs of LitP l' | l == l' -> Right [] p -> Left p -- | Paths into a pattern tree. These will be used as the bound variables -- for scopes that have patterns in their binder. No effort has been made -- to enforce statically that pattern paths used in a given scope -- correspond only to well-formed paths into the particular tree; it will -- merely have to be an invariant maintained in the compiler. -- -- LeafPP represents a reference to the variable at a node that binds -- a variable. For instance, LeafPP is a valid path into SigP. It is also -- valid for AsP p for all p, because AsP binds a variable. It is invalid -- for ConP, however. -- -- No effort is made to represent paths with no decision points. This is -- primarily because it is detrimental to the compilation strategy. AsP, -- StrictP and LazyP can be thought of as annotations that are not -- full-fledged patterns in themselves. AsP signals that it is valid to -- make reference to an entire piece of substructure, while StrictP and -- LazyP inform the pattern compilation process. But it is unnecessary to -- distinguish between pointing at an AsP---which is always valid---and -- pointing at the right portion of an AsP---which is invalid unless the -- pattern contains redundancies.
1,305
false
true
2
9
255
117
66
51
null
null
olsner/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
pprInstr (PREFETCH NTA format src ) = pprFormatOp_ (sLit "prefetchnta") format src
82
pprInstr (PREFETCH NTA format src ) = pprFormatOp_ (sLit "prefetchnta") format src
82
pprInstr (PREFETCH NTA format src ) = pprFormatOp_ (sLit "prefetchnta") format src
82
false
false
0
7
11
32
15
17
null
null
sdiehl/ghc
hadrian/src/Context.hs
bsd-3-clause
-- | Get the 'Way' of the current 'Context'. getWay :: Expr Context b Way getWay = way <$> getContext
101
getWay :: Expr Context b Way getWay = way <$> getContext
56
getWay = way <$> getContext
27
true
true
3
5
19
29
12
17
null
null
christiaanb/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
pprCLabel platform (DynamicLinkerLabel info lbl) | cGhcWithNativeCodeGen == "YES" = pprDynamicLinkerAsmLabel platform info lbl
130
pprCLabel platform (DynamicLinkerLabel info lbl) | cGhcWithNativeCodeGen == "YES" = pprDynamicLinkerAsmLabel platform info lbl
130
pprCLabel platform (DynamicLinkerLabel info lbl) | cGhcWithNativeCodeGen == "YES" = pprDynamicLinkerAsmLabel platform info lbl
130
false
false
0
8
17
38
16
22
null
null
christiaanb/Idris-dev
src/Core/ProofState.hs
bsd-3-clause
updateSolved' xs t = t
22
updateSolved' xs t = t
22
updateSolved' xs t = t
22
false
false
1
5
4
16
5
11
null
null
ChShersh/rogue-lang
src/Rogue/LLVM/Codegen.hs
bsd-3-clause
------------------------------------------------------------------------------- -- Arithmetic and Constants ------------------------------------------------------------------------------- -- Logic operations land :: Operand -> Operand -> Codegen Operand land a b = namedInstruction Nothing $ And a b []
303
land :: Operand -> Operand -> Codegen Operand land a b = namedInstruction Nothing $ And a b []
94
land a b = namedInstruction Nothing $ And a b []
48
true
true
0
8
28
51
25
26
null
null
anammari/pandoc
src/Text/Pandoc/Readers/RST.hs
gpl-2.0
str :: GenParser Char ParserState Inline str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
104
str :: GenParser Char ParserState Inline str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
104
str = many1 (noneOf (specialChars ++ "\t\n ")) >>= return . Str
63
false
true
0
11
17
42
21
21
null
null
infotroph/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
hline :: LP () hline = try $ do spaces' controlSeq "hline" <|> -- booktabs rules: controlSeq "toprule" <|> controlSeq "bottomrule" <|> controlSeq "midrule" spaces' optional $ bracketed (many1 (satisfy (/=']'))) return ()
246
hline :: LP () hline = try $ do spaces' controlSeq "hline" <|> -- booktabs rules: controlSeq "toprule" <|> controlSeq "bottomrule" <|> controlSeq "midrule" spaces' optional $ bracketed (many1 (satisfy (/=']'))) return ()
246
hline = try $ do spaces' controlSeq "hline" <|> -- booktabs rules: controlSeq "toprule" <|> controlSeq "bottomrule" <|> controlSeq "midrule" spaces' optional $ bracketed (many1 (satisfy (/=']'))) return ()
231
false
true
2
14
58
95
41
54
null
null
YoshikuniJujo/funpaala
samples/43_alternative/superYoshio.hs
bsd-3-clause
mgame :: Yoshio -> [Event] -> Maybe Yoshio mgame = foldM mevent
63
mgame :: Yoshio -> [Event] -> Maybe Yoshio mgame = foldM mevent
63
mgame = foldM mevent
20
false
true
0
7
11
28
14
14
null
null