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
brendanhay/gogol
gogol-resourcemanager/gen/Network/Google/Resource/CloudResourceManager/Organizations/TestIAMPermissions.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). otipUploadType :: Lens' OrganizationsTestIAMPermissions (Maybe Text) otipUploadType = lens _otipUploadType (\ s a -> s{_otipUploadType = a})
219
otipUploadType :: Lens' OrganizationsTestIAMPermissions (Maybe Text) otipUploadType = lens _otipUploadType (\ s a -> s{_otipUploadType = a})
148
otipUploadType = lens _otipUploadType (\ s a -> s{_otipUploadType = a})
79
true
true
0
9
34
48
25
23
null
null
mimi1vx/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkFindExec3 = verify checkFindExec "find / -execdir cat {} | grep lol +"
80
prop_checkFindExec3 = verify checkFindExec "find / -execdir cat {} | grep lol +"
80
prop_checkFindExec3 = verify checkFindExec "find / -execdir cat {} | grep lol +"
80
false
false
1
5
12
15
5
10
null
null
pranjaltale16/codeworld
codeworld-compiler/src/CodeWorld/Compile/Requirements/Language.hs
apache-2.0
prettyPrintYamlParseException ln col e = formatLocation srcSpan ++ Yaml.prettyPrintParseException e where srcSpan = SrcSpanInfo loc [] loc = SrcSpan "program.hs" ln col ln col
193
prettyPrintYamlParseException ln col e = formatLocation srcSpan ++ Yaml.prettyPrintParseException e where srcSpan = SrcSpanInfo loc [] loc = SrcSpan "program.hs" ln col ln col
193
prettyPrintYamlParseException ln col e = formatLocation srcSpan ++ Yaml.prettyPrintParseException e where srcSpan = SrcSpanInfo loc [] loc = SrcSpan "program.hs" ln col ln col
193
false
false
0
7
41
56
26
30
null
null
rueshyna/gogol
gogol-prediction/gen/Network/Google/Prediction/Types/Product.hs
mpl-2.0
-- | What kind of resource this is. lKind :: Lens' List Text lKind = lens _lKind (\ s a -> s{_lKind = a})
105
lKind :: Lens' List Text lKind = lens _lKind (\ s a -> s{_lKind = a})
69
lKind = lens _lKind (\ s a -> s{_lKind = a})
44
true
true
0
9
23
40
22
18
null
null
oldmanmike/ghc
compiler/main/Packages.hs
bsd-3-clause
sortByVersion :: [PackageConfig] -> [PackageConfig] sortByVersion = sortBy (flip (comparing packageVersion))
108
sortByVersion :: [PackageConfig] -> [PackageConfig] sortByVersion = sortBy (flip (comparing packageVersion))
108
sortByVersion = sortBy (flip (comparing packageVersion))
56
false
true
0
9
10
36
19
17
null
null
olorin/amazonka
amazonka-cloudfront/gen/Network/AWS/CloudFront/CreateInvalidation.hs
mpl-2.0
-- | The fully qualified URI of the distribution and invalidation batch -- request, including the Invalidation ID. cirsLocation :: Lens' CreateInvalidationResponse (Maybe Text) cirsLocation = lens _cirsLocation (\ s a -> s{_cirsLocation = a})
242
cirsLocation :: Lens' CreateInvalidationResponse (Maybe Text) cirsLocation = lens _cirsLocation (\ s a -> s{_cirsLocation = a})
127
cirsLocation = lens _cirsLocation (\ s a -> s{_cirsLocation = a})
65
true
true
0
9
34
47
26
21
null
null
zaxtax/hakaru
haskell/Language/Hakaru/Sample.hs
bsd-3-clause
evalOp (Min HOrd_Prob) (VProb a) (VProb b) = VProb (min a b)
66
evalOp (Min HOrd_Prob) (VProb a) (VProb b) = VProb (min a b)
66
evalOp (Min HOrd_Prob) (VProb a) (VProb b) = VProb (min a b)
66
false
false
0
7
17
42
20
22
null
null
ml9951/ghc
compiler/coreSyn/CoreFVs.hs
bsd-3-clause
rulesFreeVars :: [CoreRule] -> VarSet rulesFreeVars rules = mapUnionVarSet ruleFreeVars rules
93
rulesFreeVars :: [CoreRule] -> VarSet rulesFreeVars rules = mapUnionVarSet ruleFreeVars rules
93
rulesFreeVars rules = mapUnionVarSet ruleFreeVars rules
55
false
true
0
6
10
26
13
13
null
null
rahulmutt/codec-jvm
src/Codec/JVM/ASM/Code.hs
apache-2.0
irem, lrem, frem, drem :: Code irem = binaryOp jint OP.irem
59
irem, lrem, frem, drem :: Code irem = binaryOp jint OP.irem
59
irem = binaryOp jint OP.irem
28
false
true
6
6
10
41
15
26
null
null
tpsinnem/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
normaliseC :: Context -> Env -> TT Name -> TT Name normaliseC ctxt env t = evalState (do val <- eval False ctxt [] (map finalEntry env) t [] quote 0 val) initEval
184
normaliseC :: Context -> Env -> TT Name -> TT Name normaliseC ctxt env t = evalState (do val <- eval False ctxt [] (map finalEntry env) t [] quote 0 val) initEval
184
normaliseC ctxt env t = evalState (do val <- eval False ctxt [] (map finalEntry env) t [] quote 0 val) initEval
133
false
true
0
12
54
90
40
50
null
null
kolmodin/cabal
cabal-install/Distribution/Client/Dependency/TopDown.hs
bsd-3-clause
addDeps :: Constraints -> [PackageName] -> Constraints addDeps = foldr $ \pkgname cs -> case Constraints.addTarget pkgname cs of Satisfiable cs' () -> cs' _ -> impossible "addDeps unsatisfiable"
253
addDeps :: Constraints -> [PackageName] -> Constraints addDeps = foldr $ \pkgname cs -> case Constraints.addTarget pkgname cs of Satisfiable cs' () -> cs' _ -> impossible "addDeps unsatisfiable"
253
addDeps = foldr $ \pkgname cs -> case Constraints.addTarget pkgname cs of Satisfiable cs' () -> cs' _ -> impossible "addDeps unsatisfiable"
198
false
true
2
10
87
73
34
39
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/ShallowDeepPlugin/Utils.hs
bsd-3-clause
thNameTyToDict :: PassCoreM m => TH.Name -> Type -> m CoreExpr thNameTyToDict n ty = do tyCon <- thNameToTyCon n buildDictionaryTyConT tyCon ty
147
thNameTyToDict :: PassCoreM m => TH.Name -> Type -> m CoreExpr thNameTyToDict n ty = do tyCon <- thNameToTyCon n buildDictionaryTyConT tyCon ty
147
thNameTyToDict n ty = do tyCon <- thNameToTyCon n buildDictionaryTyConT tyCon ty
84
false
true
0
9
26
59
25
34
null
null
sebcrozet/HBDD
Demos/8queens.hs
bsd-3-clause
main :: IO () main = do args <- getArgs if length args /= 2 then putStrLn usage else let n = read $ head $ tail $ args in let (bdd, context) = runState (queens n) mkContext in case head args of "-sat" -> putStrLn $ show $ getSat context bdd "-count" -> putStrLn $ show $ satCount context bdd "-satlist" -> putStrLn $ show $ getSatList context bdd _ -> putStrLn usage -- | A BDD representing the restictions needed to place one queen.
569
main :: IO () main = do args <- getArgs if length args /= 2 then putStrLn usage else let n = read $ head $ tail $ args in let (bdd, context) = runState (queens n) mkContext in case head args of "-sat" -> putStrLn $ show $ getSat context bdd "-count" -> putStrLn $ show $ satCount context bdd "-satlist" -> putStrLn $ show $ getSatList context bdd _ -> putStrLn usage -- | A BDD representing the restictions needed to place one queen.
569
main = do args <- getArgs if length args /= 2 then putStrLn usage else let n = read $ head $ tail $ args in let (bdd, context) = runState (queens n) mkContext in case head args of "-sat" -> putStrLn $ show $ getSat context bdd "-count" -> putStrLn $ show $ satCount context bdd "-satlist" -> putStrLn $ show $ getSatList context bdd _ -> putStrLn usage -- | A BDD representing the restictions needed to place one queen.
555
false
true
0
17
221
176
82
94
null
null
ctford/Idris-Elba-dev
src/Idris/Core/ProofState.hs
bsd-3-clause
prep_fill :: Name -> [Name] -> RunTactic prep_fill f as ctxt env (Bind x (Hole ty) sc) = do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as) return $ Bind x (Guess ty val) sc
201
prep_fill :: Name -> [Name] -> RunTactic prep_fill f as ctxt env (Bind x (Hole ty) sc) = do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as) return $ Bind x (Guess ty val) sc
201
prep_fill f as ctxt env (Bind x (Hole ty) sc) = do let val = mkApp (P Ref f Erased) (map (\n -> P Ref n Erased) as) return $ Bind x (Guess ty val) sc
160
false
true
0
16
53
124
59
65
null
null
brendanhay/gogol
gogol-androidmanagement/gen/Network/Google/Resource/AndroidManagement/Enterprises/Devices/Patch.hs
mpl-2.0
-- | V1 error format. edpXgafv :: Lens' EnterprisesDevicesPatch (Maybe Xgafv) edpXgafv = lens _edpXgafv (\ s a -> s{_edpXgafv = a})
131
edpXgafv :: Lens' EnterprisesDevicesPatch (Maybe Xgafv) edpXgafv = lens _edpXgafv (\ s a -> s{_edpXgafv = a})
109
edpXgafv = lens _edpXgafv (\ s a -> s{_edpXgafv = a})
53
true
true
0
9
21
46
25
21
null
null
RadoRado/Talks
SoftUniConf2015/examples.hs
mit
trimLeft = dropWhile isSpace
28
trimLeft = dropWhile isSpace
28
trimLeft = dropWhile isSpace
28
false
false
1
5
3
13
4
9
null
null
adunning/pandoc-citeproc
src/Text/CSL/Style.hs
bsd-3-clause
emptyFormatting :: Formatting emptyFormatting = Formatting [] [] [] [] [] [] [] [] [] [] NoQuote False False False []
121
emptyFormatting :: Formatting emptyFormatting = Formatting [] [] [] [] [] [] [] [] [] [] NoQuote False False False []
121
emptyFormatting = Formatting [] [] [] [] [] [] [] [] [] [] NoQuote False False False []
91
false
true
0
6
24
79
33
46
null
null
brendanhay/gogol
gogol-vision/gen/Network/Google/Vision/Types/Product.hs
mpl-2.0
-- | Creates a value of 'GcsDestination' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'gdURI' gcsDestination :: GcsDestination gcsDestination = GcsDestination' {_gdURI = Nothing}
270
gcsDestination :: GcsDestination gcsDestination = GcsDestination' {_gdURI = Nothing}
88
gcsDestination = GcsDestination' {_gdURI = Nothing}
51
true
true
0
7
46
31
17
14
null
null
githubkleon/ConvenientHDL
src/Language/Verilog/Parser.hs
bsd-3-clause
reservedOp :: Stream s Identity Char => String -> P s () reservedOp = T.reservedOp verilog
90
reservedOp :: Stream s Identity Char => String -> P s () reservedOp = T.reservedOp verilog
90
reservedOp = T.reservedOp verilog
33
false
true
0
8
15
38
18
20
null
null
stevechy/HaskellCakeStore
Web/WebHelper.hs
bsd-3-clause
toBuilder :: [String] -> BlazeBuilder.Builder toBuilder content = mconcat (map (fromLazyByteString . fromString) content)
121
toBuilder :: [String] -> BlazeBuilder.Builder toBuilder content = mconcat (map (fromLazyByteString . fromString) content)
121
toBuilder content = mconcat (map (fromLazyByteString . fromString) content)
75
false
true
0
9
13
46
22
24
null
null
christiaanb/clash-compiler
clash-lib/src/CLaSH/Util.hs
bsd-2-clause
firstM :: Functor f => (a -> f c) -> (a, b) -> f (c, b) firstM f (x,y) = (,y) <$> f x
106
firstM :: Functor f => (a -> f c) -> (a, b) -> f (c, b) firstM f (x,y) = (,y) <$> f x
106
firstM f (x,y) = (,y) <$> f x
29
false
true
0
9
44
73
39
34
null
null
pparkkin/eta
compiler/ETA/Prelude/PrimOp.hs
bsd-3-clause
tagOf_PrimOp ForkOnOp = _ILIT(356)
34
tagOf_PrimOp ForkOnOp = _ILIT(356)
34
tagOf_PrimOp ForkOnOp = _ILIT(356)
34
false
false
0
6
3
15
7
8
null
null
guoy34/ampersand
src/Database/Design/Ampersand/Components.hs
gpl-3.0
doGenUML :: FSpec -> IO() doGenUML fSpec = do { verboseLn (getOpts fSpec) "Generating UML..." ; writeFile outputFile $ generateUML fSpec ; Prelude.putStrLn $ "Generated file: " ++ outputFile ++ "." } where outputFile = combine (dirOutput (getOpts fSpec)) $ replaceExtension (baseName (getOpts fSpec)) ".xmi" -- This function will generate all Pictures for a given FSpec. -- the returned FSpec contains the details about the Pictures, so they -- can be referenced while rendering the FSpec. -- This function generates a pandoc document, possibly with pictures from an fSpec.
590
doGenUML :: FSpec -> IO() doGenUML fSpec = do { verboseLn (getOpts fSpec) "Generating UML..." ; writeFile outputFile $ generateUML fSpec ; Prelude.putStrLn $ "Generated file: " ++ outputFile ++ "." } where outputFile = combine (dirOutput (getOpts fSpec)) $ replaceExtension (baseName (getOpts fSpec)) ".xmi" -- This function will generate all Pictures for a given FSpec. -- the returned FSpec contains the details about the Pictures, so they -- can be referenced while rendering the FSpec. -- This function generates a pandoc document, possibly with pictures from an fSpec.
590
doGenUML fSpec = do { verboseLn (getOpts fSpec) "Generating UML..." ; writeFile outputFile $ generateUML fSpec ; Prelude.putStrLn $ "Generated file: " ++ outputFile ++ "." } where outputFile = combine (dirOutput (getOpts fSpec)) $ replaceExtension (baseName (getOpts fSpec)) ".xmi" -- This function will generate all Pictures for a given FSpec. -- the returned FSpec contains the details about the Pictures, so they -- can be referenced while rendering the FSpec. -- This function generates a pandoc document, possibly with pictures from an fSpec.
564
false
true
0
12
105
118
59
59
null
null
ndmitchell/firstify
Yhc/Core/Firstify/PaperOld.hs
bsd-3-clause
isBox f (CoreApp (CoreFun x) _) = f x
37
isBox f (CoreApp (CoreFun x) _) = f x
37
isBox f (CoreApp (CoreFun x) _) = f x
37
false
false
0
9
8
28
13
15
null
null
oldmanmike/ghc
compiler/simplCore/OccurAnal.hs
bsd-3-clause
-- [] No info -- -- one_shot_info:ctxt Analysing a function-valued expression that -- will be applied as described by one_shot_info initOccEnv :: (Activation -> Bool) -> OccEnv initOccEnv active_rule = OccEnv { occ_encl = OccVanilla , occ_one_shots = [] , occ_gbl_scrut = emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
451
initOccEnv :: (Activation -> Bool) -> OccEnv initOccEnv active_rule = OccEnv { occ_encl = OccVanilla , occ_one_shots = [] , occ_gbl_scrut = emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
259
initOccEnv active_rule = OccEnv { occ_encl = OccVanilla , occ_one_shots = [] , occ_gbl_scrut = emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
214
true
true
0
7
163
63
39
24
null
null
delta4d/codewars
kata/one-function-many-arguments-haskell-style/PolyvariadicFunctions.hs
mit
polyAdd :: PolyAdd r => r polyAdd = add' 0
43
polyAdd :: PolyAdd r => r polyAdd = add' 0
42
polyAdd = add' 0
16
false
true
0
6
10
21
10
11
null
null
jjwchoy/hotdb
tests/Util.hs
mit
assertNothing m (Just _) = assertFailure m
42
assertNothing m (Just _) = assertFailure m
42
assertNothing m (Just _) = assertFailure m
42
false
false
0
7
6
20
9
11
null
null
tbarnetlamb/hyphen
hyphen/lowlevel_src/HyphenGHC.hs
gpl-2.0
transformGHCType' :: PreTycLoc -> GHC.Type -> Maybe HsType transformGHCType' locSoFar typ = let (vars, rest) = GHC.splitForAllTys typ in case splitConstraint rest of (Just c, rest') -> transformGHCType' locSoFar rest' (Nothing, _) -> case GHCType.splitTyConApp_maybe rest of Just (tyc, args) -> do (kind', _) <- dePolyGHCKind $ GHCType.typeKind rest unpackSimpleGHCKind kind' -- check result type is of a kind we support -- (lifted, etc.) (tyc', checks) <- transformGHCTyc (finalizePreTycLoc (length args) locSoFar) tyc args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Left tyc') args' Nothing -> let (head, args) = GHCType.splitAppTys rest in case GHCType.getTyVar_maybe head of Just tyv -> do (tyv', checks) <- transformGHCTyVar tyv args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Right tyv') args' Nothing -> Nothing -- | Utility function, used in the recursion of transformGHCType' to -- construct HsType objects corresponding to all the child nodes of -- the parse tree of some GHC.Type.
1,431
transformGHCType' :: PreTycLoc -> GHC.Type -> Maybe HsType transformGHCType' locSoFar typ = let (vars, rest) = GHC.splitForAllTys typ in case splitConstraint rest of (Just c, rest') -> transformGHCType' locSoFar rest' (Nothing, _) -> case GHCType.splitTyConApp_maybe rest of Just (tyc, args) -> do (kind', _) <- dePolyGHCKind $ GHCType.typeKind rest unpackSimpleGHCKind kind' -- check result type is of a kind we support -- (lifted, etc.) (tyc', checks) <- transformGHCTyc (finalizePreTycLoc (length args) locSoFar) tyc args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Left tyc') args' Nothing -> let (head, args) = GHCType.splitAppTys rest in case GHCType.getTyVar_maybe head of Just tyv -> do (tyv', checks) <- transformGHCTyVar tyv args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Right tyv') args' Nothing -> Nothing -- | Utility function, used in the recursion of transformGHCType' to -- construct HsType objects corresponding to all the child nodes of -- the parse tree of some GHC.Type.
1,431
transformGHCType' locSoFar typ = let (vars, rest) = GHC.splitForAllTys typ in case splitConstraint rest of (Just c, rest') -> transformGHCType' locSoFar rest' (Nothing, _) -> case GHCType.splitTyConApp_maybe rest of Just (tyc, args) -> do (kind', _) <- dePolyGHCKind $ GHCType.typeKind rest unpackSimpleGHCKind kind' -- check result type is of a kind we support -- (lifted, etc.) (tyc', checks) <- transformGHCTyc (finalizePreTycLoc (length args) locSoFar) tyc args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Left tyc') args' Nothing -> let (head, args) = GHCType.splitAppTys rest in case GHCType.getTyVar_maybe head of Just tyv -> do (tyv', checks) <- transformGHCTyVar tyv args_remaining <- applyChecksAndStripChecked checks args args' <- transformGHCTypes locSoFar args_remaining return $ mkHsType (Right tyv') args' Nothing -> Nothing -- | Utility function, used in the recursion of transformGHCType' to -- construct HsType objects corresponding to all the child nodes of -- the parse tree of some GHC.Type.
1,372
false
true
0
23
440
333
160
173
null
null
kmels/hledger
hledger/Hledger/Cli/Add.hs
gpl-3.0
-- Find the most similar and recent transactions matching the given transaction description and report query. -- Transactions are listed with their "relevancy" score, most relevant first. transactionsSimilarTo :: Journal -> Query -> String -> [(Double,Transaction)] transactionsSimilarTo j q desc = sortBy compareRelevanceAndRecency $ filter ((> threshold).fst) [(compareDescriptions desc $ tdescription t, t) | t <- ts] where compareRelevanceAndRecency (n1,t1) (n2,t2) = compare (n2,tdate t2) (n1,tdate t1) ts = filter (q `matchesTransaction`) $ jtxns j threshold = 0
624
transactionsSimilarTo :: Journal -> Query -> String -> [(Double,Transaction)] transactionsSimilarTo j q desc = sortBy compareRelevanceAndRecency $ filter ((> threshold).fst) [(compareDescriptions desc $ tdescription t, t) | t <- ts] where compareRelevanceAndRecency (n1,t1) (n2,t2) = compare (n2,tdate t2) (n1,tdate t1) ts = filter (q `matchesTransaction`) $ jtxns j threshold = 0
436
transactionsSimilarTo j q desc = sortBy compareRelevanceAndRecency $ filter ((> threshold).fst) [(compareDescriptions desc $ tdescription t, t) | t <- ts] where compareRelevanceAndRecency (n1,t1) (n2,t2) = compare (n2,tdate t2) (n1,tdate t1) ts = filter (q `matchesTransaction`) $ jtxns j threshold = 0
358
true
true
2
10
133
163
89
74
null
null
valderman/selda
selda/src/Database/Selda/Query.hs
mit
-- | The actual code for any join. someJoin :: (Columns a, Columns (OuterCols a), Columns a') => JoinType -> (OuterCols a -> Col s Bool) -> Query (Inner s) a -> Query s a' someJoin jointype check q = Query $ do (join_st, res) <- isolate q cs <- renameAll $ fromTup res st <- get let nameds = [n | Named n _ <- cs] left = state2sql st right = sqlFrom cs (Product [state2sql join_st]) One on = check $ toTup nameds outCols = [Some $ Col n | Named n _ <- cs] ++ allCols [left] put $ st {sources = [sqlFrom outCols (Join jointype on left right)]} pure $ toTup nameds -- | Group an aggregate query by a column. -- Attempting to group a non-aggregate query is a type error. -- An aggregate representing the grouped-by column is returned, which can be -- returned from the aggregate query. For instance, if you want to find out -- how many people have a pet at home: -- -- > aggregate $ do -- > person <- select people -- > name' <- groupBy (person ! name) -- > return (name' :*: count(person ! pet_name) .> 0)
1,090
someJoin :: (Columns a, Columns (OuterCols a), Columns a') => JoinType -> (OuterCols a -> Col s Bool) -> Query (Inner s) a -> Query s a' someJoin jointype check q = Query $ do (join_st, res) <- isolate q cs <- renameAll $ fromTup res st <- get let nameds = [n | Named n _ <- cs] left = state2sql st right = sqlFrom cs (Product [state2sql join_st]) One on = check $ toTup nameds outCols = [Some $ Col n | Named n _ <- cs] ++ allCols [left] put $ st {sources = [sqlFrom outCols (Join jointype on left right)]} pure $ toTup nameds -- | Group an aggregate query by a column. -- Attempting to group a non-aggregate query is a type error. -- An aggregate representing the grouped-by column is returned, which can be -- returned from the aggregate query. For instance, if you want to find out -- how many people have a pet at home: -- -- > aggregate $ do -- > person <- select people -- > name' <- groupBy (person ! name) -- > return (name' :*: count(person ! pet_name) .> 0)
1,055
someJoin jointype check q = Query $ do (join_st, res) <- isolate q cs <- renameAll $ fromTup res st <- get let nameds = [n | Named n _ <- cs] left = state2sql st right = sqlFrom cs (Product [state2sql join_st]) One on = check $ toTup nameds outCols = [Some $ Col n | Named n _ <- cs] ++ allCols [left] put $ st {sources = [sqlFrom outCols (Join jointype on left right)]} pure $ toTup nameds -- | Group an aggregate query by a column. -- Attempting to group a non-aggregate query is a type error. -- An aggregate representing the grouped-by column is returned, which can be -- returned from the aggregate query. For instance, if you want to find out -- how many people have a pet at home: -- -- > aggregate $ do -- > person <- select people -- > name' <- groupBy (person ! name) -- > return (name' :*: count(person ! pet_name) .> 0)
882
true
true
0
16
287
299
149
150
null
null
GaloisInc/estimator
src/Numeric/Estimator/Model/SensorFusion.hs
bsd-3-clause
-- | Compute the true air-speed of the sensor platform. Useful as a -- measurement model for a true air-speed sensor. stateTAS :: Floating a => StateVector a -> a stateTAS state = distance (stateVel state) (stateWind state)
223
stateTAS :: Floating a => StateVector a -> a stateTAS state = distance (stateVel state) (stateWind state)
105
stateTAS state = distance (stateVel state) (stateWind state)
60
true
true
0
7
37
47
23
24
null
null
pimlott/diff-du
diff-du.hs
bsd-3-clause
setOptThreshold t = case reads t of [(t', "")] -> Left (\o -> o { optThreshold = t' }) _ -> Right (printf "threshold %s not an int\n" t)
149
setOptThreshold t = case reads t of [(t', "")] -> Left (\o -> o { optThreshold = t' }) _ -> Right (printf "threshold %s not an int\n" t)
149
setOptThreshold t = case reads t of [(t', "")] -> Left (\o -> o { optThreshold = t' }) _ -> Right (printf "threshold %s not an int\n" t)
149
false
false
4
8
41
67
35
32
null
null
Helkafen/cabal
Cabal/Distribution/Simple/Setup.hs
bsd-3-clause
emptyHscolourFlags :: HscolourFlags emptyHscolourFlags = mempty
63
emptyHscolourFlags :: HscolourFlags emptyHscolourFlags = mempty
63
emptyHscolourFlags = mempty
27
false
true
0
4
5
11
6
5
null
null
rgleichman/roshask
src/executable/PkgBuilder.hs
bsd-3-clause
roshaskVersion :: B.ByteString roshaskVersion = B.pack . intercalate "." $ map show (versionBranch version)
107
roshaskVersion :: B.ByteString roshaskVersion = B.pack . intercalate "." $ map show (versionBranch version)
107
roshaskVersion = B.pack . intercalate "." $ map show (versionBranch version)
76
false
true
0
8
13
37
18
19
null
null
beni55/haste-compiler
libraries/ghc-7.10/base/System/IO.hs
bsd-3-clause
-- ----------------------------------------------------------------------------- -- Standard IO -- | Write a character to the standard output device -- (same as 'hPutChar' 'stdout'). putChar :: Char -> IO () putChar c = hPutChar stdout c
254
putChar :: Char -> IO () putChar c = hPutChar stdout c
69
putChar c = hPutChar stdout c
36
true
true
0
7
48
32
17
15
null
null
matthew-eads/agpl
test_lib.hs
isc
n (x, y) = (x, y+1)
20
n (x, y) = (x, y+1)
20
n (x, y) = (x, y+1)
20
false
false
0
6
6
26
14
12
null
null
yesodweb/shakespeare
Text/Shakespeare/I18N.hs
mit
-- |generate translations from translation files -- -- This function will: -- -- 1. look in the supplied subdirectory for files ending in @.msg@ -- -- 2. generate a type based on the constructors found -- -- 3. create a 'RenderMessage' instance -- mkMessage :: String -- ^ base name to use for translation type -> FilePath -- ^ subdirectory which contains the translation files -> Lang -- ^ default translation language -> Q [Dec] mkMessage dt folder lang = mkMessageCommon True "Msg" "Message" dt dt folder lang
555
mkMessage :: String -- ^ base name to use for translation type -> FilePath -- ^ subdirectory which contains the translation files -> Lang -- ^ default translation language -> Q [Dec] mkMessage dt folder lang = mkMessageCommon True "Msg" "Message" dt dt folder lang
304
mkMessage dt folder lang = mkMessageCommon True "Msg" "Message" dt dt folder lang
85
true
true
0
9
130
64
38
26
null
null
ellis/OnTopOfThings
old-20150308/src/OnTopOfThings/Commands/Import.hs
gpl-3.0
optsToCommandRecord :: UTCTime -> T.Text -> Options -> CommandRecord optsToCommandRecord time user opts = CommandRecord 1 time user (T.pack $ optionsCmd opts) opts'' where opts' = reform opts opts'' = map T.pack opts'
221
optsToCommandRecord :: UTCTime -> T.Text -> Options -> CommandRecord optsToCommandRecord time user opts = CommandRecord 1 time user (T.pack $ optionsCmd opts) opts'' where opts' = reform opts opts'' = map T.pack opts'
221
optsToCommandRecord time user opts = CommandRecord 1 time user (T.pack $ optionsCmd opts) opts'' where opts' = reform opts opts'' = map T.pack opts'
152
false
true
0
8
36
76
38
38
null
null
jgm/pandoc-types
src/Text/Pandoc/Builder.hs
bsd-3-clause
fromList :: [a] -> Many a fromList = Many . Seq.fromList
56
fromList :: [a] -> Many a fromList = Many . Seq.fromList
56
fromList = Many . Seq.fromList
30
false
true
1
7
10
34
15
19
null
null
AndrewRademacher/wai
warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs
mit
stream FrameData header@FrameHeader{flags,payloadLength,streamId} bs Context{outputQ} s@(Open (Body q)) Stream{streamNumber,streamBodyLength,streamContentLength} = do DataFrame body <- guardIt $ decodeDataFrame header bs let endOfStream = testEndStream flags len0 <- readIORef streamBodyLength let !len = len0 + payloadLength writeIORef streamBodyLength len when (payloadLength /= 0) $ do let frame1 = windowUpdateFrame 0 payloadLength frame2 = windowUpdateFrame streamNumber payloadLength frame = frame1 `BS.append` frame2 enqueue outputQ (OFrame frame) highestPriority atomically $ writeTQueue q body if endOfStream then do mcl <- readIORef streamContentLength case mcl of Nothing -> return () Just cl -> when (cl /= len) $ E.throwIO $ StreamError ProtocolError streamId atomically $ writeTQueue q "" return HalfClosed else return s
1,004
stream FrameData header@FrameHeader{flags,payloadLength,streamId} bs Context{outputQ} s@(Open (Body q)) Stream{streamNumber,streamBodyLength,streamContentLength} = do DataFrame body <- guardIt $ decodeDataFrame header bs let endOfStream = testEndStream flags len0 <- readIORef streamBodyLength let !len = len0 + payloadLength writeIORef streamBodyLength len when (payloadLength /= 0) $ do let frame1 = windowUpdateFrame 0 payloadLength frame2 = windowUpdateFrame streamNumber payloadLength frame = frame1 `BS.append` frame2 enqueue outputQ (OFrame frame) highestPriority atomically $ writeTQueue q body if endOfStream then do mcl <- readIORef streamContentLength case mcl of Nothing -> return () Just cl -> when (cl /= len) $ E.throwIO $ StreamError ProtocolError streamId atomically $ writeTQueue q "" return HalfClosed else return s
1,004
stream FrameData header@FrameHeader{flags,payloadLength,streamId} bs Context{outputQ} s@(Open (Body q)) Stream{streamNumber,streamBodyLength,streamContentLength} = do DataFrame body <- guardIt $ decodeDataFrame header bs let endOfStream = testEndStream flags len0 <- readIORef streamBodyLength let !len = len0 + payloadLength writeIORef streamBodyLength len when (payloadLength /= 0) $ do let frame1 = windowUpdateFrame 0 payloadLength frame2 = windowUpdateFrame streamNumber payloadLength frame = frame1 `BS.append` frame2 enqueue outputQ (OFrame frame) highestPriority atomically $ writeTQueue q body if endOfStream then do mcl <- readIORef streamContentLength case mcl of Nothing -> return () Just cl -> when (cl /= len) $ E.throwIO $ StreamError ProtocolError streamId atomically $ writeTQueue q "" return HalfClosed else return s
1,004
false
false
0
17
276
307
143
164
null
null
ctford/Idris-Elba-dev
src/IRTS/CodegenLLVM.hs
bsd-3-clause
outputModule _ _ MavenProject _ = ierror "FAILURE: unsupported output type"
75
outputModule _ _ MavenProject _ = ierror "FAILURE: unsupported output type"
75
outputModule _ _ MavenProject _ = ierror "FAILURE: unsupported output type"
75
false
false
0
5
10
18
8
10
null
null
khumba/khph
src/Khph/Util.hs
agpl-3.0
maybeLast (_:xs) = maybeLast xs
31
maybeLast (_:xs) = maybeLast xs
31
maybeLast (_:xs) = maybeLast xs
31
false
false
0
7
4
19
9
10
null
null
drcabana/euler-fp
source/hs/P30.hs
epl-1.0
main = print solution
21
main = print solution
21
main = print solution
21
false
false
0
5
3
9
4
5
null
null
owestphal/LootLanguage
src/BaseTypeList.hs
bsd-3-clause
armourEvasionGloves = ["Fishscale Gauntlets","Ironscale Gauntlets","Bronzescale Gauntlets", "Steelscale Gauntlets","Serpentscale Gauntlets","Wyrmscale Gauntlets","Hydrascale Gauntlets","Dragonscale Gauntlets"]
211
armourEvasionGloves = ["Fishscale Gauntlets","Ironscale Gauntlets","Bronzescale Gauntlets", "Steelscale Gauntlets","Serpentscale Gauntlets","Wyrmscale Gauntlets","Hydrascale Gauntlets","Dragonscale Gauntlets"]
211
armourEvasionGloves = ["Fishscale Gauntlets","Ironscale Gauntlets","Bronzescale Gauntlets", "Steelscale Gauntlets","Serpentscale Gauntlets","Wyrmscale Gauntlets","Hydrascale Gauntlets","Dragonscale Gauntlets"]
211
false
false
0
5
13
30
19
11
null
null
bgamari/shaking-up-ghc
src/Way/Type.hs
bsd-3-clause
wayFromUnits :: [WayUnit] -> Way wayFromUnits = Way . Set.fromList . map fromEnum
81
wayFromUnits :: [WayUnit] -> Way wayFromUnits = Way . Set.fromList . map fromEnum
81
wayFromUnits = Way . Set.fromList . map fromEnum
48
false
true
0
7
12
31
16
15
null
null
strager/reactive-thread
examples/sdl/Main.hs
bsd-3-clause
velocity :: Double -- ^ Initial position. -> UpdateVar Time -- ^ Time. -> UpdateVar Double -- ^ Velocity. -> Update o (UpdateVar Double) velocity z timeVar velVar = parallel z $ do zeroTime <- query timeVar evalStateT (foreverT go) (z, zeroTime) where go = do (pos, time) <- get time' <- lift $ query timeVar vel <- lift $ query velVar let dt = time' - time pos' <- if dt > 0 && vel /= 0 then do let pos' = pos + dt * vel lift $ yield pos' return pos' else return pos put (pos', time')
602
velocity :: Double -- ^ Initial position. -> UpdateVar Time -- ^ Time. -> UpdateVar Double -- ^ Velocity. -> Update o (UpdateVar Double) velocity z timeVar velVar = parallel z $ do zeroTime <- query timeVar evalStateT (foreverT go) (z, zeroTime) where go = do (pos, time) <- get time' <- lift $ query timeVar vel <- lift $ query velVar let dt = time' - time pos' <- if dt > 0 && vel /= 0 then do let pos' = pos + dt * vel lift $ yield pos' return pos' else return pos put (pos', time')
602
velocity z timeVar velVar = parallel z $ do zeroTime <- query timeVar evalStateT (foreverT go) (z, zeroTime) where go = do (pos, time) <- get time' <- lift $ query timeVar vel <- lift $ query velVar let dt = time' - time pos' <- if dt > 0 && vel /= 0 then do let pos' = pos + dt * vel lift $ yield pos' return pos' else return pos put (pos', time')
442
false
true
1
16
216
232
107
125
null
null
hectorhon/autotrace2
src/TimeSeriesData/Counts.hs
bsd-3-clause
counts' _ _ _ = assert False undefined
38
counts' _ _ _ = assert False undefined
38
counts' _ _ _ = assert False undefined
38
false
false
0
5
7
18
8
10
null
null
IreneKnapp/direct-opengl
Graphics/Rendering/OpenGL/GLU/Tessellation.hs
bsd-3-clause
safeDeleteTess :: TessellatorObj -> IO () safeDeleteTess tessObj = unless (isNullTesselatorObj tessObj) $ gluDeleteTess tessObj
130
safeDeleteTess :: TessellatorObj -> IO () safeDeleteTess tessObj = unless (isNullTesselatorObj tessObj) $ gluDeleteTess tessObj
130
safeDeleteTess tessObj = unless (isNullTesselatorObj tessObj) $ gluDeleteTess tessObj
88
false
true
0
8
17
43
19
24
null
null
rueshyna/gogol
gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs
mpl-2.0
-- | The video\'s Departamento de Justiça, Classificação, Qualificação e -- Títulos (DJCQT - Brazil) rating. crDjctqRating :: Lens' ContentRating (Maybe ContentRatingDjctqRating) crDjctqRating = lens _crDjctqRating (\ s a -> s{_crDjctqRating = a})
255
crDjctqRating :: Lens' ContentRating (Maybe ContentRatingDjctqRating) crDjctqRating = lens _crDjctqRating (\ s a -> s{_crDjctqRating = a})
146
crDjctqRating = lens _crDjctqRating (\ s a -> s{_crDjctqRating = a})
76
true
true
0
9
40
49
26
23
null
null
snoyberg/ghc
compiler/main/HscTypes.hs
bsd-3-clause
setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext setInteractivePrintName ic n = ic{ic_int_print = n}
127
setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext setInteractivePrintName ic n = ic{ic_int_print = n}
127
setInteractivePrintName ic n = ic{ic_int_print = n}
51
false
true
0
8
13
42
19
23
null
null
jgardella/AuditedComputation
src/Nancy/Core/Util.hs
mit
valueSubOverVar value var otherExpr = mapExpr (valueSubOverVar value var) otherExpr
85
valueSubOverVar value var otherExpr = mapExpr (valueSubOverVar value var) otherExpr
85
valueSubOverVar value var otherExpr = mapExpr (valueSubOverVar value var) otherExpr
85
false
false
0
7
11
26
12
14
null
null
harrisi/on-being-better
list-expansion/Haskell/course/src/Course/List.hs
cc0-1.0
length (_ :. t) = 1 + length t
30
length (_ :. t) = 1 + length t
30
length (_ :. t) = 1 + length t
30
false
false
0
7
8
23
11
12
null
null
lukexi/oculus-mini
src/Graphics/Oculus/API.hs
mit
getEyeProjection :: HMDInfo -> Float -> Float -> Int -> IO (M44 Float) getEyeProjection hmdInfo zNear zFar eyeIndex = do m44FromFlatMatrixPtr =<< createProjectionForEye_raw hmdInfo (realToFrac zNear) (realToFrac zFar) (fromIntegral eyeIndex)
263
getEyeProjection :: HMDInfo -> Float -> Float -> Int -> IO (M44 Float) getEyeProjection hmdInfo zNear zFar eyeIndex = do m44FromFlatMatrixPtr =<< createProjectionForEye_raw hmdInfo (realToFrac zNear) (realToFrac zFar) (fromIntegral eyeIndex)
263
getEyeProjection hmdInfo zNear zFar eyeIndex = do m44FromFlatMatrixPtr =<< createProjectionForEye_raw hmdInfo (realToFrac zNear) (realToFrac zFar) (fromIntegral eyeIndex)
192
false
true
0
11
51
84
39
45
null
null
mcdonndi/ChatServer
dist/build/ChatServer/autogen/Paths_ChatServer.hs
bsd-3-clause
bindirrel = "bin"
21
bindirrel = "bin"
21
bindirrel = "bin"
21
false
false
0
4
6
6
3
3
null
null
adamrk/scheme2luac
src/Parser2.hs
bsd-3-clause
freeInAnnDef f (Def2 _ es b) = freeVarsAnnBody f b `S.difference` foldMap freeVarsEx es
89
freeInAnnDef f (Def2 _ es b) = freeVarsAnnBody f b `S.difference` foldMap freeVarsEx es
89
freeInAnnDef f (Def2 _ es b) = freeVarsAnnBody f b `S.difference` foldMap freeVarsEx es
89
false
false
0
6
15
45
20
25
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Backends/Xhtml/Utils.hs
gpl-3.0
-- | Generate a named anchor namedAnchor :: String -> Html -> Html namedAnchor n = anchor ! [XHtml.name n]
106
namedAnchor :: String -> Html -> Html namedAnchor n = anchor ! [XHtml.name n]
77
namedAnchor n = anchor ! [XHtml.name n]
39
true
true
0
9
19
41
19
22
null
null
mudphone/HaskellBook
shawty-prime/app/Main.hs
mit
shortyAintUri :: TL.Text -> TL.Text shortyAintUri uri = TL.concat [ uri , " wasn't a url, did you forget http://?" ]
142
shortyAintUri :: TL.Text -> TL.Text shortyAintUri uri = TL.concat [ uri , " wasn't a url, did you forget http://?" ]
142
shortyAintUri uri = TL.concat [ uri , " wasn't a url, did you forget http://?" ]
106
false
true
0
6
46
33
17
16
null
null
dmbarbour/haskell-vcache
hsrc_lib/Database/VCache/Path.hs
bsd-2-clause
-- key size limit from LMDB 0.9.10 -- | VCache implements a simplified filesystem metaphor. By assigning -- a different prefix for root PVars loaded by different subprograms, -- developers can guard against namespace collisions. Each component -- may have its own persistent roots. -- -- While I call this a subdirectory, it really is just a prefix. Using -- "foo" followed by "bar" is equivalent to using "foobar". Developers -- should include their own separators if they expect them, i.e. "foo\/" -- and "bar\/". -- -- Total paths are limited to ~500 bytes. -- vcacheSubdir :: ByteString -> VCache -> VCache vcacheSubdir p (VCache vs d) = let d' = subdir d p in if BS.length d' > maxPathLen then error ("VCache path too long: " ++ show d') else VCache vs d'
785
vcacheSubdir :: ByteString -> VCache -> VCache vcacheSubdir p (VCache vs d) = let d' = subdir d p in if BS.length d' > maxPathLen then error ("VCache path too long: " ++ show d') else VCache vs d'
220
vcacheSubdir p (VCache vs d) = let d' = subdir d p in if BS.length d' > maxPathLen then error ("VCache path too long: " ++ show d') else VCache vs d'
173
true
true
0
11
158
96
53
43
null
null
netogallo/Microsoft-Translator-Haskell
src/Language/Bing.hs
bsd-3-clause
toSym Japanese = "ja"
21
toSym Japanese = "ja"
21
toSym Japanese = "ja"
21
false
false
1
5
3
13
4
9
null
null
danstiner/dupes
src/Dupes/FileHash.hs
mit
testGroup = $(testGroupGenerator)
33
testGroup = $(testGroupGenerator)
33
testGroup = $(testGroupGenerator)
33
false
false
0
7
2
14
6
8
null
null
NightRa/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist)
78
annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist)
78
annotationColour ist AnnKeyword = Just $ keywordColour (idris_colourTheme ist)
78
false
false
0
8
8
24
11
13
null
null
romanb/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | The unique key that identifies a certificate. cCertificateIdentifier :: Lens' Certificate (Maybe Text) cCertificateIdentifier = lens _cCertificateIdentifier (\s a -> s { _cCertificateIdentifier = a })
209
cCertificateIdentifier :: Lens' Certificate (Maybe Text) cCertificateIdentifier = lens _cCertificateIdentifier (\s a -> s { _cCertificateIdentifier = a })
158
cCertificateIdentifier = lens _cCertificateIdentifier (\s a -> s { _cCertificateIdentifier = a })
101
true
true
0
9
31
46
25
21
null
null
xruzzz/axt-tic-tac-toe-gl-haskell
src/AXT/TicTacToe/Conversions.hs
bsd-3-clause
c3D x y = C3D x y (0∷Int)
25
c3D x y = C3D x y (0∷Int)
25
c3D x y = C3D x y (0∷Int)
25
false
false
0
6
7
24
12
12
null
null
scott-fleischman/greek-grammar
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
mit
decomposeChar '\x1EDD' = "\x006F\x031B\x0300"
45
decomposeChar '\x1EDD' = "\x006F\x031B\x0300"
45
decomposeChar '\x1EDD' = "\x006F\x031B\x0300"
45
false
false
0
4
3
10
4
6
null
null
sgillespie/ghc
compiler/prelude/TysWiredIn.hs
bsd-3-clause
-- build one specially parrFakeCon i = parrFakeConArr!i
77
parrFakeCon i = parrFakeConArr!i
54
parrFakeCon i = parrFakeConArr!i
54
true
false
0
5
29
14
7
7
null
null
andorp/bead
src/Bead/View/Content/Bootstrap.hs
bsd-3-clause
-- | Creates an optional text input field onyl with default value optionalTextInputFieldWithDefault paramName value = H.input ! formControl ! type_ "text" ! A.name (fromString paramName) ! A.id (fromString paramName) ! A.value (fromString value)
297
optionalTextInputFieldWithDefault paramName value = H.input ! formControl ! type_ "text" ! A.name (fromString paramName) ! A.id (fromString paramName) ! A.value (fromString value)
231
optionalTextInputFieldWithDefault paramName value = H.input ! formControl ! type_ "text" ! A.name (fromString paramName) ! A.id (fromString paramName) ! A.value (fromString value)
231
true
false
0
10
85
70
33
37
null
null
cjw-charleswu/Wizard
TicTacToe/src/TTT/Game.hs
bsd-3-clause
getNextState :: GameState -> Position -> Piece -> Maybe GameState getNextState s nextPos nextPiece = do if isLegalMove s nextPos nextPiece then Just GameState { board = newBoard (board s) nextPos nextPiece, whoseTurn = whoseTurnNext s } else Nothing
279
getNextState :: GameState -> Position -> Piece -> Maybe GameState getNextState s nextPos nextPiece = do if isLegalMove s nextPos nextPiece then Just GameState { board = newBoard (board s) nextPos nextPiece, whoseTurn = whoseTurnNext s } else Nothing
279
getNextState s nextPos nextPiece = do if isLegalMove s nextPos nextPiece then Just GameState { board = newBoard (board s) nextPos nextPiece, whoseTurn = whoseTurnNext s } else Nothing
213
false
true
0
13
68
84
42
42
null
null
cordawyn/rdf4h
src/Data/RDF/PatriciaTreeGraph.hs
bsd-3-clause
query' :: PatriciaTreeGraph -> Maybe Subject -> Maybe Predicate -> Maybe Object -> Triples query' (PatriciaTreeGraph (g,idxLookup,_,_)) maybeSubj maybePred maybeObj = let cfun ( adjsIn , _nodeIdx , thisNode , adjsOut ) | isNothing maybeSubj && isNothing maybePred && isNothing maybeObj = mkTriples idxLookup thisNode adjsIn adjsOut | isJust maybeSubj && isNothing maybePred && isNothing maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = if not (null adjsIn') then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if not (null adjsOut') then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isNothing maybePred && isJust maybeObj = let adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = mkTriples idxLookup thisNode [] adjsOut' ts2 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn [] else [] in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isJust maybeSubj && isNothing maybePred && isJust maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 cfun ( _ , _ , _ , _ ) = undefined -- not sure why this pattern is needed to exhaust cfun arg patterns in concat $ DFS.dfsWith' cfun g
5,154
query' :: PatriciaTreeGraph -> Maybe Subject -> Maybe Predicate -> Maybe Object -> Triples query' (PatriciaTreeGraph (g,idxLookup,_,_)) maybeSubj maybePred maybeObj = let cfun ( adjsIn , _nodeIdx , thisNode , adjsOut ) | isNothing maybeSubj && isNothing maybePred && isNothing maybeObj = mkTriples idxLookup thisNode adjsIn adjsOut | isJust maybeSubj && isNothing maybePred && isNothing maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = if not (null adjsIn') then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if not (null adjsOut') then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isNothing maybePred && isJust maybeObj = let adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = mkTriples idxLookup thisNode [] adjsOut' ts2 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn [] else [] in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isJust maybeSubj && isNothing maybePred && isJust maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 cfun ( _ , _ , _ , _ ) = undefined -- not sure why this pattern is needed to exhaust cfun arg patterns in concat $ DFS.dfsWith' cfun g
5,154
query' (PatriciaTreeGraph (g,idxLookup,_,_)) maybeSubj maybePred maybeObj = let cfun ( adjsIn , _nodeIdx , thisNode , adjsOut ) | isNothing maybeSubj && isNothing maybePred && isNothing maybeObj = mkTriples idxLookup thisNode adjsIn adjsOut | isJust maybeSubj && isNothing maybePred && isNothing maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = if not (null adjsIn') then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if not (null adjsOut') then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isNothing maybePred && isJust maybeObj = let adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = mkTriples idxLookup thisNode [] adjsOut' ts2 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn [] else [] in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isNothing maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,_idxObj) -> p == fromJust maybePred ) adjsOut ts1 = mkTriples idxLookup thisNode adjsIn' [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isJust maybeSubj && isNothing maybePred && isJust maybeObj = let adjsIn' = filter (\(_p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj ) adjsIn adjsOut' = filter (\(_p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = if thisNode == fromJust maybeSubj then mkTriples idxLookup thisNode [] adjsOut' else [] in ts1 ++ ts2 | isNothing maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,_idxSubj) -> p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 | isJust maybeSubj && isJust maybePred && isJust maybeObj = let adjsIn' = filter (\(p,idxSubj) -> fromJust (IntMap.lookup idxSubj idxLookup) == fromJust maybeSubj && p == fromJust maybePred ) adjsIn adjsOut' = filter (\(p,idxObj) -> fromJust (IntMap.lookup idxObj idxLookup) == fromJust maybeObj && p == fromJust maybePred ) adjsOut ts1 = if thisNode == fromJust maybeObj then mkTriples idxLookup thisNode adjsIn' [] else [] ts2 = mkTriples idxLookup thisNode [] adjsOut' in ts1 ++ ts2 cfun ( _ , _ , _ , _ ) = undefined -- not sure why this pattern is needed to exhaust cfun arg patterns in concat $ DFS.dfsWith' cfun g
5,063
false
true
2
23
2,350
1,312
650
662
null
null
urbanslug/ghc
utils/hpc/HpcMarkup.hs
bsd-3-clause
addMarkup tabStop0 (c0:cs) loc@(Loc _ p) os ticks = if c0=='\n' && os/=[] then concatMap (const closeTick) (downToTopLevel os) ++ c0 : "<span class=\"spaces\">" ++ expand 1 w ++ "</span>" ++ concatMap (openTick.snd) (reverse (downToTopLevel os)) ++ addMarkup tabStop0 cs' loc' os ticks else if c0=='\t' then expand p "\t" ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks else escape c0 ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks where (w,cs') = span (`elem` " \t") cs loc' = foldl (flip incBy) loc (c0:w) escape '>' = "&gt;" escape '<' = "&lt;" escape '"' = "&quot;" escape '&' = "&amp;" escape c = [c] expand :: Int -> String -> String expand _ "" = "" expand c ('\t':s) = replicate (c' - c) ' ' ++ expand c' s where c' = tabStopAfter 8 c expand c (' ':s) = ' ' : expand (c+1) s expand _ _ = error "bad character in string for expansion" incBy :: Char -> Loc -> Loc incBy '\n' (Loc ln _c) = Loc (succ ln) 1 incBy '\t' (Loc ln c) = Loc ln (tabStopAfter tabStop0 c) incBy _ (Loc ln c) = Loc ln (succ c) tabStopAfter :: Int -> Int -> Int tabStopAfter tabStop c = fromJust (find (>c) [1,(tabStop + 1)..])
1,204
addMarkup tabStop0 (c0:cs) loc@(Loc _ p) os ticks = if c0=='\n' && os/=[] then concatMap (const closeTick) (downToTopLevel os) ++ c0 : "<span class=\"spaces\">" ++ expand 1 w ++ "</span>" ++ concatMap (openTick.snd) (reverse (downToTopLevel os)) ++ addMarkup tabStop0 cs' loc' os ticks else if c0=='\t' then expand p "\t" ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks else escape c0 ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks where (w,cs') = span (`elem` " \t") cs loc' = foldl (flip incBy) loc (c0:w) escape '>' = "&gt;" escape '<' = "&lt;" escape '"' = "&quot;" escape '&' = "&amp;" escape c = [c] expand :: Int -> String -> String expand _ "" = "" expand c ('\t':s) = replicate (c' - c) ' ' ++ expand c' s where c' = tabStopAfter 8 c expand c (' ':s) = ' ' : expand (c+1) s expand _ _ = error "bad character in string for expansion" incBy :: Char -> Loc -> Loc incBy '\n' (Loc ln _c) = Loc (succ ln) 1 incBy '\t' (Loc ln c) = Loc ln (tabStopAfter tabStop0 c) incBy _ (Loc ln c) = Loc ln (succ c) tabStopAfter :: Int -> Int -> Int tabStopAfter tabStop c = fromJust (find (>c) [1,(tabStop + 1)..])
1,204
addMarkup tabStop0 (c0:cs) loc@(Loc _ p) os ticks = if c0=='\n' && os/=[] then concatMap (const closeTick) (downToTopLevel os) ++ c0 : "<span class=\"spaces\">" ++ expand 1 w ++ "</span>" ++ concatMap (openTick.snd) (reverse (downToTopLevel os)) ++ addMarkup tabStop0 cs' loc' os ticks else if c0=='\t' then expand p "\t" ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks else escape c0 ++ addMarkup tabStop0 cs (incBy c0 loc) os ticks where (w,cs') = span (`elem` " \t") cs loc' = foldl (flip incBy) loc (c0:w) escape '>' = "&gt;" escape '<' = "&lt;" escape '"' = "&quot;" escape '&' = "&amp;" escape c = [c] expand :: Int -> String -> String expand _ "" = "" expand c ('\t':s) = replicate (c' - c) ' ' ++ expand c' s where c' = tabStopAfter 8 c expand c (' ':s) = ' ' : expand (c+1) s expand _ _ = error "bad character in string for expansion" incBy :: Char -> Loc -> Loc incBy '\n' (Loc ln _c) = Loc (succ ln) 1 incBy '\t' (Loc ln c) = Loc ln (tabStopAfter tabStop0 c) incBy _ (Loc ln c) = Loc ln (succ c) tabStopAfter :: Int -> Int -> Int tabStopAfter tabStop c = fromJust (find (>c) [1,(tabStop + 1)..])
1,204
false
false
2
14
311
575
288
287
null
null
brendanhay/gogol
gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs
mpl-2.0
-- | Creates a value of 'BasicSeriesDataPointStyleOverride' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'bsdpsoColor' -- -- * 'bsdpsoColorStyle' -- -- * 'bsdpsoPointStyle' -- -- * 'bsdpsoIndex' basicSeriesDataPointStyleOverride :: BasicSeriesDataPointStyleOverride basicSeriesDataPointStyleOverride = BasicSeriesDataPointStyleOverride' { _bsdpsoColor = Nothing , _bsdpsoColorStyle = Nothing , _bsdpsoPointStyle = Nothing , _bsdpsoIndex = Nothing }
562
basicSeriesDataPointStyleOverride :: BasicSeriesDataPointStyleOverride basicSeriesDataPointStyleOverride = BasicSeriesDataPointStyleOverride' { _bsdpsoColor = Nothing , _bsdpsoColorStyle = Nothing , _bsdpsoPointStyle = Nothing , _bsdpsoIndex = Nothing }
279
basicSeriesDataPointStyleOverride = BasicSeriesDataPointStyleOverride' { _bsdpsoColor = Nothing , _bsdpsoColorStyle = Nothing , _bsdpsoPointStyle = Nothing , _bsdpsoIndex = Nothing }
204
true
true
1
7
94
55
35
20
null
null
Fuuzetsu/pastepipe
src/Utils/PastePipe.hs
gpl-3.0
-- | The URI for posting new pastes to lpaste. -- This isn't guaranteed to trigger a failure on all execution paths, as-is. saveUri :: String -> URI saveUri coreUri = buildURI coreUri "new"
189
saveUri :: String -> URI saveUri coreUri = buildURI coreUri "new"
65
saveUri coreUri = buildURI coreUri "new"
40
true
true
0
5
33
25
13
12
null
null
smaccm/capDL-tool
CapDL/State.hs
bsd-2-clause
validObjArch IA32 (VCPU {}) = True
34
validObjArch IA32 (VCPU {}) = True
34
validObjArch IA32 (VCPU {}) = True
34
false
false
0
7
5
18
9
9
null
null
eijian/picfinder
src/Main-t0.hs
bsd-3-clause
main :: IO () main = do putStrLn (show ks) putStrLn (show es) where m = tomap dat Map.empty ks = Map.keys m es = Map.elems m
142
main :: IO () main = do putStrLn (show ks) putStrLn (show es) where m = tomap dat Map.empty ks = Map.keys m es = Map.elems m
142
main = do putStrLn (show ks) putStrLn (show es) where m = tomap dat Map.empty ks = Map.keys m es = Map.elems m
128
false
true
3
9
44
91
36
55
null
null
notae/haskell-exercise
lens/Poly.hs
bsd-3-clause
_2 :: Lens (Pair a b) (Pair a b') b b' _2 f (Pair a b) = (\x -> Pair a x) <$> f b
81
_2 :: Lens (Pair a b) (Pair a b') b b' _2 f (Pair a b) = (\x -> Pair a x) <$> f b
81
_2 f (Pair a b) = (\x -> Pair a x) <$> f b
42
false
true
1
8
24
76
34
42
null
null
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Resource/Directory/RoleAssignments/Delete.hs
mpl-2.0
-- | Creates a value of 'RoleAssignmentsDelete' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'radCustomer' -- -- * 'radRoleAssignmentId' roleAssignmentsDelete :: Text -- ^ 'radCustomer' -> Text -- ^ 'radRoleAssignmentId' -> RoleAssignmentsDelete roleAssignmentsDelete pRadCustomer_ pRadRoleAssignmentId_ = RoleAssignmentsDelete' { _radCustomer = pRadCustomer_ , _radRoleAssignmentId = pRadRoleAssignmentId_ }
524
roleAssignmentsDelete :: Text -- ^ 'radCustomer' -> Text -- ^ 'radRoleAssignmentId' -> RoleAssignmentsDelete roleAssignmentsDelete pRadCustomer_ pRadRoleAssignmentId_ = RoleAssignmentsDelete' { _radCustomer = pRadCustomer_ , _radRoleAssignmentId = pRadRoleAssignmentId_ }
299
roleAssignmentsDelete pRadCustomer_ pRadRoleAssignmentId_ = RoleAssignmentsDelete' { _radCustomer = pRadCustomer_ , _radRoleAssignmentId = pRadRoleAssignmentId_ }
178
true
true
0
6
92
47
30
17
null
null
bobgru/conifer
src/Matrix.hs
bsd-3-clause
solve' :: (Fractional a, Ord a) => Matrix a -> Solution a solve' (Matrix m) | all equivZero r = Many | equivZero (last (init r)) = None | otherwise = One (solveOne m) where r = last m -- Assuming there is one solution, the last row gives the value of e directly. -- The previous row gives d in terms of e and a constant, so we can substitute -- the know value of e. Continuing up the matrix, we substitute known values in -- each equation to determine the next unknown until we know all values.
538
solve' :: (Fractional a, Ord a) => Matrix a -> Solution a solve' (Matrix m) | all equivZero r = Many | equivZero (last (init r)) = None | otherwise = One (solveOne m) where r = last m -- Assuming there is one solution, the last row gives the value of e directly. -- The previous row gives d in terms of e and a constant, so we can substitute -- the know value of e. Continuing up the matrix, we substitute known values in -- each equation to determine the next unknown until we know all values.
538
solve' (Matrix m) | all equivZero r = Many | equivZero (last (init r)) = None | otherwise = One (solveOne m) where r = last m -- Assuming there is one solution, the last row gives the value of e directly. -- The previous row gives d in terms of e and a constant, so we can substitute -- the know value of e. Continuing up the matrix, we substitute known values in -- each equation to determine the next unknown until we know all values.
480
false
true
0
12
142
112
54
58
null
null
CindyLinz/Haskell.js
trans/src/Desugar/List.hs
mit
deListExp (ExpTypeSig l exp type0) = ExpTypeSig (id l) (deListExp exp) (deListType type0)
89
deListExp (ExpTypeSig l exp type0) = ExpTypeSig (id l) (deListExp exp) (deListType type0)
89
deListExp (ExpTypeSig l exp type0) = ExpTypeSig (id l) (deListExp exp) (deListType type0)
89
false
false
0
7
12
44
21
23
null
null
feliposz/project-euler-solutions
haskell/euler9.hs
mit
euler9' = let (a,b,c) = head (triplets' 1000) in a*b*c
54
euler9' = let (a,b,c) = head (triplets' 1000) in a*b*c
54
euler9' = let (a,b,c) = head (triplets' 1000) in a*b*c
54
false
false
0
11
9
44
22
22
null
null
spinda/liquidhaskell
tests/gsoc15/unknown/pos/anftest.hs
bsd-3-clause
-- xs :: [Int] -- xs = let x0 = 0 -- x1 = 1 -- x2 = 2 -- x3 = 3 -- x4 = 4 -- x5 = 5 -- x6 = 6 -- x7 = 7 -- x8 = 8 -- x9 = 9 -- in [x0, x1, x2, x3, x4, x5, x6, x7, x8, x9] xs :: [Int] xs = let x0 = 0 x1 = 1 in [x0, x1]
318
xs :: [Int] xs = let x0 = 0 x1 = 1 in [x0, x1]
60
xs = let x0 = 0 x1 = 1 in [x0, x1]
48
true
true
0
8
174
55
33
22
null
null
lamdu/lamdu
src/Lamdu/Builtins/Anchors.hs
gpl-3.0
mutTid :: T.NominalId mutTid = bi "ST"
38
mutTid :: T.NominalId mutTid = bi "ST"
38
mutTid = bi "ST"
16
false
true
0
7
6
23
9
14
null
null
printedheart/Dao
src/Dao/Interval.hs
agpl-3.0
---------------------------------------------------------------------------------------------------- _paren :: Show o => o -> String _paren o = let cx = show o in if or (fmap isSpace cx) then "("++cx++")" else cx
213
_paren :: Show o => o -> String _paren o = let cx = show o in if or (fmap isSpace cx) then "("++cx++")" else cx
111
_paren o = let cx = show o in if or (fmap isSpace cx) then "("++cx++")" else cx
79
true
true
0
10
27
73
34
39
null
null
yesodweb/yesod
yesod-form/Yesod/Form/I18n/Chinese.hs
mit
chineseFormMessage (MsgInvalidSecond t) = "无效的秒: " `mappend` t
62
chineseFormMessage (MsgInvalidSecond t) = "无效的秒: " `mappend` t
62
chineseFormMessage (MsgInvalidSecond t) = "无效的秒: " `mappend` t
62
false
false
0
7
7
21
11
10
null
null
expede/TRiiOR
site.hs
mit
postCtx :: Context String postCtx = dateField "date" "%B %e, %Y" `mappend` defaultContext
97
postCtx :: Context String postCtx = dateField "date" "%B %e, %Y" `mappend` defaultContext
97
postCtx = dateField "date" "%B %e, %Y" `mappend` defaultContext
71
false
true
0
6
20
31
14
17
null
null
siddhanathan/yi
yi-keymap-cua/src/Yi/Keymap/Cua.hs
gpl-2.0
other :: (Event -> Event) -> Keymap move = choice [ k ?>>! unsetMark >> a | (k,a) <- moveKeys]
115
other :: (Event -> Event) -> Keymap move = choice [ k ?>>! unsetMark >> a | (k,a) <- moveKeys]
114
move = choice [ k ?>>! unsetMark >> a | (k,a) <- moveKeys]
78
false
true
0
9
40
57
28
29
null
null
VictorDenisov/keystone
src/Common.hs
gpl-2.0
dropOptions size = defaultOptions { fieldLabelModifier = drop size }
68
dropOptions size = defaultOptions { fieldLabelModifier = drop size }
68
dropOptions size = defaultOptions { fieldLabelModifier = drop size }
68
false
false
1
8
9
24
10
14
null
null
dysinger/amazonka
amazonka-lambda/gen/Network/AWS/Lambda/ListFunctions.hs
mpl-2.0
-- | Optional integer. Specifies the maximum number of AWS Lambda functions to -- return in response. This parameter value must be greater than 0. lfMaxItems :: Lens' ListFunctions (Maybe Natural) lfMaxItems = lens _lfMaxItems (\s a -> s { _lfMaxItems = a }) . mapping _Nat
273
lfMaxItems :: Lens' ListFunctions (Maybe Natural) lfMaxItems = lens _lfMaxItems (\s a -> s { _lfMaxItems = a }) . mapping _Nat
126
lfMaxItems = lens _lfMaxItems (\s a -> s { _lfMaxItems = a }) . mapping _Nat
76
true
true
2
9
46
62
29
33
null
null
urbanslug/ghc
testsuite/tests/deSugar/should_run/dsrun011.hs
bsd-3-clause
g1 x = 1 + f8 x
15
g1 x = 1 + f8 x
15
g1 x = 1 + f8 x
15
false
false
0
6
6
16
7
9
null
null
et4te/zero
server/src/Zero/Account/Relations.hs
bsd-3-clause
------------------------------------------------------------------------------ -- Relational Attributes ------------------------------------------------------------------------------ accountAttributes = V.fromList [ Attribute "user_id#" TextAtomType , Attribute "email#" TextAtomType , Attribute "verifier" TextAtomType , Attribute "salt" TextAtomType , Attribute "kA" TextAtomType , Attribute "wrap_kB" TextAtomType ]
433
accountAttributes = V.fromList [ Attribute "user_id#" TextAtomType , Attribute "email#" TextAtomType , Attribute "verifier" TextAtomType , Attribute "salt" TextAtomType , Attribute "kA" TextAtomType , Attribute "wrap_kB" TextAtomType ]
249
accountAttributes = V.fromList [ Attribute "user_id#" TextAtomType , Attribute "email#" TextAtomType , Attribute "verifier" TextAtomType , Attribute "salt" TextAtomType , Attribute "kA" TextAtomType , Attribute "wrap_kB" TextAtomType ]
249
true
false
0
6
47
62
32
30
null
null
rhofour/rlglue-haskell-codec
src/RL_Glue/TaskSpec.hs
apache-2.0
parseIntsBounds :: Parsec BS.ByteString () IntsBounds parseIntsBounds = try (do string "INTS" parseInnerBounds) <|> return []
129
parseIntsBounds :: Parsec BS.ByteString () IntsBounds parseIntsBounds = try (do string "INTS" parseInnerBounds) <|> return []
129
parseIntsBounds = try (do string "INTS" parseInnerBounds) <|> return []
75
false
true
0
10
19
46
21
25
null
null
rzil/honours
LeavittPathAlgebras/Example1.hs
mit
e1 = edge "e"
13
e1 = edge "e"
13
e1 = edge "e"
13
false
false
1
5
3
12
4
8
null
null
aufheben/Y86
Compiler/lab/C/SkelC.hs
mit
transInitializers :: Initializers -> Result transInitializers x = case x of AnInit initializer -> failure x MoreInit initializers initializer -> failure x
158
transInitializers :: Initializers -> Result transInitializers x = case x of AnInit initializer -> failure x MoreInit initializers initializer -> failure x
158
transInitializers x = case x of AnInit initializer -> failure x MoreInit initializers initializer -> failure x
114
false
true
3
5
25
45
22
23
null
null
iansullivan88/site-archiver
src/SiteArchiver/DataStore.hs
mit
createDataStore :: FilePath -> IO DataStore createDataStore dbPath = do conn <- connectSqlite3 dbPath createTables conn return $ DataStore conn
149
createDataStore :: FilePath -> IO DataStore createDataStore dbPath = do conn <- connectSqlite3 dbPath createTables conn return $ DataStore conn
149
createDataStore dbPath = do conn <- connectSqlite3 dbPath createTables conn return $ DataStore conn
105
false
true
0
8
25
47
20
27
null
null
mskmysht/ProjectEuler
src/Problem13.hs
bsd-3-clause
calcdigit c (m:ms) [] = m : calcdigit c ms []
45
calcdigit c (m:ms) [] = m : calcdigit c ms []
45
calcdigit c (m:ms) [] = m : calcdigit c ms []
45
false
false
1
7
10
40
17
23
null
null
kawu/skladnica-with-walenty
src/NLP/Skladnica/Walenty/Search.hs
bsd-2-clause
-- | Set the underlying parent tree to the new one. withParent :: SklTree -> Eval a -> Eval a withParent t = E.withReader $ \_ -> EvalState {parentTree = t}
156
withParent :: SklTree -> Eval a -> Eval a withParent t = E.withReader $ \_ -> EvalState {parentTree = t}
104
withParent t = E.withReader $ \_ -> EvalState {parentTree = t}
62
true
true
0
8
30
48
25
23
null
null
serokell/importify
src/Importify/Syntax/Import.hs
mit
switchHidingImports m = m
25
switchHidingImports m = m
25
switchHidingImports m = m
25
false
false
0
5
3
9
4
5
null
null
brendanhay/gogol
gogol-cloudidentity/gen/Network/Google/Resource/CloudIdentity/Groups/Memberships/Delete.hs
mpl-2.0
-- | V1 error format. gmdXgafv :: Lens' GroupsMembershipsDelete (Maybe Xgafv) gmdXgafv = lens _gmdXgafv (\ s a -> s{_gmdXgafv = a})
131
gmdXgafv :: Lens' GroupsMembershipsDelete (Maybe Xgafv) gmdXgafv = lens _gmdXgafv (\ s a -> s{_gmdXgafv = a})
109
gmdXgafv = lens _gmdXgafv (\ s a -> s{_gmdXgafv = a})
53
true
true
1
9
21
52
25
27
null
null
mariefarrell/Hets
Common/Utils.hs
gpl-2.0
-- | /O(1)/ test if the set's size is greater one hasMany :: Set.Set a -> Bool hasMany s = Set.size s > 1
105
hasMany :: Set.Set a -> Bool hasMany s = Set.size s > 1
55
hasMany s = Set.size s > 1
26
true
true
0
7
23
33
16
17
null
null
nevrenato/HetsAlloy
OWL2/OWL22CommonLogic.hs
gpl-2.0
mapDataPropListP :: Sign -> Int -> Int -> [(DataPropertyExpression, DataPropertyExpression)] -> Result [(SENTENCE, SENTENCE)] mapDataPropListP = mapObjOrDataListP mapDPEList
181
mapDataPropListP :: Sign -> Int -> Int -> [(DataPropertyExpression, DataPropertyExpression)] -> Result [(SENTENCE, SENTENCE)] mapDataPropListP = mapObjOrDataListP mapDPEList
181
mapDataPropListP = mapObjOrDataListP mapDPEList
47
false
true
0
12
25
53
28
25
null
null
bitemyapp/Earley
tests/Tests.hs
bsd-3-clause
lexExpr (c : s) | isSpace c = lexExpr s | otherwise = let (tok, rest) = span p (c : s) in tok : lexExpr rest where p x = not (x == '(' || x == ')' || isSpace x)
200
lexExpr (c : s) | isSpace c = lexExpr s | otherwise = let (tok, rest) = span p (c : s) in tok : lexExpr rest where p x = not (x == '(' || x == ')' || isSpace x)
200
lexExpr (c : s) | isSpace c = lexExpr s | otherwise = let (tok, rest) = span p (c : s) in tok : lexExpr rest where p x = not (x == '(' || x == ')' || isSpace x)
200
false
false
1
11
81
107
51
56
null
null
keithodulaigh/Hets
CASL/Sign.hs
gpl-2.0
rmOrAddPartsMap :: Bool -> OpMap -> OpMap rmOrAddPartsMap b = MapSet.mapSet (rmOrAddParts b)
92
rmOrAddPartsMap :: Bool -> OpMap -> OpMap rmOrAddPartsMap b = MapSet.mapSet (rmOrAddParts b)
92
rmOrAddPartsMap b = MapSet.mapSet (rmOrAddParts b)
50
false
true
0
7
12
33
16
17
null
null