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
coursestitch/coursestitch-api
src/Templates/User.hs
apache-2.0
signupForm :: Html () signupForm = form_ [action_ "/user", method_ post] $ do fieldset_ $ do input "Username" "name" Nothing input "Password" "pass" Nothing input_ [type_ "submit"] where post = decodeUtf8 methodPost
243
signupForm :: Html () signupForm = form_ [action_ "/user", method_ post] $ do fieldset_ $ do input "Username" "name" Nothing input "Password" "pass" Nothing input_ [type_ "submit"] where post = decodeUtf8 methodPost
243
signupForm = form_ [action_ "/user", method_ post] $ do fieldset_ $ do input "Username" "name" Nothing input "Password" "pass" Nothing input_ [type_ "submit"] where post = decodeUtf8 methodPost
221
false
true
0
11
59
85
38
47
null
null
Cahu/krpc-hs
src/KRPCHS/SpaceCenter.hs
gpl-3.0
getOrbitApoapsisStream :: KRPCHS.SpaceCenter.Orbit -> RPCContext (KRPCStream (Double)) getOrbitApoapsisStream thisArg = requestStream $ getOrbitApoapsisStreamReq thisArg
169
getOrbitApoapsisStream :: KRPCHS.SpaceCenter.Orbit -> RPCContext (KRPCStream (Double)) getOrbitApoapsisStream thisArg = requestStream $ getOrbitApoapsisStreamReq thisArg
169
getOrbitApoapsisStream thisArg = requestStream $ getOrbitApoapsisStreamReq thisArg
82
false
true
0
10
13
44
21
23
null
null
abesto/brainfuck-hs
Brainfuck.hs
mit
calcDepth "" _ = []
19
calcDepth "" _ = []
19
calcDepth "" _ = []
19
false
false
0
5
4
13
6
7
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F10.hs
bsd-3-clause
ptr_glGetFloati_vNV :: FunPtr (GLenum -> GLuint -> Ptr GLfloat -> IO ()) ptr_glGetFloati_vNV = unsafePerformIO $ getCommand "glGetFloati_vNV"
141
ptr_glGetFloati_vNV :: FunPtr (GLenum -> GLuint -> Ptr GLfloat -> IO ()) ptr_glGetFloati_vNV = unsafePerformIO $ getCommand "glGetFloati_vNV"
141
ptr_glGetFloati_vNV = unsafePerformIO $ getCommand "glGetFloati_vNV"
68
false
true
0
11
17
44
21
23
null
null
beni55/ghcjs
src/Gen2/Profiling.hs
mit
-- top-level function, nothing to do enterCostCentreThunk :: JStat enterCostCentreThunk = [j| h$enterThunkCCS(`R1`.cc); |]
123
enterCostCentreThunk :: JStat enterCostCentreThunk = [j| h$enterThunkCCS(`R1`.cc); |]
85
enterCostCentreThunk = [j| h$enterThunkCCS(`R1`.cc); |]
55
true
true
0
4
14
16
11
5
null
null
bartoszw/haslo
Haslo/symulProbabl.hs
bsd-3-clause
mapF [] _ = []
14
mapF [] _ = []
14
mapF [] _ = []
14
false
false
0
5
4
17
7
10
null
null
NKMR6194/carrot
src/Parse.hs
mit
parseExpression vs | not $ ravl == [] = case x of AddOpToken -> AddNode (parseExpression avl) $ parseTerm avr SubOpToken -> SubNode (parseExpression avl) $ parseTerm avr EqOpToken -> EqNode (parseExpression avl) $ parseTerm avr | otherwise = parseTerm vs where (ravr, ravl) = break (\x -> AddOpToken == x || SubOpToken == x || EqOpToken == x) $ reverse vs x:nravl = ravl avl = reverse nravl avr = reverse ravr
507
parseExpression vs | not $ ravl == [] = case x of AddOpToken -> AddNode (parseExpression avl) $ parseTerm avr SubOpToken -> SubNode (parseExpression avl) $ parseTerm avr EqOpToken -> EqNode (parseExpression avl) $ parseTerm avr | otherwise = parseTerm vs where (ravr, ravl) = break (\x -> AddOpToken == x || SubOpToken == x || EqOpToken == x) $ reverse vs x:nravl = ravl avl = reverse nravl avr = reverse ravr
507
parseExpression vs | not $ ravl == [] = case x of AddOpToken -> AddNode (parseExpression avl) $ parseTerm avr SubOpToken -> SubNode (parseExpression avl) $ parseTerm avr EqOpToken -> EqNode (parseExpression avl) $ parseTerm avr | otherwise = parseTerm vs where (ravr, ravl) = break (\x -> AddOpToken == x || SubOpToken == x || EqOpToken == x) $ reverse vs x:nravl = ravl avl = reverse nravl avr = reverse ravr
507
false
false
4
14
170
184
88
96
null
null
holmerr/Presidents
src/Main.hs
gpl-2.0
productFromID :: Int -> Product productFromID n = toEnum (n-1)
62
productFromID :: Int -> Product productFromID n = toEnum (n-1)
62
productFromID n = toEnum (n-1)
30
false
true
0
7
9
28
14
14
null
null
mathhun/stack
src/Stack/Types/Docker.hs
bsd-3-clause
-- | Docker auto-pull argument name. dockerAutoPullArgName :: Text dockerAutoPullArgName = "auto-pull"
102
dockerAutoPullArgName :: Text dockerAutoPullArgName = "auto-pull"
65
dockerAutoPullArgName = "auto-pull"
35
true
true
0
4
11
12
7
5
null
null
kmcallister/shqq
System/ShQQ.hs
bsd-3-clause
parseToks :: Parser [Tok] parseToks = many part where isIdent '_' = True isIdent x = isAlphaNum x -- NB: '\'' excluded ident = some (satisfy isIdent) var = VarOne <$> ident <|> VarMany <$ char '+' <*> ident part = asum [ char '\\' *> ( Lit "\\" <$ char '\\' <|> Lit "$" <$ char '$' ) , char '$' *> ( var <|> between (char '{') (char '}') var ) , Lit <$> some (noneOf "$\\") ] -- | Execute a shell command, capturing output and exit code. -- -- Used in the implementation of @'shc'@.
579
parseToks :: Parser [Tok] parseToks = many part where isIdent '_' = True isIdent x = isAlphaNum x -- NB: '\'' excluded ident = some (satisfy isIdent) var = VarOne <$> ident <|> VarMany <$ char '+' <*> ident part = asum [ char '\\' *> ( Lit "\\" <$ char '\\' <|> Lit "$" <$ char '$' ) , char '$' *> ( var <|> between (char '{') (char '}') var ) , Lit <$> some (noneOf "$\\") ] -- | Execute a shell command, capturing output and exit code. -- -- Used in the implementation of @'shc'@.
579
parseToks = many part where isIdent '_' = True isIdent x = isAlphaNum x -- NB: '\'' excluded ident = some (satisfy isIdent) var = VarOne <$> ident <|> VarMany <$ char '+' <*> ident part = asum [ char '\\' *> ( Lit "\\" <$ char '\\' <|> Lit "$" <$ char '$' ) , char '$' *> ( var <|> between (char '{') (char '}') var ) , Lit <$> some (noneOf "$\\") ] -- | Execute a shell command, capturing output and exit code. -- -- Used in the implementation of @'shc'@.
553
false
true
11
12
195
203
93
110
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcType.hs
bsd-3-clause
tcTyFamInsts (LitTy {}) = []
36
tcTyFamInsts (LitTy {}) = []
36
tcTyFamInsts (LitTy {}) = []
36
false
false
0
7
12
18
9
9
null
null
vikraman/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
cmpEqTick (RuleFired a) (RuleFired b) = a `compare` b
87
cmpEqTick (RuleFired a) (RuleFired b) = a `compare` b
87
cmpEqTick (RuleFired a) (RuleFired b) = a `compare` b
87
false
false
1
8
42
33
15
18
null
null
paulkeene/FP101x
chapter03/Exercises.hs
bsd-3-clause
-- Exercise 8 -- funct :: Int -> [a] -> [a] funct x xs = take (x + 1) xs ++ drop x xs
86
funct :: Int -> [a] -> [a] funct x xs = take (x + 1) xs ++ drop x xs
68
funct x xs = take (x + 1) xs ++ drop x xs
41
true
true
0
8
24
52
27
25
null
null
GaloisInc/halvm-ghc
compiler/deSugar/DsBinds.hs
bsd-3-clause
dsEvTerm (EvCoercion co) = return (Coercion co)
47
dsEvTerm (EvCoercion co) = return (Coercion co)
47
dsEvTerm (EvCoercion co) = return (Coercion co)
47
false
false
0
7
6
24
11
13
null
null
mbakke/ganeti
src/Ganeti/ConstantUtils.hs
bsd-2-clause
toList :: FrozenSet a -> [a] toList = Set.toList . unFrozenSet
62
toList :: FrozenSet a -> [a] toList = Set.toList . unFrozenSet
62
toList = Set.toList . unFrozenSet
33
false
true
0
8
10
34
15
19
null
null
CompSciCabal/SMRTYPRTY
sicp/v1/chapter-2.2/inaimathi.hs
unlicense
totalWeight :: Structure -> Float totalWeight (SubMobile s) = branchWeight l + branchWeight r where l = left s r = right s
132
totalWeight :: Structure -> Float totalWeight (SubMobile s) = branchWeight l + branchWeight r where l = left s r = right s
132
totalWeight (SubMobile s) = branchWeight l + branchWeight r where l = left s r = right s
98
false
true
0
7
32
53
25
28
null
null
brendanhay/gogol
gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs
mpl-2.0
-- | The HL7v2 type definitions. htcType :: Lens' Hl7TypesConfig [Type] htcType = lens _htcType (\ s a -> s{_htcType = a}) . _Default . _Coerce
151
htcType :: Lens' Hl7TypesConfig [Type] htcType = lens _htcType (\ s a -> s{_htcType = a}) . _Default . _Coerce
118
htcType = lens _htcType (\ s a -> s{_htcType = a}) . _Default . _Coerce
79
true
true
2
8
33
60
29
31
null
null
facebookincubator/duckling
Duckling/Time/NB/Rules.hs
bsd-3-clause
ruleChristmas :: Rule ruleChristmas = Rule { name = "christmas" , pattern = [ regex "((1\\.?)|første)? ?juledag" ] , prod = \_ -> tt $ monthDay 12 25 }
167
ruleChristmas :: Rule ruleChristmas = Rule { name = "christmas" , pattern = [ regex "((1\\.?)|første)? ?juledag" ] , prod = \_ -> tt $ monthDay 12 25 }
167
ruleChristmas = Rule { name = "christmas" , pattern = [ regex "((1\\.?)|første)? ?juledag" ] , prod = \_ -> tt $ monthDay 12 25 }
145
false
true
0
10
44
55
30
25
null
null
Tener/deeplearning-thesis
lib/BreakthroughGame.hs
bsd-3-clause
-- | get all positions within a specified column. column :: Int -> Int -> [Position] column colNum colLength = [(colNum,row') | row' <- [0..colLength-1]]
154
column :: Int -> Int -> [Position] column colNum colLength = [(colNum,row') | row' <- [0..colLength-1]]
103
column colNum colLength = [(colNum,row') | row' <- [0..colLength-1]]
68
true
true
0
9
25
54
30
24
null
null
jwiegley/simple-conduit
Conduit/Simple.hs
mit
decodeBase64C :: Monad m => Conduit ByteString m ByteString decodeBase64C = undefined
85
decodeBase64C :: Monad m => Conduit ByteString m ByteString decodeBase64C = undefined
85
decodeBase64C = undefined
25
false
true
0
6
11
25
12
13
null
null
bgamari/linear
src/Linear/Matrix.hs
bsd-3-clause
-- |2x2 matrix inverse. -- -- >>> inv22 $ V2 (V2 1 2) (V2 3 4) -- V2 (V2 (-2.0) 1.0) (V2 1.5 (-0.5)) inv22 :: Floating a => M22 a -> M22 a inv22 m@(V2 (V2 a b) (V2 c d)) = (1 / det) *!! V2 (V2 d (-b)) (V2 (-c) a) where det = det22 m
235
inv22 :: Floating a => M22 a -> M22 a inv22 m@(V2 (V2 a b) (V2 c d)) = (1 / det) *!! V2 (V2 d (-b)) (V2 (-c) a) where det = det22 m
134
inv22 m@(V2 (V2 a b) (V2 c d)) = (1 / det) *!! V2 (V2 d (-b)) (V2 (-c) a) where det = det22 m
96
true
true
0
10
61
115
59
56
null
null
akermu/akermu-xmonad
src/XMonad/Prompt/VpnPrompt.hs
gpl-3.0
stopVpn :: String -> X () stopVpn s = if s `elem` ["y", "yes"] then liftIO $ do vpn <- getRunningVpn case vpn of Just s -> spawn $ "sudo systemctl stop openvpn-client@" ++ s ++ ".service" else spawn "notify-send -u critical Not found"
312
stopVpn :: String -> X () stopVpn s = if s `elem` ["y", "yes"] then liftIO $ do vpn <- getRunningVpn case vpn of Just s -> spawn $ "sudo systemctl stop openvpn-client@" ++ s ++ ".service" else spawn "notify-send -u critical Not found"
312
stopVpn s = if s `elem` ["y", "yes"] then liftIO $ do vpn <- getRunningVpn case vpn of Just s -> spawn $ "sudo systemctl stop openvpn-client@" ++ s ++ ".service" else spawn "notify-send -u critical Not found"
286
false
true
0
14
121
86
43
43
null
null
julienschmaltz/madl
src/Parser/ASTTranslator.hs
mit
evaluatePredicateExpression :: Context -> PredicateExpression -> Types.MFunctionBool evaluatePredicateExpression context expression = case expression of PredicateVariable name -> fromMaybe err $ Hash.lookup name (contextPredicates context) where err = fatal 1138 $ "Predicatename " +++ name +++ " was not found in context" -- | Given a context, return the predicate represented by a name
400
evaluatePredicateExpression :: Context -> PredicateExpression -> Types.MFunctionBool evaluatePredicateExpression context expression = case expression of PredicateVariable name -> fromMaybe err $ Hash.lookup name (contextPredicates context) where err = fatal 1138 $ "Predicatename " +++ name +++ " was not found in context" -- | Given a context, return the predicate represented by a name
400
evaluatePredicateExpression context expression = case expression of PredicateVariable name -> fromMaybe err $ Hash.lookup name (contextPredicates context) where err = fatal 1138 $ "Predicatename " +++ name +++ " was not found in context" -- | Given a context, return the predicate represented by a name
315
false
true
2
10
65
86
41
45
null
null
mavenraven/chronic-haskell
tests/TestSuite.hs
bsd-3-clause
testHandleRmnOdSy :: Test testHandleRmnOdSy = testGroup "test_handle_rmn_od_sy" [ exactComparisonCase "1" (actualTime (timeLiteral (fmt "%F %T") "2001-05-01 12:00:00")) (testTime "may 1st 01") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "2" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "3" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th, 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "4" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "5" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 at midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "6" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 16:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "7" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 04:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) , exactComparisonCase "8" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th, 1979") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "9" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th 79") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "10" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 16:30:00")) (testTime "March 30th 79 4:30") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "11" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 04:30:00")) (testTime "March 30th 79 at 4:30") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) ]
2,446
testHandleRmnOdSy :: Test testHandleRmnOdSy = testGroup "test_handle_rmn_od_sy" [ exactComparisonCase "1" (actualTime (timeLiteral (fmt "%F %T") "2001-05-01 12:00:00")) (testTime "may 1st 01") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "2" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "3" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th, 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "4" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "5" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 at midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "6" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 16:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "7" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 04:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) , exactComparisonCase "8" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th, 1979") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "9" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th 79") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "10" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 16:30:00")) (testTime "March 30th 79 4:30") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "11" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 04:30:00")) (testTime "March 30th 79 at 4:30") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) ]
2,446
testHandleRmnOdSy = testGroup "test_handle_rmn_od_sy" [ exactComparisonCase "1" (actualTime (timeLiteral (fmt "%F %T") "2001-05-01 12:00:00")) (testTime "may 1st 01") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "2" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "3" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 12:00:00")) (testTime "November 18th, 2010") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "4" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "5" (actualTime (timeLiteral (fmt "%F %T") "2010-11-19 00:00:00")) (testTime "November 18th 2010 at midnight") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "6" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 16:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "7" (actualTime (timeLiteral (fmt "%F %T") "2010-11-18 04:00:00")) (testTime "November 18th 2010 at 4") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) , exactComparisonCase "8" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th, 1979") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "9" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 12:00:00")) (testTime "March 30th 79") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "10" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 16:30:00")) (testTime "March 30th 79 4:30") (currentTime chronicNowTime) (parserOptions []) , exactComparisonCase "11" (actualTime (timeLiteral (fmt "%F %T") "1979-03-30 04:30:00")) (testTime "March 30th 79 at 4:30") (currentTime chronicNowTime) (parserOptions [ambiguousTimeRange Nothing]) ]
2,420
false
true
0
12
649
619
309
310
null
null
vrom911/Compiler
src/Compiler/Rum/Internal/ToString.hs
mit
stmtToStr n AssignmentArr{..} = tab n <> arrCellToStr arrC <> " := " <> exprToStr value
88
stmtToStr n AssignmentArr{..} = tab n <> arrCellToStr arrC <> " := " <> exprToStr value
88
stmtToStr n AssignmentArr{..} = tab n <> arrCellToStr arrC <> " := " <> exprToStr value
88
false
false
0
8
16
40
17
23
null
null
pparkkin/eta
compiler/ETA/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 -- PE emptyVarEnv emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
482
initOccEnv :: (Activation -> Bool) -> OccEnv initOccEnv active_rule = OccEnv { occ_encl = OccVanilla , occ_one_shots = [] , occ_gbl_scrut = emptyVarSet -- PE emptyVarEnv emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
290
initOccEnv active_rule = OccEnv { occ_encl = OccVanilla , occ_one_shots = [] , occ_gbl_scrut = emptyVarSet -- PE emptyVarEnv emptyVarSet , occ_rule_act = active_rule , occ_binder_swap = True }
245
true
true
0
7
168
64
40
24
null
null
jaspervdj/what-morphism
src/WhatMorphism/Inliner.hs
bsd-3-clause
-------------------------------------------------------------------------------- setNeedsInlining :: Var -> Expr Var -> InlinerState -> IO () setNeedsInlining v e (InlinerState ref) = modifyIORef ref $ Outputable.pprTrace "var" (Outputable.ppr v) $ Outputable.pprTrace "expr" (Outputable.ppr $ inlinerExpr tpl) $ Outputable.pprTrace "args" (Outputable.ppr $ inlinerArgs tpl) $ Outputable.pprTrace "arity" (Outputable.ppr $ inlinerArity tpl) $ M.insert v tpl where tpl = mkInlinerTemplate e --------------------------------------------------------------------------------
598
setNeedsInlining :: Var -> Expr Var -> InlinerState -> IO () setNeedsInlining v e (InlinerState ref) = modifyIORef ref $ Outputable.pprTrace "var" (Outputable.ppr v) $ Outputable.pprTrace "expr" (Outputable.ppr $ inlinerExpr tpl) $ Outputable.pprTrace "args" (Outputable.ppr $ inlinerArgs tpl) $ Outputable.pprTrace "arity" (Outputable.ppr $ inlinerArity tpl) $ M.insert v tpl where tpl = mkInlinerTemplate e --------------------------------------------------------------------------------
517
setNeedsInlining v e (InlinerState ref) = modifyIORef ref $ Outputable.pprTrace "var" (Outputable.ppr v) $ Outputable.pprTrace "expr" (Outputable.ppr $ inlinerExpr tpl) $ Outputable.pprTrace "args" (Outputable.ppr $ inlinerArgs tpl) $ Outputable.pprTrace "arity" (Outputable.ppr $ inlinerArity tpl) $ M.insert v tpl where tpl = mkInlinerTemplate e --------------------------------------------------------------------------------
456
true
true
0
13
83
159
76
83
null
null
mrkkrp/stack
src/Stack/Build/Execute.hs
bsd-3-clause
windowsRenameCopy :: FilePath -> FilePath -> IO () windowsRenameCopy src dest = do D.copyFile src new D.renameFile dest old D.renameFile new dest where new = dest ++ ".new" old = dest ++ ".old" -- | Perform the actual plan (internal)
256
windowsRenameCopy :: FilePath -> FilePath -> IO () windowsRenameCopy src dest = do D.copyFile src new D.renameFile dest old D.renameFile new dest where new = dest ++ ".new" old = dest ++ ".old" -- | Perform the actual plan (internal)
256
windowsRenameCopy src dest = do D.copyFile src new D.renameFile dest old D.renameFile new dest where new = dest ++ ".new" old = dest ++ ".old" -- | Perform the actual plan (internal)
205
false
true
0
8
62
81
38
43
null
null
SaneApp/hedis-simple
src/Database/Redis/Simple.hs
mit
rename :: (R.RedisCtx mi r, WrappedRedis m mi r) => ByteString -> ByteString -> m R.Status rename k = wrap . R.rename k
119
rename :: (R.RedisCtx mi r, WrappedRedis m mi r) => ByteString -> ByteString -> m R.Status rename k = wrap . R.rename k
119
rename k = wrap . R.rename k
28
false
true
0
9
22
59
29
30
null
null
rahulmutt/ghcvm
compiler/Eta/StrAnal/WorkWrap.hs
bsd-3-clause
wwExpr _ _ e@(Coercion {}) = return e
42
wwExpr _ _ e@(Coercion {}) = return e
42
wwExpr _ _ e@(Coercion {}) = return e
42
false
false
1
7
12
26
12
14
null
null
capitanbatata/functional-systems-in-haskell
fsh-exercises/src/Testing.hs
mit
decodeUtf16 [lead, trail] = [chr $ ((leadI `shiftL` 10) + trailI + surrogateOffset)] where leadI = fromIntegral lead trailI = fromIntegral trail surrogateOffset = 0x10000 - (0xD800 `shiftL` 10) - 0xDC00
218
decodeUtf16 [lead, trail] = [chr $ ((leadI `shiftL` 10) + trailI + surrogateOffset)] where leadI = fromIntegral lead trailI = fromIntegral trail surrogateOffset = 0x10000 - (0xD800 `shiftL` 10) - 0xDC00
218
decodeUtf16 [lead, trail] = [chr $ ((leadI `shiftL` 10) + trailI + surrogateOffset)] where leadI = fromIntegral lead trailI = fromIntegral trail surrogateOffset = 0x10000 - (0xD800 `shiftL` 10) - 0xDC00
218
false
false
2
11
46
85
46
39
null
null
nevrenato/Hets_Fork
Common/Token.hs
gpl-2.0
mixId :: ([String], [String]) -> ([String], [String]) -> GenParser Char st Id mixId keys idKeys = do l <- start keys if isPlace (last l) then return (Id l [] nullRange) else do (c, p) <- option ([], nullRange) (comps idKeys) u <- many placeT return (Id (l ++ u) c p) -- | the Casl key strings (signs first) with additional keywords
348
mixId :: ([String], [String]) -> ([String], [String]) -> GenParser Char st Id mixId keys idKeys = do l <- start keys if isPlace (last l) then return (Id l [] nullRange) else do (c, p) <- option ([], nullRange) (comps idKeys) u <- many placeT return (Id (l ++ u) c p) -- | the Casl key strings (signs first) with additional keywords
348
mixId keys idKeys = do l <- start keys if isPlace (last l) then return (Id l [] nullRange) else do (c, p) <- option ([], nullRange) (comps idKeys) u <- many placeT return (Id (l ++ u) c p) -- | the Casl key strings (signs first) with additional keywords
270
false
true
0
15
79
171
86
85
null
null
Heather/Idris-dev
src/Idris/Core/ProofTerm.hs
bsd-3-clause
bound_in_term :: Term -> [Name] bound_in_term (Bind n b sc) = n : bi b ++ bound_in_term sc where bi (Let t v) = bound_in_term t ++ bound_in_term v bi (Guess t v) = bound_in_term t ++ bound_in_term v bi b = bound_in_term (binderTy b)
246
bound_in_term :: Term -> [Name] bound_in_term (Bind n b sc) = n : bi b ++ bound_in_term sc where bi (Let t v) = bound_in_term t ++ bound_in_term v bi (Guess t v) = bound_in_term t ++ bound_in_term v bi b = bound_in_term (binderTy b)
246
bound_in_term (Bind n b sc) = n : bi b ++ bound_in_term sc where bi (Let t v) = bound_in_term t ++ bound_in_term v bi (Guess t v) = bound_in_term t ++ bound_in_term v bi b = bound_in_term (binderTy b)
214
false
true
2
9
58
114
55
59
null
null
martin-kolinek/some-board-game
src/Player/Building/Dom.hs
mit
isPlantingPossible :: Applicative f => f BuildingStatus -> f BarnBuildingStatus -> f Bool isPlantingPossible building barnBuilding = (&&) <$> ((== IsNotBuilding) <$> building) <*> ((== IsNotBuildingBarn) <$> barnBuilding)
221
isPlantingPossible :: Applicative f => f BuildingStatus -> f BarnBuildingStatus -> f Bool isPlantingPossible building barnBuilding = (&&) <$> ((== IsNotBuilding) <$> building) <*> ((== IsNotBuildingBarn) <$> barnBuilding)
221
isPlantingPossible building barnBuilding = (&&) <$> ((== IsNotBuilding) <$> building) <*> ((== IsNotBuildingBarn) <$> barnBuilding)
131
false
true
0
9
27
72
38
34
null
null
aniketd/learn.haskell
RWH/4_and_before/proto.hs
unlicense
fixLines :: String -> String fixLines input = unlines $ splitLines input
72
fixLines :: String -> String fixLines input = unlines $ splitLines input
72
fixLines input = unlines $ splitLines input
43
false
true
0
6
11
25
12
13
null
null
jvilar/hrows
src/Cols.hs
gpl-2.0
options :: [OptDescr (Options -> Options)] options = processOptions $ do '0' ~: "iNoHeader" ==> NoArg (setHeader iOptions NoHeader . setHeader oOptions NoHeader) ~: "Do not use header in the input." 'O' ~: "oNoHeader" ==> NoArg (setHeader oOptions NoHeader) ~: "Do not use header in the output. Must be used after -0 if both are present." '1' ~: "iHeader1" ==> NoArg (setHeader iOptions FirstLine . setHeader oOptions FirstLine) ~: "Use the first line as header in the input." 'H' ~: "oHeader1" ==> NoArg (setHeader oOptions FirstLine) ~: "Use the first line as header in the output" 'c' ~: "cols" ==> ReqArg setCols "COLS" ~: "Column specification. A list of expressions separated by commas in the format of the formulas of hrows. Also, a range can be specified by two column names or positions separated by a colon and surrounded by square brackes like [$1:$4] or [Name:Surname]." 'f' ~: "filter" ==> ReqArg setFilter "FILTER" ~: "An integer expression that will be used to filter the rows. Those for which the result is greater than 0" 'h' ~: "help" ==> NoArg (set help True) ~: "This help." 's' ~: "separator" ==> ReqArg (\s -> let c = parseSeparator s in setSeparator iOptions c . setSeparator oOptions c) "CHAR" ~: ("Field separator for the input and output. (Default: " ++ show (ltSeparator $ defOpts ^. iOptions) ++ ").") 'S' ~: "oSeparator" ==> ReqArg (setSeparator oOptions . parseSeparator) "CHAR" ~: "Field separator for the output. (Default: same as -s). Must appear after -s when both are present."
1,695
options :: [OptDescr (Options -> Options)] options = processOptions $ do '0' ~: "iNoHeader" ==> NoArg (setHeader iOptions NoHeader . setHeader oOptions NoHeader) ~: "Do not use header in the input." 'O' ~: "oNoHeader" ==> NoArg (setHeader oOptions NoHeader) ~: "Do not use header in the output. Must be used after -0 if both are present." '1' ~: "iHeader1" ==> NoArg (setHeader iOptions FirstLine . setHeader oOptions FirstLine) ~: "Use the first line as header in the input." 'H' ~: "oHeader1" ==> NoArg (setHeader oOptions FirstLine) ~: "Use the first line as header in the output" 'c' ~: "cols" ==> ReqArg setCols "COLS" ~: "Column specification. A list of expressions separated by commas in the format of the formulas of hrows. Also, a range can be specified by two column names or positions separated by a colon and surrounded by square brackes like [$1:$4] or [Name:Surname]." 'f' ~: "filter" ==> ReqArg setFilter "FILTER" ~: "An integer expression that will be used to filter the rows. Those for which the result is greater than 0" 'h' ~: "help" ==> NoArg (set help True) ~: "This help." 's' ~: "separator" ==> ReqArg (\s -> let c = parseSeparator s in setSeparator iOptions c . setSeparator oOptions c) "CHAR" ~: ("Field separator for the input and output. (Default: " ++ show (ltSeparator $ defOpts ^. iOptions) ++ ").") 'S' ~: "oSeparator" ==> ReqArg (setSeparator oOptions . parseSeparator) "CHAR" ~: "Field separator for the output. (Default: same as -s). Must appear after -s when both are present."
1,695
options = processOptions $ do '0' ~: "iNoHeader" ==> NoArg (setHeader iOptions NoHeader . setHeader oOptions NoHeader) ~: "Do not use header in the input." 'O' ~: "oNoHeader" ==> NoArg (setHeader oOptions NoHeader) ~: "Do not use header in the output. Must be used after -0 if both are present." '1' ~: "iHeader1" ==> NoArg (setHeader iOptions FirstLine . setHeader oOptions FirstLine) ~: "Use the first line as header in the input." 'H' ~: "oHeader1" ==> NoArg (setHeader oOptions FirstLine) ~: "Use the first line as header in the output" 'c' ~: "cols" ==> ReqArg setCols "COLS" ~: "Column specification. A list of expressions separated by commas in the format of the formulas of hrows. Also, a range can be specified by two column names or positions separated by a colon and surrounded by square brackes like [$1:$4] or [Name:Surname]." 'f' ~: "filter" ==> ReqArg setFilter "FILTER" ~: "An integer expression that will be used to filter the rows. Those for which the result is greater than 0" 'h' ~: "help" ==> NoArg (set help True) ~: "This help." 's' ~: "separator" ==> ReqArg (\s -> let c = parseSeparator s in setSeparator iOptions c . setSeparator oOptions c) "CHAR" ~: ("Field separator for the input and output. (Default: " ++ show (ltSeparator $ defOpts ^. iOptions) ++ ").") 'S' ~: "oSeparator" ==> ReqArg (setSeparator oOptions . parseSeparator) "CHAR" ~: "Field separator for the output. (Default: same as -s). Must appear after -s when both are present."
1,652
false
true
0
20
435
327
154
173
null
null
uduki/hsQt
Qtc/Gui/QStyleOptionTitleBar.hs
bsd-2-clause
titleBarState :: QStyleOptionTitleBar a -> (()) -> IO (Int) titleBarState x0 () = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionTitleBar_titleBarState cobj_x0
185
titleBarState :: QStyleOptionTitleBar a -> (()) -> IO (Int) titleBarState x0 () = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionTitleBar_titleBarState cobj_x0
185
titleBarState x0 () = withIntResult $ withObjectPtr x0 $ \cobj_x0 -> qtc_QStyleOptionTitleBar_titleBarState cobj_x0
125
false
true
0
8
31
59
29
30
null
null
muspellsson/hiccup
Internal/Util.hs
lgpl-2.1
registerWatcher cb = modify (\t -> t { tclCmdWatchers = cb:(tclCmdWatchers t) })
80
registerWatcher cb = modify (\t -> t { tclCmdWatchers = cb:(tclCmdWatchers t) })
80
registerWatcher cb = modify (\t -> t { tclCmdWatchers = cb:(tclCmdWatchers t) })
80
false
false
0
12
12
38
20
18
null
null
dino-r/casttex
src/Main.hs
mit
multiWrite :: [String] -> [String] -> IO () multiWrite [] _ = return ()
71
multiWrite :: [String] -> [String] -> IO () multiWrite [] _ = return ()
71
multiWrite [] _ = return ()
27
false
true
0
8
13
42
21
21
null
null
nickbart1980/pandoc
src/Text/Pandoc/Pretty.hs
gpl-2.0
-- | Same as 'cat', but putting breakable spaces between the -- 'Doc's. hsep :: [Doc] -> Doc hsep = foldr (<+>) empty
117
hsep :: [Doc] -> Doc hsep = foldr (<+>) empty
45
hsep = foldr (<+>) empty
24
true
true
0
7
22
33
17
16
null
null
jstolarek/ghc
compiler/main/DynFlags.hs
bsd-3-clause
-- All dynamic flags, minus package flags, present in GHC. flagsDynamic :: [Flag (CmdLineP DynFlags)] flagsDynamic = dynamic_flags
130
flagsDynamic :: [Flag (CmdLineP DynFlags)] flagsDynamic = dynamic_flags
71
flagsDynamic = dynamic_flags
28
true
true
0
8
17
24
13
11
null
null
kaliumxyz/learnings
haskell/baby.hs
mit
cylinder :: ( RealFloat a) => a -> a -> a cylinder r h = let sideArea = 2 * pi * r * h topArea = pi * r ^ 2 in sideArea + 2 * topArea
145
cylinder :: ( RealFloat a) => a -> a -> a cylinder r h = let sideArea = 2 * pi * r * h topArea = pi * r ^ 2 in sideArea + 2 * topArea
144
cylinder r h = let sideArea = 2 * pi * r * h topArea = pi * r ^ 2 in sideArea + 2 * topArea
101
false
true
3
11
49
85
40
45
null
null
apyrgio/snf-ganeti
src/Ganeti/HTools/Backend/Text.hs
bsd-2-clause
loadInst :: NameAssoc -- ^ Association list with the current nodes -> [String] -- ^ Input data as a list of fields -> Result (String, Instance.Instance) -- ^ A tuple of -- instance name and -- the instance object loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode , dt, tags, su, spindles ] = do pidx <- lookupNode ktn name pnode sidx <- if null snode then return Node.noSecondary else lookupNode ktn name snode vmem <- tryRead name mem dsize <- tryRead name dsk vvcpus <- tryRead name vcpus vstatus <- instanceStatusFromRaw status auto_balance <- case auto_bal of "Y" -> return True "N" -> return False _ -> fail $ "Invalid auto_balance value '" ++ auto_bal ++ "' for instance " ++ name disk_template <- annotateResult ("Instance " ++ name) (diskTemplateFromRaw dt) spindle_use <- tryRead name su vspindles <- case spindles of "-" -> return Nothing _ -> liftM Just (tryRead name spindles) let disk = Instance.Disk dsize vspindles let vtags = commaSplit tags newinst = Instance.create name vmem dsize [disk] vvcpus vstatus vtags auto_balance pidx sidx disk_template spindle_use [] when (Instance.hasSecondary newinst && sidx == pidx) . fail $ "Instance " ++ name ++ " has same primary and secondary node - " ++ pnode return (name, newinst)
1,599
loadInst :: NameAssoc -- ^ Association list with the current nodes -> [String] -- ^ Input data as a list of fields -> Result (String, Instance.Instance) loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode , dt, tags, su, spindles ] = do pidx <- lookupNode ktn name pnode sidx <- if null snode then return Node.noSecondary else lookupNode ktn name snode vmem <- tryRead name mem dsize <- tryRead name dsk vvcpus <- tryRead name vcpus vstatus <- instanceStatusFromRaw status auto_balance <- case auto_bal of "Y" -> return True "N" -> return False _ -> fail $ "Invalid auto_balance value '" ++ auto_bal ++ "' for instance " ++ name disk_template <- annotateResult ("Instance " ++ name) (diskTemplateFromRaw dt) spindle_use <- tryRead name su vspindles <- case spindles of "-" -> return Nothing _ -> liftM Just (tryRead name spindles) let disk = Instance.Disk dsize vspindles let vtags = commaSplit tags newinst = Instance.create name vmem dsize [disk] vvcpus vstatus vtags auto_balance pidx sidx disk_template spindle_use [] when (Instance.hasSecondary newinst && sidx == pidx) . fail $ "Instance " ++ name ++ " has same primary and secondary node - " ++ pnode return (name, newinst)
1,445
loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode , dt, tags, su, spindles ] = do pidx <- lookupNode ktn name pnode sidx <- if null snode then return Node.noSecondary else lookupNode ktn name snode vmem <- tryRead name mem dsize <- tryRead name dsk vvcpus <- tryRead name vcpus vstatus <- instanceStatusFromRaw status auto_balance <- case auto_bal of "Y" -> return True "N" -> return False _ -> fail $ "Invalid auto_balance value '" ++ auto_bal ++ "' for instance " ++ name disk_template <- annotateResult ("Instance " ++ name) (diskTemplateFromRaw dt) spindle_use <- tryRead name su vspindles <- case spindles of "-" -> return Nothing _ -> liftM Just (tryRead name spindles) let disk = Instance.Disk dsize vspindles let vtags = commaSplit tags newinst = Instance.create name vmem dsize [disk] vvcpus vstatus vtags auto_balance pidx sidx disk_template spindle_use [] when (Instance.hasSecondary newinst && sidx == pidx) . fail $ "Instance " ++ name ++ " has same primary and secondary node - " ++ pnode return (name, newinst)
1,273
true
true
0
18
553
422
206
216
null
null
cpettitt/tamien
Tamien/HeapTest.hs
mit
prop_allocLookup :: String -> Bool prop_allocLookup x = let (k, h) = alloc x empty in lookup k h == x
111
prop_allocLookup :: String -> Bool prop_allocLookup x = let (k, h) = alloc x empty in lookup k h == x
111
prop_allocLookup x = let (k, h) = alloc x empty in lookup k h == x
76
false
true
1
9
30
60
26
34
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/monad-param/Diagnostics.hs
bsd-3-clause
-- | Checks if warning message. dmIsWng :: DMsg -> Bool dmIsWng (DMsg {dmLvl = DMLWng}) = True
94
dmIsWng :: DMsg -> Bool dmIsWng (DMsg {dmLvl = DMLWng}) = True
62
dmIsWng (DMsg {dmLvl = DMLWng}) = True
38
true
true
3
7
17
38
18
20
null
null
FranklinChen/Hugs
tests/rts/enum.hs
bsd-3-clause
-- should fail -- Tests for built in Enum instances test20 = show $ takeWhile isLatin1 $ ['a' ..]
99
test20 = show $ takeWhile isLatin1 $ ['a' ..]
45
test20 = show $ takeWhile isLatin1 $ ['a' ..]
45
true
false
0
7
20
23
13
10
null
null
josefs/autosar
oldARSim/ARComp.hs
bsd-3-clause
rte_irvRead :: (Typable a, Valuable a) => IV c a -> RunM (StdRet a) rte_irvRead iv = liftCode (IrvRead iv)
110
rte_irvRead :: (Typable a, Valuable a) => IV c a -> RunM (StdRet a) rte_irvRead iv = liftCode (IrvRead iv)
110
rte_irvRead iv = liftCode (IrvRead iv)
38
false
true
0
10
23
60
28
32
null
null
yiannist/ganeti
src/Ganeti/JSON.hs
bsd-2-clause
-- | Branch decoding on a field in a JSON object. branchOnField :: String -- ^ fieldname to branch on -> (J.JSValue -> J.Result a) -- ^ decoding function if field is present and @true@; field -- will already be removed in the input -> (J.JSValue -> J.Result a) -- ^ decoding function otherwise -> J.JSValue -> J.Result a branchOnField k ifTrue ifFalse (J.JSObject jobj) = let fields = J.fromJSObject jobj jobj' = J.JSObject . J.toJSObject $ filter ((/=) k . fst) fields in if lookup k fields == Just (J.JSBool True) then ifTrue jobj' else ifFalse jobj'
671
branchOnField :: String -- ^ fieldname to branch on -> (J.JSValue -> J.Result a) -- ^ decoding function if field is present and @true@; field -- will already be removed in the input -> (J.JSValue -> J.Result a) -- ^ decoding function otherwise -> J.JSValue -> J.Result a branchOnField k ifTrue ifFalse (J.JSObject jobj) = let fields = J.fromJSObject jobj jobj' = J.JSObject . J.toJSObject $ filter ((/=) k . fst) fields in if lookup k fields == Just (J.JSBool True) then ifTrue jobj' else ifFalse jobj'
621
branchOnField k ifTrue ifFalse (J.JSObject jobj) = let fields = J.fromJSObject jobj jobj' = J.JSObject . J.toJSObject $ filter ((/=) k . fst) fields in if lookup k fields == Just (J.JSBool True) then ifTrue jobj' else ifFalse jobj'
255
true
true
0
13
216
168
85
83
null
null
charlesrosenbauer/Bzo-Compiler
src/HigherOrder.hs
gpl-3.0
applyIf :: (a -> a) -> a -> Bool -> a applyIf f x True = f x
61
applyIf :: (a -> a) -> a -> Bool -> a applyIf f x True = f x
61
applyIf f x True = f x
23
false
true
0
7
18
40
20
20
null
null
raichoo/Idris-dev
src/Idris/Core/Evaluate.hs
bsd-3-clause
spec :: Context -> Ctxt [Bool] -> Env -> TT Name -> Eval (TT Name) spec ctxt statics genv tm = error "spec undefined"
117
spec :: Context -> Ctxt [Bool] -> Env -> TT Name -> Eval (TT Name) spec ctxt statics genv tm = error "spec undefined"
117
spec ctxt statics genv tm = error "spec undefined"
50
false
true
0
11
23
57
27
30
null
null
bgamari/text
src/Data/Text.hs
bsd-2-clause
------------------------------------------------------------------------------- -- * View patterns -- | /O(n)/ Return the suffix of the second string if its prefix -- matches the entire first string. -- -- Examples: -- -- >>> stripPrefix "foo" "foobar" -- Just "bar" -- -- >>> stripPrefix "" "baz" -- Just "baz" -- -- >>> stripPrefix "foo" "quux" -- Nothing -- -- This is particularly useful with the @ViewPatterns@ extension to -- GHC, as follows: -- -- > {-# LANGUAGE ViewPatterns #-} -- > import Data.Text as T -- > -- > fnordLength :: Text -> Int -- > fnordLength (stripPrefix "fnord" -> Just suf) = T.length suf -- > fnordLength _ = -1 stripPrefix :: Text -> Text -> Maybe Text stripPrefix p@(Text _arr _off plen) t@(Text arr off len) | p `isPrefixOf` t = Just $! text arr (off+plen) (len-plen) | otherwise = Nothing
872
stripPrefix :: Text -> Text -> Maybe Text stripPrefix p@(Text _arr _off plen) t@(Text arr off len) | p `isPrefixOf` t = Just $! text arr (off+plen) (len-plen) | otherwise = Nothing
195
stripPrefix p@(Text _arr _off plen) t@(Text arr off len) | p `isPrefixOf` t = Just $! text arr (off+plen) (len-plen) | otherwise = Nothing
153
true
true
1
9
189
123
75
48
null
null
sgillespie/ghc
compiler/utils/Outputable.hs
bsd-3-clause
fcat :: [SDoc] -> SDoc -- ^ This behaves like 'fsep', but it uses '<>' for horizontal conposition rather than '<+>' hcat ds = SDoc $ \sty -> Pretty.hcat [runSDoc d sty | d <- ds]
180
fcat :: [SDoc] -> SDoc hcat ds = SDoc $ \sty -> Pretty.hcat [runSDoc d sty | d <- ds]
85
hcat ds = SDoc $ \sty -> Pretty.hcat [runSDoc d sty | d <- ds]
62
true
true
0
10
37
55
28
27
null
null
DavidAlphaFox/darcs
src/Darcs/Util/IsoDate.hs
gpl-2.0
iso8601Date :: CharParser a MCalendarTime iso8601Date = do d <- calendar_date <|> week_date <|> ordinal_date return $ foldr ($) nullMCalendar d where calendar_date = -- yyyy-mm-dd try $ do d <- optchain year_ [ (dash, month_), (dash, day_) ] -- allow other variants to be parsed correctly notFollowedBy (digit <|> char 'W') return d week_date = --yyyy-Www-d try $ do yfn <- year_ optional dash _ <- char 'W' -- offset human 'week 1' -> computer 'week 0' w' <- (\x -> x-1) `liftM` twoDigits mwd <- option Nothing $ do { optional dash; Just `fmap` nDigits 1 } let y = resetCalendar . unsafeToCalendarTime . yfn $ nullMCalendar { mctDay = Just 1 } firstDay = ctWDay y -- things that make this complicated -- 1. iso8601 weeks start from Monday; Haskell weeks start from Sunday -- 2. the first week is the one that contains at least Thursday -- if the year starts after Thursday, then some days of the year -- will have already passed before the first week let afterThursday = firstDay == Sunday || firstDay > Thursday w = if afterThursday then w'+1 else w' yday = (7 * w) + fromMaybe 1 mwd diff c = c { mctWeek = True , mctWDay = toEnum `fmap` mwd , mctDay = Just yday } return [diff.yfn] ordinal_date = -- yyyy-ddd try $ optchain year_ [ (dash, yearDay_) ] -- year_ = try $ do y <- fourDigits <?> "year (0000-9999)" return $ \c -> c { mctYear = Just y } month_ = try $ do m <- twoDigits <?> "month (1 to 12)" return $ \c -> c { mctMonth = Just $ intToMonth m } day_ = try $ do d <- twoDigits <?> "day in month (1 to 31)" return $ \c -> c { mctDay = Just d } yearDay_ = try $ do d <- nDigits 3 <?> "day in year (001 to 366)" return $ \c -> c { mctDay = Just d , mctYDay = Just (d - 1) } dash = char '-' -- | Note that this returns a function which sets the time on -- another calendar (see 'iso8601DateTime' for a list of -- flaws
2,414
iso8601Date :: CharParser a MCalendarTime iso8601Date = do d <- calendar_date <|> week_date <|> ordinal_date return $ foldr ($) nullMCalendar d where calendar_date = -- yyyy-mm-dd try $ do d <- optchain year_ [ (dash, month_), (dash, day_) ] -- allow other variants to be parsed correctly notFollowedBy (digit <|> char 'W') return d week_date = --yyyy-Www-d try $ do yfn <- year_ optional dash _ <- char 'W' -- offset human 'week 1' -> computer 'week 0' w' <- (\x -> x-1) `liftM` twoDigits mwd <- option Nothing $ do { optional dash; Just `fmap` nDigits 1 } let y = resetCalendar . unsafeToCalendarTime . yfn $ nullMCalendar { mctDay = Just 1 } firstDay = ctWDay y -- things that make this complicated -- 1. iso8601 weeks start from Monday; Haskell weeks start from Sunday -- 2. the first week is the one that contains at least Thursday -- if the year starts after Thursday, then some days of the year -- will have already passed before the first week let afterThursday = firstDay == Sunday || firstDay > Thursday w = if afterThursday then w'+1 else w' yday = (7 * w) + fromMaybe 1 mwd diff c = c { mctWeek = True , mctWDay = toEnum `fmap` mwd , mctDay = Just yday } return [diff.yfn] ordinal_date = -- yyyy-ddd try $ optchain year_ [ (dash, yearDay_) ] -- year_ = try $ do y <- fourDigits <?> "year (0000-9999)" return $ \c -> c { mctYear = Just y } month_ = try $ do m <- twoDigits <?> "month (1 to 12)" return $ \c -> c { mctMonth = Just $ intToMonth m } day_ = try $ do d <- twoDigits <?> "day in month (1 to 31)" return $ \c -> c { mctDay = Just d } yearDay_ = try $ do d <- nDigits 3 <?> "day in year (001 to 366)" return $ \c -> c { mctDay = Just d , mctYDay = Just (d - 1) } dash = char '-' -- | Note that this returns a function which sets the time on -- another calendar (see 'iso8601DateTime' for a list of -- flaws
2,414
iso8601Date = do d <- calendar_date <|> week_date <|> ordinal_date return $ foldr ($) nullMCalendar d where calendar_date = -- yyyy-mm-dd try $ do d <- optchain year_ [ (dash, month_), (dash, day_) ] -- allow other variants to be parsed correctly notFollowedBy (digit <|> char 'W') return d week_date = --yyyy-Www-d try $ do yfn <- year_ optional dash _ <- char 'W' -- offset human 'week 1' -> computer 'week 0' w' <- (\x -> x-1) `liftM` twoDigits mwd <- option Nothing $ do { optional dash; Just `fmap` nDigits 1 } let y = resetCalendar . unsafeToCalendarTime . yfn $ nullMCalendar { mctDay = Just 1 } firstDay = ctWDay y -- things that make this complicated -- 1. iso8601 weeks start from Monday; Haskell weeks start from Sunday -- 2. the first week is the one that contains at least Thursday -- if the year starts after Thursday, then some days of the year -- will have already passed before the first week let afterThursday = firstDay == Sunday || firstDay > Thursday w = if afterThursday then w'+1 else w' yday = (7 * w) + fromMaybe 1 mwd diff c = c { mctWeek = True , mctWDay = toEnum `fmap` mwd , mctDay = Just yday } return [diff.yfn] ordinal_date = -- yyyy-ddd try $ optchain year_ [ (dash, yearDay_) ] -- year_ = try $ do y <- fourDigits <?> "year (0000-9999)" return $ \c -> c { mctYear = Just y } month_ = try $ do m <- twoDigits <?> "month (1 to 12)" return $ \c -> c { mctMonth = Just $ intToMonth m } day_ = try $ do d <- twoDigits <?> "day in month (1 to 31)" return $ \c -> c { mctDay = Just d } yearDay_ = try $ do d <- nDigits 3 <?> "day in year (001 to 366)" return $ \c -> c { mctDay = Just d , mctYDay = Just (d - 1) } dash = char '-' -- | Note that this returns a function which sets the time on -- another calendar (see 'iso8601DateTime' for a list of -- flaws
2,372
false
true
22
13
957
621
309
312
null
null
swift-nav/plover
src/Language/Plover/Types.hs
mit
stLetLike :: (Monad m, ScopedTraverser a) => ScopedTraverserRec m -> (Tag SourcePos -> Variable -> a -> CExpr -> CExpr) -> Tag SourcePos -> Variable -> a -> CExpr -> m CExpr stLetLike tr cons pos v val expr = stEx tr pos =<< do val' <- scopedTraverseTerm tr pos val stScope tr v pos $ \v' -> do expr' <- scopedTraverseTerm tr pos expr return $ cons pos v' val' expr'
411
stLetLike :: (Monad m, ScopedTraverser a) => ScopedTraverserRec m -> (Tag SourcePos -> Variable -> a -> CExpr -> CExpr) -> Tag SourcePos -> Variable -> a -> CExpr -> m CExpr stLetLike tr cons pos v val expr = stEx tr pos =<< do val' <- scopedTraverseTerm tr pos val stScope tr v pos $ \v' -> do expr' <- scopedTraverseTerm tr pos expr return $ cons pos v' val' expr'
411
stLetLike tr cons pos v val expr = stEx tr pos =<< do val' <- scopedTraverseTerm tr pos val stScope tr v pos $ \v' -> do expr' <- scopedTraverseTerm tr pos expr return $ cons pos v' val' expr'
204
false
true
0
14
116
171
79
92
null
null
byorgey/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
showDeclImp _ (PClauses _ _ n c) = showSep "\n" (map show c)
60
showDeclImp _ (PClauses _ _ n c) = showSep "\n" (map show c)
60
showDeclImp _ (PClauses _ _ n c) = showSep "\n" (map show c)
60
false
false
0
7
12
36
17
19
null
null
mwahab1/pandoc
src/Text/Pandoc/Readers/HTML.hs
gpl-2.0
-- -- Constants -- eitherBlockOrInline :: [String] eitherBlockOrInline = ["audio", "applet", "button", "iframe", "embed", "del", "ins", "progress", "map", "area", "noscript", "script", "object", "svg", "video", "source"]
290
eitherBlockOrInline :: [String] eitherBlockOrInline = ["audio", "applet", "button", "iframe", "embed", "del", "ins", "progress", "map", "area", "noscript", "script", "object", "svg", "video", "source"]
270
eitherBlockOrInline = ["audio", "applet", "button", "iframe", "embed", "del", "ins", "progress", "map", "area", "noscript", "script", "object", "svg", "video", "source"]
238
true
true
0
5
94
65
43
22
null
null
nevrenato/HetsAlloy
PGIP/Query.hs
gpl-2.0
escStr :: String -> String escStr = concatMap (\ c -> case Map.lookup c $ Map.fromList escMap of Nothing -> [c] Just e -> ['X', e])
139
escStr :: String -> String escStr = concatMap (\ c -> case Map.lookup c $ Map.fromList escMap of Nothing -> [c] Just e -> ['X', e])
139
escStr = concatMap (\ c -> case Map.lookup c $ Map.fromList escMap of Nothing -> [c] Just e -> ['X', e])
112
false
true
0
11
33
68
35
33
null
null
haskell-gi/gi-gtk-examples
actionMenu/ActionMenu.hs
lgpl-2.1
-- A function like this can be used to tag string literals for i18n. -- It also avoids a lot of type annotations. __ :: Text -> Text __ = id
140
__ :: Text -> Text __ = id
26
__ = id
7
true
true
0
5
30
17
10
7
null
null
rgllm/uminho
02/CP/cp/Test.hs
mit
test_union1 = Graph.union g8 g9 ~?= Graph {nodes = fromList[1,2,3,4], edges = fromList[Edge 1 2, Edge 2 4, Edge 4 3, Edge 2 4, Edge 3 2, Edge 3 4]}
147
test_union1 = Graph.union g8 g9 ~?= Graph {nodes = fromList[1,2,3,4], edges = fromList[Edge 1 2, Edge 2 4, Edge 4 3, Edge 2 4, Edge 3 2, Edge 3 4]}
147
test_union1 = Graph.union g8 g9 ~?= Graph {nodes = fromList[1,2,3,4], edges = fromList[Edge 1 2, Edge 2 4, Edge 4 3, Edge 2 4, Edge 3 2, Edge 3 4]}
147
false
false
0
10
29
97
51
46
null
null
asilvestre/haskell-neo4j-rest-client
tests/IntegrationTests.hs
mit
case_batchAddLabels :: Assertion case_batchAddLabels = withAuthConnection host port creds $ do let label1 = "label1" let label2 = "label2" let label3 = "label3" let labelset = HS.fromList [label1, label2, label3] g <- B.runBatch $ do n1 <- B.createNode someProperties _ <- B.createNode anotherProperties _ <- B.addLabels [label1, label2] n1 B.addLabels [label3] n1 neo4jEqual 2 (length $ G.getNodes g) neo4jBool $ labelset `elem` map (`G.getNodeLabels` g) (G.getNodes g) neo4jBool $ HS.empty `elem` map (`G.getNodeLabels` g) (G.getNodes g) _ <- B.runBatch $ mapM_ B.deleteNode (G.getNodes g) return () -- | Test batch, change labels
873
case_batchAddLabels :: Assertion case_batchAddLabels = withAuthConnection host port creds $ do let label1 = "label1" let label2 = "label2" let label3 = "label3" let labelset = HS.fromList [label1, label2, label3] g <- B.runBatch $ do n1 <- B.createNode someProperties _ <- B.createNode anotherProperties _ <- B.addLabels [label1, label2] n1 B.addLabels [label3] n1 neo4jEqual 2 (length $ G.getNodes g) neo4jBool $ labelset `elem` map (`G.getNodeLabels` g) (G.getNodes g) neo4jBool $ HS.empty `elem` map (`G.getNodeLabels` g) (G.getNodes g) _ <- B.runBatch $ mapM_ B.deleteNode (G.getNodes g) return () -- | Test batch, change labels
873
case_batchAddLabels = withAuthConnection host port creds $ do let label1 = "label1" let label2 = "label2" let label3 = "label3" let labelset = HS.fromList [label1, label2, label3] g <- B.runBatch $ do n1 <- B.createNode someProperties _ <- B.createNode anotherProperties _ <- B.addLabels [label1, label2] n1 B.addLabels [label3] n1 neo4jEqual 2 (length $ G.getNodes g) neo4jBool $ labelset `elem` map (`G.getNodeLabels` g) (G.getNodes g) neo4jBool $ HS.empty `elem` map (`G.getNodeLabels` g) (G.getNodes g) _ <- B.runBatch $ mapM_ B.deleteNode (G.getNodes g) return () -- | Test batch, change labels
840
false
true
0
14
332
269
132
137
null
null
ezyang/ghc
compiler/stranal/WwLib.hs
bsd-3-clause
deepSplitProductType_maybe _ _ = Nothing
40
deepSplitProductType_maybe _ _ = Nothing
40
deepSplitProductType_maybe _ _ = Nothing
40
false
false
0
5
4
11
5
6
null
null
bvdelft/parac2
src/Language/Java/Paragon/SourcePos.hs
bsd-3-clause
sourceColumn (SourcePos _ _ c) = c
34
sourceColumn (SourcePos _ _ c) = c
34
sourceColumn (SourcePos _ _ c) = c
34
false
false
0
6
6
20
9
11
null
null
aaronc/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
unList :: Term -> Maybe [Term] unList tm = case unApply tm of (nil, [_]) -> Just [] (cons, ([_, x, xs])) -> do rest <- unList xs return $ x:rest (f, args) -> Nothing -- | Hard-code a heuristic maximum term size, to prevent attempts to -- serialize or force infinite or just gigantic terms
370
unList :: Term -> Maybe [Term] unList tm = case unApply tm of (nil, [_]) -> Just [] (cons, ([_, x, xs])) -> do rest <- unList xs return $ x:rest (f, args) -> Nothing -- | Hard-code a heuristic maximum term size, to prevent attempts to -- serialize or force infinite or just gigantic terms
370
unList tm = case unApply tm of (nil, [_]) -> Just [] (cons, ([_, x, xs])) -> do rest <- unList xs return $ x:rest (f, args) -> Nothing -- | Hard-code a heuristic maximum term size, to prevent attempts to -- serialize or force infinite or just gigantic terms
339
false
true
0
11
137
115
60
55
null
null
adamse/mmc2
src/Agent/Dijkstra.hs
mit
cmpGoodness pl dm gn p1 p2 = compare (gn dm pl p1) (gn dm pl p2)
64
cmpGoodness pl dm gn p1 p2 = compare (gn dm pl p1) (gn dm pl p2)
64
cmpGoodness pl dm gn p1 p2 = compare (gn dm pl p1) (gn dm pl p2)
64
false
false
1
7
15
49
20
29
null
null
kcharter/spdy-base
src/Network/SPDY/Internal/Constants.hs
bsd-3-clause
stidSettingsInitialWindowSize :: Word32 stidSettingsInitialWindowSize = 7
73
stidSettingsInitialWindowSize :: Word32 stidSettingsInitialWindowSize = 7
73
stidSettingsInitialWindowSize = 7
33
false
true
0
4
5
11
6
5
null
null
siddhanathan/yi
yi-core/src/Yi/Config/Simple.hs
gpl-2.0
warn :: String -> String -> ConfigM () warn caller msg = io $ putStrLn $ printf "Warning: %s: %s" caller msg
108
warn :: String -> String -> ConfigM () warn caller msg = io $ putStrLn $ printf "Warning: %s: %s" caller msg
108
warn caller msg = io $ putStrLn $ printf "Warning: %s: %s" caller msg
69
false
true
2
9
21
49
22
27
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Compute/Types/Product.hs
mpl-2.0
-- | Creates a value of 'TargetHTTPSProxyList' with the minimum fields required to make a request. -- -- Use one of the following lenses to modify other fields as desired: -- -- * 'thplNextPageToken' -- -- * 'thplKind' -- -- * 'thplItems' -- -- * 'thplSelfLink' -- -- * 'thplId' targetHTTPSProxyList :: TargetHTTPSProxyList targetHTTPSProxyList = TargetHTTPSProxyList' { _thplNextPageToken = Nothing , _thplKind = "compute#targetHttpsProxyList" , _thplItems = Nothing , _thplSelfLink = Nothing , _thplId = Nothing }
547
targetHTTPSProxyList :: TargetHTTPSProxyList targetHTTPSProxyList = TargetHTTPSProxyList' { _thplNextPageToken = Nothing , _thplKind = "compute#targetHttpsProxyList" , _thplItems = Nothing , _thplSelfLink = Nothing , _thplId = Nothing }
268
targetHTTPSProxyList = TargetHTTPSProxyList' { _thplNextPageToken = Nothing , _thplKind = "compute#targetHttpsProxyList" , _thplItems = Nothing , _thplSelfLink = Nothing , _thplId = Nothing }
219
true
true
0
7
108
66
42
24
null
null
noughtmare/yi
yi-keymap-vim/src/Yi/Keymap/Vim/Ex/Commands/Buffer.hs
gpl-2.0
switchByRef :: BufferRef -> EditorM () switchByRef ref = do mBuf <- findBuffer ref maybe (return ()) (switchToBufferE . bkey) mBuf
138
switchByRef :: BufferRef -> EditorM () switchByRef ref = do mBuf <- findBuffer ref maybe (return ()) (switchToBufferE . bkey) mBuf
138
switchByRef ref = do mBuf <- findBuffer ref maybe (return ()) (switchToBufferE . bkey) mBuf
99
false
true
0
10
28
58
27
31
null
null
danr/hipspec
examples/old-examples/hip/Sequences.hs
gpl-3.0
fib (S Z) = one
19
fib (S Z) = one
19
fib (S Z) = one
19
false
false
0
7
8
15
7
8
null
null
brendanhay/gogol
gogol-dlp/gen/Network/Google/Resource/DLP/Organizations/DeidentifyTemplates/List.hs
mpl-2.0
-- | JSONP odtlCallback :: Lens' OrganizationsDeidentifyTemplatesList (Maybe Text) odtlCallback = lens _odtlCallback (\ s a -> s{_odtlCallback = a})
150
odtlCallback :: Lens' OrganizationsDeidentifyTemplatesList (Maybe Text) odtlCallback = lens _odtlCallback (\ s a -> s{_odtlCallback = a})
139
odtlCallback = lens _odtlCallback (\ s a -> s{_odtlCallback = a})
67
true
true
0
9
21
48
25
23
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_VERTEX_SHADER_LOCALS_EXT :: GLenum gl_VERTEX_SHADER_LOCALS_EXT = 0x87D3
74
gl_VERTEX_SHADER_LOCALS_EXT :: GLenum gl_VERTEX_SHADER_LOCALS_EXT = 0x87D3
74
gl_VERTEX_SHADER_LOCALS_EXT = 0x87D3
36
false
true
0
4
5
11
6
5
null
null
begriffs/hasql-postgres
library/Hasql/Postgres/Session/Execution.hs
mit
throwError :: Error -> M a throwError = M . lift . left
55
throwError :: Error -> M a throwError = M . lift . left
55
throwError = M . lift . left
28
false
true
2
7
12
34
14
20
null
null
mydaum/cabal
Cabal/tests/UnitTests/Distribution/Version.hs
bsd-3-clause
prop_foldVersionRange :: VersionRange -> Bool prop_foldVersionRange range = expandWildcard range == foldVersionRange anyVersion thisVersion laterVersion earlierVersion unionVersionRanges intersectVersionRanges range where expandWildcard (WildcardVersion v) = intersectVersionRanges (orLaterVersion v) (earlierVersion (upper v)) expandWildcard (UnionVersionRanges v1 v2) = UnionVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (IntersectVersionRanges v1 v2) = IntersectVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (VersionRangeParens v) = expandWildcard v expandWildcard v = v upper = alterVersion $ \numbers -> init numbers ++ [last numbers + 1]
813
prop_foldVersionRange :: VersionRange -> Bool prop_foldVersionRange range = expandWildcard range == foldVersionRange anyVersion thisVersion laterVersion earlierVersion unionVersionRanges intersectVersionRanges range where expandWildcard (WildcardVersion v) = intersectVersionRanges (orLaterVersion v) (earlierVersion (upper v)) expandWildcard (UnionVersionRanges v1 v2) = UnionVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (IntersectVersionRanges v1 v2) = IntersectVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (VersionRangeParens v) = expandWildcard v expandWildcard v = v upper = alterVersion $ \numbers -> init numbers ++ [last numbers + 1]
813
prop_foldVersionRange range = expandWildcard range == foldVersionRange anyVersion thisVersion laterVersion earlierVersion unionVersionRanges intersectVersionRanges range where expandWildcard (WildcardVersion v) = intersectVersionRanges (orLaterVersion v) (earlierVersion (upper v)) expandWildcard (UnionVersionRanges v1 v2) = UnionVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (IntersectVersionRanges v1 v2) = IntersectVersionRanges (expandWildcard v1) (expandWildcard v2) expandWildcard (VersionRangeParens v) = expandWildcard v expandWildcard v = v upper = alterVersion $ \numbers -> init numbers ++ [last numbers + 1]
767
false
true
6
11
196
184
90
94
null
null
TomMD/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
65
int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
65
int16TyConName = tcQual gHC_INT (fsLit "Int16") int16TyConKey
65
false
false
0
7
10
19
9
10
null
null
SwiftsNamesake/Occlusion
src/Occlusion/Core.hs
mit
-- | -- TODO: Rename (eg. occlusionEdge, frontEdge, near/far, cover, etc.) (?) nearestEdge :: RealFloat f => Complex f -> Polygon f -> Edge f nearestEdge p poly = error "Function 'nearestEdge' is currently on holiday"
217
nearestEdge :: RealFloat f => Complex f -> Polygon f -> Edge f nearestEdge p poly = error "Function 'nearestEdge' is currently on holiday"
138
nearestEdge p poly = error "Function 'nearestEdge' is currently on holiday"
75
true
true
0
8
35
45
21
24
null
null
seereason/cabal
cabal-install/Main.hs
bsd-3-clause
execAction :: ExecFlags -> [String] -> GlobalFlags -> IO () execAction execFlags extraArgs globalFlags = do let verbosity = fromFlag (execVerbosity execFlags) (useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty let configFlags = savedConfigureFlags config (comp, platform, conf) <- configCompilerAux' configFlags exec verbosity useSandbox comp platform conf extraArgs
430
execAction :: ExecFlags -> [String] -> GlobalFlags -> IO () execAction execFlags extraArgs globalFlags = do let verbosity = fromFlag (execVerbosity execFlags) (useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty let configFlags = savedConfigureFlags config (comp, platform, conf) <- configCompilerAux' configFlags exec verbosity useSandbox comp platform conf extraArgs
430
execAction execFlags extraArgs globalFlags = do let verbosity = fromFlag (execVerbosity execFlags) (useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty let configFlags = savedConfigureFlags config (comp, platform, conf) <- configCompilerAux' configFlags exec verbosity useSandbox comp platform conf extraArgs
370
false
true
0
12
82
123
59
64
null
null
alexander-at-github/eta
compiler/ETA/CodeGen/Name.hs
bsd-3-clause
idNameText :: DynFlags -> Id -> Text idNameText dflags = nameText dflags True . idName
86
idNameText :: DynFlags -> Id -> Text idNameText dflags = nameText dflags True . idName
86
idNameText dflags = nameText dflags True . idName
49
false
true
0
8
14
38
16
22
null
null
sdiehl/ghc
compiler/nativeGen/PPC/Regs.hs
bsd-3-clause
argRegs 6 = map regSingle [3..8]
32
argRegs 6 = map regSingle [3..8]
32
argRegs 6 = map regSingle [3..8]
32
false
false
1
6
5
23
9
14
null
null
pparkkin/eta
compiler/ETA/Types/TyCon.hs
bsd-3-clause
isPromotedTyCon _ = False
42
isPromotedTyCon _ = False
42
isPromotedTyCon _ = False
42
false
false
0
4
20
10
4
6
null
null
rueshyna/gogol
gogol-books/gen/Network/Google/Books/Types/Product.hs
mpl-2.0
dddwidisAttribution :: Lens' DictlayerDataDictWordsItemDerivativesItemSource (Maybe Text) dddwidisAttribution = lens _dddwidisAttribution (\ s a -> s{_dddwidisAttribution = a})
184
dddwidisAttribution :: Lens' DictlayerDataDictWordsItemDerivativesItemSource (Maybe Text) dddwidisAttribution = lens _dddwidisAttribution (\ s a -> s{_dddwidisAttribution = a})
184
dddwidisAttribution = lens _dddwidisAttribution (\ s a -> s{_dddwidisAttribution = a})
94
false
true
1
9
24
50
24
26
null
null
wxwxwwxxx/ghc
testsuite/tests/plugins/T10294a.hs
bsd-3-clause
baz :: Constr baz = toConstr SomeAnn
36
baz :: Constr baz = toConstr SomeAnn
36
baz = toConstr SomeAnn
22
false
true
0
6
6
21
8
13
null
null
robrix/derivative-parsing
src/Data/Higher/Graph.hs
bsd-3-clause
grfold :: forall f v c. HFunctor f => (v ~> c) -> (forall a. (v a -> c a) -> c a) -> (f c ~> c) -> Rec f v ~> c grfold var bind algebra = iter var $ \ rec -> case rec of Mu g -> bind (algebra . g) In fa -> algebra fa
220
grfold :: forall f v c. HFunctor f => (v ~> c) -> (forall a. (v a -> c a) -> c a) -> (f c ~> c) -> Rec f v ~> c grfold var bind algebra = iter var $ \ rec -> case rec of Mu g -> bind (algebra . g) In fa -> algebra fa
220
grfold var bind algebra = iter var $ \ rec -> case rec of Mu g -> bind (algebra . g) In fa -> algebra fa
108
false
true
0
14
63
145
72
73
null
null
NikolayS/postgrest
test/SpecHelper.hs
mit
testPoolOpts :: PoolSettings testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30
98
testPoolOpts :: PoolSettings testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30
98
testPoolOpts = fromMaybe (error "bad settings") $ H.poolSettings 1 30
69
false
true
0
7
12
37
16
21
null
null
edofic/core.js
runtime/ghcprim/GHC-Base.hs
mit
eqString :: String -> String -> Bool eqString [] [] = True
70
eqString :: String -> String -> Bool eqString [] [] = True
70
eqString [] [] = True
33
false
true
0
6
23
28
14
14
null
null
tamarin-prover/tamarin-prover
lib/theory/src/Theory.hs
gpl-3.0
-- | All left rules of a theory. leftTheoryRules :: DiffTheory sig c r r2 p p2 -> [r2] leftTheoryRules = foldDiffTheoryItem (const []) (\(x, y) -> if (x == LHS) then [y] else []) (const []) (const []) (const []) (const []) <=< L.get diffThyItems
249
leftTheoryRules :: DiffTheory sig c r r2 p p2 -> [r2] leftTheoryRules = foldDiffTheoryItem (const []) (\(x, y) -> if (x == LHS) then [y] else []) (const []) (const []) (const []) (const []) <=< L.get diffThyItems
216
leftTheoryRules = foldDiffTheoryItem (const []) (\(x, y) -> if (x == LHS) then [y] else []) (const []) (const []) (const []) (const []) <=< L.get diffThyItems
162
true
true
0
11
49
128
68
60
null
null
michaxm/crawlchain
test/src/CrawlingTests.hs
bsd-3-clause
doTest :: String -> (CrawlAction, CrawlDirective) -> String -> IO () doTest testname template expectedUrl = do results <- uncurry (executeCrawlChain testingContext) template checkFirstResult results expectedUrl where testingContext = readingContext $ testResourcePath ++ "/" ++ testname
296
doTest :: String -> (CrawlAction, CrawlDirective) -> String -> IO () doTest testname template expectedUrl = do results <- uncurry (executeCrawlChain testingContext) template checkFirstResult results expectedUrl where testingContext = readingContext $ testResourcePath ++ "/" ++ testname
296
doTest testname template expectedUrl = do results <- uncurry (executeCrawlChain testingContext) template checkFirstResult results expectedUrl where testingContext = readingContext $ testResourcePath ++ "/" ++ testname
227
false
true
0
10
45
87
42
45
null
null
cartazio/arithmoi
Math/NumberTheory/ArithmeticFunctions/Standard.hs
mit
sigmaA 1 = multiplicative $ sigmaHelper . fromIntegral . unPrime
64
sigmaA 1 = multiplicative $ sigmaHelper . fromIntegral . unPrime
64
sigmaA 1 = multiplicative $ sigmaHelper . fromIntegral . unPrime
64
false
false
1
7
9
25
10
15
null
null
pparkkin/eta
compiler/ETA/Core/MkCore.hs
bsd-3-clause
-- | Build the type of a big tuple that holds the specified type of thing mkBigCoreTupTy :: [Type] -> Type mkBigCoreTupTy = mkChunkified mkBoxedTupleTy
151
mkBigCoreTupTy :: [Type] -> Type mkBigCoreTupTy = mkChunkified mkBoxedTupleTy
77
mkBigCoreTupTy = mkChunkified mkBoxedTupleTy
44
true
true
0
7
24
28
13
15
null
null
chadbrewbaker/shellcheck
ShellCheck/Analytics.hs
gpl-3.0
prop_checkBashisms24= verifyNot checkBashisms "trap mything int term"
69
prop_checkBashisms24= verifyNot checkBashisms "trap mything int term"
69
prop_checkBashisms24= verifyNot checkBashisms "trap mything int term"
69
false
false
0
5
6
11
5
6
null
null
JustusAdam/ja-base-extra
src/Data/List/JAExtra.hs
bsd-3-clause
monoidFillZip4 as bs cs [] = uncurry3 zip4 (unzip3 $ monoidFillZip3 as bs cs) (repeat mempty)
95
monoidFillZip4 as bs cs [] = uncurry3 zip4 (unzip3 $ monoidFillZip3 as bs cs) (repeat mempty)
95
monoidFillZip4 as bs cs [] = uncurry3 zip4 (unzip3 $ monoidFillZip3 as bs cs) (repeat mempty)
95
false
false
0
8
17
44
21
23
null
null
fluffynukeit/FNIStash
src/FNIStash/File/Item.hs
bsd-3-clause
-- Utility function for getting a list of something with prepended length getListOf (getter) = getWord32le >>= return . fromIntegral >>= flip replicateM getter
160
getListOf (getter) = getWord32le >>= return . fromIntegral >>= flip replicateM getter
85
getListOf (getter) = getWord32le >>= return . fromIntegral >>= flip replicateM getter
85
true
false
2
6
24
33
16
17
null
null
rawlep/EQS
sourceCode/GlobalParameters.hs
mit
labelLeftofWidgetE' labelName labelWidth widget packWidgetNatural = labelLeftofWidgetEGen False labelName labelWidth widget packWidgetNatural
145
labelLeftofWidgetE' labelName labelWidth widget packWidgetNatural = labelLeftofWidgetEGen False labelName labelWidth widget packWidgetNatural
145
labelLeftofWidgetE' labelName labelWidth widget packWidgetNatural = labelLeftofWidgetEGen False labelName labelWidth widget packWidgetNatural
145
false
false
0
5
15
28
12
16
null
null
Alexander-Ignatyev/morpheus
hmatrix-morpheus/src/Numeric/Morpheus/Activation.hs
bsd-3-clause
call_morpheus_relu :: CInt -> CInt -> CInt -> CInt -> Ptr Double -> CInt -> CInt -> CInt -> CInt -> Ptr Double -> IO () call_morpheus_relu rows cols _ _ xPtr _ _ _ _ yPtr = do c_morpheus_relu (rows*cols) xPtr yPtr -- | Calculates ReLu.
283
call_morpheus_relu :: CInt -> CInt -> CInt -> CInt -> Ptr Double -> CInt -> CInt -> CInt -> CInt -> Ptr Double -> IO () call_morpheus_relu rows cols _ _ xPtr _ _ _ _ yPtr = do c_morpheus_relu (rows*cols) xPtr yPtr -- | Calculates ReLu.
283
call_morpheus_relu rows cols _ _ xPtr _ _ _ _ yPtr = do c_morpheus_relu (rows*cols) xPtr yPtr -- | Calculates ReLu.
119
false
true
0
16
94
101
49
52
null
null
xunilrj/sandbox
sources/haskell/papers/reactive.hs
apache-2.0
--showI :: a -> String showI a = show a
43
showI a = show a
16
showI a = show a
16
true
false
1
5
13
17
6
11
null
null
jean-edouard/manager
xenmgr/Vm/Config.hs
gpl-2.0
isDiskValid :: Disk -> Rpc Bool isDiskValid disk = case diskType disk of VirtualHardDisk -> liftIO . doesFileExist $ diskPath disk _ -> return True
177
isDiskValid :: Disk -> Rpc Bool isDiskValid disk = case diskType disk of VirtualHardDisk -> liftIO . doesFileExist $ diskPath disk _ -> return True
177
isDiskValid disk = case diskType disk of VirtualHardDisk -> liftIO . doesFileExist $ diskPath disk _ -> return True
145
false
true
2
7
54
56
25
31
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_ESCRIPT_COMMENTDOC :: Int wxSTC_ESCRIPT_COMMENTDOC = 3
60
wxSTC_ESCRIPT_COMMENTDOC :: Int wxSTC_ESCRIPT_COMMENTDOC = 3
60
wxSTC_ESCRIPT_COMMENTDOC = 3
28
false
true
0
4
5
11
6
5
null
null
wavewave/LHAPDF
src/HEP/Data/LHAPDF.hs
gpl-3.0
partonType2Int Bbar = -5
24
partonType2Int Bbar = -5
24
partonType2Int Bbar = -5
24
false
false
0
5
3
11
5
6
null
null
howinator/spark-bowl
raspberry/haskell-server/src/ServerAPI.hs
gpl-3.0
app :: Application app = serve rpiAPI server
44
app :: Application app = serve rpiAPI server
44
app = serve rpiAPI server
25
false
true
0
5
7
16
8
8
null
null
damoxc/ganeti
src/Ganeti/HTools/Node.hs
gpl-2.0
list :: [String] -> Node -> [String] list fields t = map (showField t) fields
77
list :: [String] -> Node -> [String] list fields t = map (showField t) fields
77
list fields t = map (showField t) fields
40
false
true
0
9
14
46
22
24
null
null
xcthulhu/lambda-geda
Geda/Parser.hs
gpl-3.0
-- Parse combinator for any GSchem -- This object parses an entry in a GSchem file to a corresponding -- object of type GSchem pObj :: Parser GSchem pObj = pv <|> pL <|> pG <|> pB <|> pV <|> pA <|> pT <|> pN <|> pU <|> pP <|> pC <|> pH
243
pObj :: Parser GSchem pObj = pv <|> pL <|> pG <|> pB <|> pV <|> pA <|> pT <|> pN <|> pU <|> pP <|> pC <|> pH
116
pObj = pv <|> pL <|> pG <|> pB <|> pV <|> pA <|> pT <|> pN <|> pU <|> pP <|> pC <|> pH
94
true
true
21
8
60
88
47
41
null
null