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
iliastsi/gac
src/typecheck/TypeCheck.hs
mit
tcParamDef :: (SrcSpan, (Ide,LIde), ATypeR, [Located UDef], Located UStmt) -> (Bool, Maybe (SrcSpan, [(AType,Mode)], AType), AType) -> [Located UParam] -> [(AType,Mode)] -> TcM ADefFun tcParamDef (loc, (fname,lide), ATypeR ftype, ludefs, lustmt) (isP, mP, aftype) [] par_types = do -- update pa...
1,855
tcParamDef :: (SrcSpan, (Ide,LIde), ATypeR, [Located UDef], Located UStmt) -> (Bool, Maybe (SrcSpan, [(AType,Mode)], AType), AType) -> [Located UParam] -> [(AType,Mode)] -> TcM ADefFun tcParamDef (loc, (fname,lide), ATypeR ftype, ludefs, lustmt) (isP, mP, aftype) [] par_types = do -- update pa...
1,855
tcParamDef (loc, (fname,lide), ATypeR ftype, ludefs, lustmt) (isP, mP, aftype) [] par_types = do -- update parameters in symbol table let par_types' = reverse par_types updateFuncM par_types' if isP then do rawCloseScopeM return $ ADefFun (TDefProt fname ftype) (TTypeRetIO f...
1,648
false
true
0
20
717
531
273
258
null
null
dmeysman/tiny-compiler
src/Language/Tiny/Synthesis/Intermediate.hs
mit
statementToIntermediate (ArrayAssignment lefthand expression) = do entry' <- local $ name lefthand let annotation = entry entry' intermediate <- expressionToIntermediate expression return $ intermediate ++ [IndexedAssign entry' (Int $ 4 * (index (reverse (indexes lefthand)) (reverse (lengths annotatio...
1,207
statementToIntermediate (ArrayAssignment lefthand expression) = do entry' <- local $ name lefthand let annotation = entry entry' intermediate <- expressionToIntermediate expression return $ intermediate ++ [IndexedAssign entry' (Int $ 4 * (index (reverse (indexes lefthand)) (reverse (lengths annotatio...
1,207
statementToIntermediate (ArrayAssignment lefthand expression) = do entry' <- local $ name lefthand let annotation = entry entry' intermediate <- expressionToIntermediate expression return $ intermediate ++ [IndexedAssign entry' (Int $ 4 * (index (reverse (indexes lefthand)) (reverse (lengths annotatio...
1,207
false
false
8
17
239
382
195
187
null
null
stschiff/rarecoal
src-rarecoal/Main.hs
gpl-3.0
parseCommand :: OP.Parser Command parseCommand = OP.subparser $ OP.command "prob" (parseProb `withInfo` "Compute probability for a given \ \configuration") <> OP.command "logl" (parseLogl `withInfo` "Compute the likelihood of the \ \given model for the given data set") <> OP.command "maxl" (...
821
parseCommand :: OP.Parser Command parseCommand = OP.subparser $ OP.command "prob" (parseProb `withInfo` "Compute probability for a given \ \configuration") <> OP.command "logl" (parseLogl `withInfo` "Compute the likelihood of the \ \given model for the given data set") <> OP.command "maxl" (...
821
parseCommand = OP.subparser $ OP.command "prob" (parseProb `withInfo` "Compute probability for a given \ \configuration") <> OP.command "logl" (parseLogl `withInfo` "Compute the likelihood of the \ \given model for the given data set") <> OP.command "maxl" (parseMaxl `withInfo` "Maximize the...
787
false
true
5
8
188
170
86
84
null
null
nevrenato/Hets_Fork
HasCASL/DataAna.hs
gpl-2.0
anaComp genKind tys rt te (NoSelector t) = do ct <- anaCompType genKind tys rt t te return (ct, Select Nothing ct Partial)
134
anaComp genKind tys rt te (NoSelector t) = do ct <- anaCompType genKind tys rt t te return (ct, Select Nothing ct Partial)
134
anaComp genKind tys rt te (NoSelector t) = do ct <- anaCompType genKind tys rt t te return (ct, Select Nothing ct Partial)
134
false
false
0
9
34
60
28
32
null
null
tauli/LambdaLudo
src/LambdaLudo.hs
bsd-3-clause
evalAction (ChangeBgImage name) st = case lookup name (texture st) of Nothing -> error ("texture: " ++ name ++ " not found") Just t -> st {gameBg = BgTexture t}
172
evalAction (ChangeBgImage name) st = case lookup name (texture st) of Nothing -> error ("texture: " ++ name ++ " not found") Just t -> st {gameBg = BgTexture t}
172
evalAction (ChangeBgImage name) st = case lookup name (texture st) of Nothing -> error ("texture: " ++ name ++ " not found") Just t -> st {gameBg = BgTexture t}
172
false
false
0
11
41
72
35
37
null
null
dmp1ce/Haskell-Programming-Exercises
Chapter 11/Phone Exercises.hs
unlicense
answer3 :: [(String, Presses)] answer3 = map (\(x, taps) -> (x, fingerTaps taps)) answer2
89
answer3 :: [(String, Presses)] answer3 = map (\(x, taps) -> (x, fingerTaps taps)) answer2
89
answer3 = map (\(x, taps) -> (x, fingerTaps taps)) answer2
58
false
true
0
9
13
55
29
26
null
null
bdesham/link-checker
src/LinkChecker/Curl.hs
isc
-- | Given a Curl object, extracts the HTTP response code. getResponseCode :: Curl -> IO Integer getResponseCode curl = do code <- getInfo curl ResponseCode let longValue = case code of ILong l -> l _ -> error "Curl ResponseCode is not an integer" return $ fromIntegral longV...
397
getResponseCode :: Curl -> IO Integer getResponseCode curl = do code <- getInfo curl ResponseCode let longValue = case code of ILong l -> l _ -> error "Curl ResponseCode is not an integer" return $ fromIntegral longValue -- | Given a Curl object, extracts the URL to which w...
338
getResponseCode curl = do code <- getInfo curl ResponseCode let longValue = case code of ILong l -> l _ -> error "Curl ResponseCode is not an integer" return $ fromIntegral longValue -- | Given a Curl object, extracts the URL to which we were redirected.
300
true
true
0
13
108
76
35
41
null
null
nwf/grade
lib/Grade/Score/SectionOnly.hs
bsd-2-clause
efid :: (T.TokenParsing f) => f Double efid = (either fromIntegral id) <$> T.integerOrDouble
92
efid :: (T.TokenParsing f) => f Double efid = (either fromIntegral id) <$> T.integerOrDouble
92
efid = (either fromIntegral id) <$> T.integerOrDouble
53
false
true
0
8
13
45
21
24
null
null
bergmark/http2
Network/HPACK/HeaderBlock/From.hs
bsd-3-clause
decodeStep (!hdrtbl,!builder) (Literal Add naming v) = do k <- fromNaming naming hdrtbl let h = (k,v) e = toEntry (k,v) b = builder << h hdrtbl' <- insertEntry e hdrtbl return (hdrtbl',b)
219
decodeStep (!hdrtbl,!builder) (Literal Add naming v) = do k <- fromNaming naming hdrtbl let h = (k,v) e = toEntry (k,v) b = builder << h hdrtbl' <- insertEntry e hdrtbl return (hdrtbl',b)
219
decodeStep (!hdrtbl,!builder) (Literal Add naming v) = do k <- fromNaming naming hdrtbl let h = (k,v) e = toEntry (k,v) b = builder << h hdrtbl' <- insertEntry e hdrtbl return (hdrtbl',b)
219
false
false
0
12
64
107
52
55
null
null
jmaessen/Data.FastSequence
src/Data/FastSequence.hs
bsd-3-clause
rootR :: Size -> Node a -> FTree (Node a) -> Node a -> FTree a rootR s l d r | N.breadth r >= minFringe = Root s l d r | otherwise = case viewr' d of View r' d' -> Root s l d' (N.append r' r) Empty -> Simple (N.append l r)
247
rootR :: Size -> Node a -> FTree (Node a) -> Node a -> FTree a rootR s l d r | N.breadth r >= minFringe = Root s l d r | otherwise = case viewr' d of View r' d' -> Root s l d' (N.append r' r) Empty -> Simple (N.append l r)
247
rootR s l d r | N.breadth r >= minFringe = Root s l d r | otherwise = case viewr' d of View r' d' -> Root s l d' (N.append r' r) Empty -> Simple (N.append l r)
184
false
true
0
12
80
149
67
82
null
null
worksap-ate/aws-sdk-xml-unordered
test/test.hs
bsd-3-clause
cannotParseEmpty :: Expectation cannotParseEmpty = (getElement input >>= element "data" dataConv) `shouldThrow` parseError where input = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
201
cannotParseEmpty :: Expectation cannotParseEmpty = (getElement input >>= element "data" dataConv) `shouldThrow` parseError where input = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
201
cannotParseEmpty = (getElement input >>= element "data" dataConv) `shouldThrow` parseError where input = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
169
false
true
0
8
36
40
21
19
null
null
kolmodin/cabal
Cabal/Distribution/Simple/Build.hs
bsd-3-clause
buildComponent _ _ _ _ _ (CTest TestSuite { testInterface = TestSuiteUnsupported tt }) _ _ = die $ "No support for building test suite type " ++ display tt
189
buildComponent _ _ _ _ _ (CTest TestSuite { testInterface = TestSuiteUnsupported tt }) _ _ = die $ "No support for building test suite type " ++ display tt
189
buildComponent _ _ _ _ _ (CTest TestSuite { testInterface = TestSuiteUnsupported tt }) _ _ = die $ "No support for building test suite type " ++ display tt
189
false
false
4
9
63
49
24
25
null
null
nh2/shake
Examples/Test/Docs.hs
bsd-3-clause
dropComment ('-':'-':_) = []
28
dropComment ('-':'-':_) = []
28
dropComment ('-':'-':_) = []
28
false
false
0
8
3
22
11
11
null
null
mgold/Elm
src/Canonicalize/Variable.hs
bsd-3-clause
noQualifier :: VarName -> String noQualifier name = case name of Left x -> x Right (_, x) -> x
104
noQualifier :: VarName -> String noQualifier name = case name of Left x -> x Right (_, x) -> x
104
noQualifier name = case name of Left x -> x Right (_, x) -> x
71
false
true
0
9
29
52
24
28
null
null
green-haskell/ghc
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
bsd-3-clause
pprPat _ (ListP ps) = brackets $ sep $ punctuate comma $ map ppr ps
67
pprPat _ (ListP ps) = brackets $ sep $ punctuate comma $ map ppr ps
67
pprPat _ (ListP ps) = brackets $ sep $ punctuate comma $ map ppr ps
67
false
false
0
7
14
37
17
20
null
null
m-alvarez/jhc
src/E/PrimDecode.hs
mit
processPrim :: MonadWarn m => DataTable -> SrcLoc -- ^ location of declaration -> Atom -- ^ primitive name -> [E] -- ^ arguments -> E -- ^ return type -> Requires -- ^ c requires -> m E -- ^ result processPrim dataTable srcLoc pName args rType req = ans whe...
5,139
processPrim :: MonadWarn m => DataTable -> SrcLoc -- ^ location of declaration -> Atom -- ^ primitive name -> [E] -- ^ arguments -> E -- ^ return type -> Requires -- ^ c requires -> m E processPrim dataTable srcLoc pName args rType req = ans where passThrough ...
5,120
processPrim dataTable srcLoc pName args rType req = ans where passThrough = EPrim (PrimPrim pName) args rType ans = checkOp binOpMap doBinOp $ checkOp unOpMap (doUnOp Op.UnOp) $ checkOp convOpMap (doUnOp Op.ConvOp) primCheckOther checkOp table yesMatch noMatch = case Map.lookup pName table of ...
4,878
true
true
0
21
1,659
1,925
941
984
null
null
ocramz/petsc-hs
src/Numerical/PETSc/Internal/ST.hs
gpl-3.0
newVector :: Storable t => t -> Int -> ST s (STVector s t) newVector x n = do v <- newUndefinedVector n let gox (-1) = return v gox !k = unsafeWriteVector v k x >> gox (k-1 :: Int) gox (n-1)
210
newVector :: Storable t => t -> Int -> ST s (STVector s t) newVector x n = do v <- newUndefinedVector n let gox (-1) = return v gox !k = unsafeWriteVector v k x >> gox (k-1 :: Int) gox (n-1)
210
newVector x n = do v <- newUndefinedVector n let gox (-1) = return v gox !k = unsafeWriteVector v k x >> gox (k-1 :: Int) gox (n-1)
151
false
true
0
13
62
120
56
64
null
null
jacekszymanski/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxLC_MASK_ALIGN :: Int wxLC_MASK_ALIGN = wxLC_ALIGN_TOP .|. wxLC_ALIGN_LEFT
75
wxLC_MASK_ALIGN :: Int wxLC_MASK_ALIGN = wxLC_ALIGN_TOP .|. wxLC_ALIGN_LEFT
75
wxLC_MASK_ALIGN = wxLC_ALIGN_TOP .|. wxLC_ALIGN_LEFT
52
false
true
0
5
7
15
8
7
null
null
mhwombat/prediction-wains
src/ALife/Creatur/Wain/UIVector/Prediction/Universe.hs
bsd-3-clause
cChildCostFactor :: Setting Double cChildCostFactor = requiredSetting "childCostFactor"
87
cChildCostFactor :: Setting Double cChildCostFactor = requiredSetting "childCostFactor"
87
cChildCostFactor = requiredSetting "childCostFactor"
52
false
true
0
5
7
17
8
9
null
null
rfranek/duckling
Duckling/Time/IT/Rules.hs
bsd-3-clause
ruleIlDayofmonthDeNamedmonth :: Rule ruleIlDayofmonthDeNamedmonth = Rule { name = "il <day-of-month> <named-month>" , pattern = [ regex "il|l'" , Predicate isDOMInteger , Predicate isAMonth ] , prod = \tokens -> case tokens of (_:token:Token Time td:_) -> Token Time <$> intersectDOM td token...
343
ruleIlDayofmonthDeNamedmonth :: Rule ruleIlDayofmonthDeNamedmonth = Rule { name = "il <day-of-month> <named-month>" , pattern = [ regex "il|l'" , Predicate isDOMInteger , Predicate isAMonth ] , prod = \tokens -> case tokens of (_:token:Token Time td:_) -> Token Time <$> intersectDOM td token...
343
ruleIlDayofmonthDeNamedmonth = Rule { name = "il <day-of-month> <named-month>" , pattern = [ regex "il|l'" , Predicate isDOMInteger , Predicate isAMonth ] , prod = \tokens -> case tokens of (_:token:Token Time td:_) -> Token Time <$> intersectDOM td token _ -> Nothing }
306
false
true
0
16
82
106
55
51
null
null
noteed/scp-streams
Network/SCP/Protocol.hs
bsd-3-clause
sendSelf :: FilePath -> IO SCP sendSelf target = sendProcess "dist/build/scp-streams/scp-streams" ["-t", target]
112
sendSelf :: FilePath -> IO SCP sendSelf target = sendProcess "dist/build/scp-streams/scp-streams" ["-t", target]
112
sendSelf target = sendProcess "dist/build/scp-streams/scp-streams" ["-t", target]
81
false
true
0
6
12
35
17
18
null
null
fgaray/shakespeare
Text/IndentToBrace.hs
mit
nest (Left x:rest) = Blank x : nest rest
40
nest (Left x:rest) = Blank x : nest rest
40
nest (Left x:rest) = Blank x : nest rest
40
false
false
0
8
8
29
13
16
null
null
CulpaBS/wbBach
src/Futhark/Representation/AST/Attributes/TypeOf.hs
bsd-3-clause
primOpType (Replicate ne e) = result <$> subExpType e where result t = [arrayOf t (Shape [ne]) NoUniqueness]
112
primOpType (Replicate ne e) = result <$> subExpType e where result t = [arrayOf t (Shape [ne]) NoUniqueness]
112
primOpType (Replicate ne e) = result <$> subExpType e where result t = [arrayOf t (Shape [ne]) NoUniqueness]
112
false
false
0
9
21
53
26
27
null
null
Pochoir/Pochoir
src/PShow.hs
gpl-3.0
pTransDim :: Int -> Int -> [DimExpr] -> [PName] -> [DimExpr] pTransDim n r [] _ = []
84
pTransDim :: Int -> Int -> [DimExpr] -> [PName] -> [DimExpr] pTransDim n r [] _ = []
84
pTransDim n r [] _ = []
23
false
true
0
11
17
55
27
28
null
null
kmate/HaRe
old/testing/duplication/WhereIn1_TokOut.hs
bsd-3-clause
foo = x + 3
11
foo = x + 3
11
foo = x + 3
11
false
false
1
5
4
13
5
8
null
null
plow-technologies/template-service
test/PrototypeSpec.hs
bsd-3-clause
main :: IO () main = hspec spec
31
main :: IO () main = hspec spec
31
main = hspec spec
17
false
true
0
6
7
19
9
10
null
null
tonyfloatersu/solution-haskell-craft-of-FP
PicturesSVG.hs
mit
black = Img $ Image (Name "black.jpg") (50, 50)
47
black = Img $ Image (Name "black.jpg") (50, 50)
47
black = Img $ Image (Name "black.jpg") (50, 50)
47
false
false
3
7
8
32
14
18
null
null
phylake/avm3
abc/json2.hs
mit
nsinfo_raw s_res (NSInfo_PrivateNs a) = s_res a
56
nsinfo_raw s_res (NSInfo_PrivateNs a) = s_res a
56
nsinfo_raw s_res (NSInfo_PrivateNs a) = s_res a
56
false
false
0
7
15
21
9
12
null
null
bgwines/horse-control
src/Horse/Types.hs
bsd-3-clause
hasParent :: Commit -> Bool hasParent = isJust . parentHash
59
hasParent :: Commit -> Bool hasParent = isJust . parentHash
59
hasParent = isJust . parentHash
31
false
true
0
5
9
19
10
9
null
null
GaloisInc/pads-haskell
Examples/Regression.hs
bsd-3-clause
ppt36 = case pt36 of Left e -> show e ; Right r -> pretty 100 (ppDeclList r)
76
ppt36 = case pt36 of Left e -> show e ; Right r -> pretty 100 (ppDeclList r)
76
ppt36 = case pt36 of Left e -> show e ; Right r -> pretty 100 (ppDeclList r)
76
false
false
0
10
17
43
20
23
null
null
mightymoose/liquidhaskell
tests/pos/elements.hs
bsd-3-clause
elem x (y:ys) = x == y || elem x ys
35
elem x (y:ys) = x == y || elem x ys
35
elem x (y:ys) = x == y || elem x ys
35
false
false
0
7
10
31
15
16
null
null
mightymoose/liquidhaskell
benchmarks/icfp15/neg/WhileM.hs
bsd-3-clause
decrM :: RIO () {-@ decrM :: RIO <{\x -> true}, {\w1 x w2 -> counter w2 = (counter w1) - 1}> () @-} decrM = undefined
117
decrM :: RIO () decrM = undefined
33
decrM = undefined
17
true
true
0
7
26
23
10
13
null
null
ekmett/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcObject.hs
lgpl-2.1
-- | Is this a managed object? objectIsManaged :: Object a -> Bool objectIsManaged obj = case obj of Managed fp -> True _ -> False -- | Test for null object.
181
objectIsManaged :: Object a -> Bool objectIsManaged obj = case obj of Managed fp -> True _ -> False -- | Test for null object.
150
objectIsManaged obj = case obj of Managed fp -> True _ -> False -- | Test for null object.
114
true
true
0
8
55
48
22
26
null
null
sgillespie/ghc
compiler/codeGen/StgCmmPrim.hs
bsd-3-clause
emitPrimOp dflags res (VecIndexScalarOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOpAs Nothing vecty ty res args where vecty :: CmmType vecty = vecVmmType vcat n w ty :: CmmType ty = vecCmmCat vcat w
263
emitPrimOp dflags res (VecIndexScalarOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOpAs Nothing vecty ty res args where vecty :: CmmType vecty = vecVmmType vcat n w ty :: CmmType ty = vecCmmCat vcat w
263
emitPrimOp dflags res (VecIndexScalarOffAddrOp vcat n w) args = do checkVecCompatibility dflags vcat n w doIndexOffAddrOpAs Nothing vecty ty res args where vecty :: CmmType vecty = vecVmmType vcat n w ty :: CmmType ty = vecCmmCat vcat w
263
false
false
3
7
65
88
41
47
null
null
webcrank/webcrank.hs
test/DecisionTests.hs
bsd-3-clause
p11Tests :: TestTree p11Tests = decisionTestGroup "p11" "New resource?" [ testCase "True ==> 201 Created" $ let loc rd = rd { _reqDataRespHeaders = HashMap.singleton hLocation ["http://example.com/abc"] } aft = fst $ afterWith p11 resource req loc in aft @?= Done' created201 , testCase "...
390
p11Tests :: TestTree p11Tests = decisionTestGroup "p11" "New resource?" [ testCase "True ==> 201 Created" $ let loc rd = rd { _reqDataRespHeaders = HashMap.singleton hLocation ["http://example.com/abc"] } aft = fst $ afterWith p11 resource req loc in aft @?= Done' created201 , testCase "...
390
p11Tests = decisionTestGroup "p11" "New resource?" [ testCase "True ==> 201 Created" $ let loc rd = rd { _reqDataRespHeaders = HashMap.singleton hLocation ["http://example.com/abc"] } aft = fst $ afterWith p11 resource req loc in aft @?= Done' created201 , testCase "False ==> o20" $ ...
369
false
true
0
15
95
117
54
63
null
null
acowley/ghc
compiler/coreSyn/CoreStats.hs
bsd-3-clause
tyStats :: Type -> CoreStats tyStats ty = zeroCS { cs_ty = typeSize ty }
72
tyStats :: Type -> CoreStats tyStats ty = zeroCS { cs_ty = typeSize ty }
72
tyStats ty = zeroCS { cs_ty = typeSize ty }
43
false
true
0
8
14
38
17
21
null
null
dbueno/funsat
src/Funsat/Circuit.hs
bsd-3-clause
cordC cons prj upd x = do s <- get c:cs <- gets hashCount maybe (do let s' = upd (s{ hashCount = cs }) (Bimap.insert c x (prj s)) put s' -- trace "updating map" (return ()) return (cons c)) (return . cons) $ lookupv x (prj s)
302
recordC cons prj upd x = do s <- get c:cs <- gets hashCount maybe (do let s' = upd (s{ hashCount = cs }) (Bimap.insert c x (prj s)) put s' -- trace "updating map" (return ()) return (cons c)) (return . cons) $ lookupv x (prj s)
302
recordC cons prj upd x = do s <- get c:cs <- gets hashCount maybe (do let s' = upd (s{ hashCount = cs }) (Bimap.insert c x (prj s)) put s' -- trace "updating map" (return ()) return (cons c)) (return . cons) $ lookupv x (prj s)
302
false
false
1
19
125
137
62
75
null
null
byorgey/Idris-dev
src/IRTS/Lang.hs
bsd-3-clause
lambdaLift n x = [(n, x)]
25
lambdaLift n x = [(n, x)]
25
lambdaLift n x = [(n, x)]
25
false
false
0
6
5
20
11
9
null
null
forked-upstream-packages-for-ghcjs/ghc
libraries/base/tests/foldableArray.hs
bsd-3-clause
conses :: [Integer -> Integer -> Integer] conses = [(+), strictCons, rightLazyCons, leftLazyCons]
97
conses :: [Integer -> Integer -> Integer] conses = [(+), strictCons, rightLazyCons, leftLazyCons]
97
conses = [(+), strictCons, rightLazyCons, leftLazyCons]
55
false
true
0
7
12
36
22
14
null
null
jaspervdj/number-six
src/NumberSix/Handlers/Resto.hs
bsd-3-clause
-------------------------------------------------------------------------------- resto :: Text -> IO Text resto arg = do currentTime <- getCurrentTime let (d, e) = days arg time = currentTime {utctDay = d `addDays` utctDay currentTime} week = formatTime defaultTimeLocale "%V" time ...
1,316
resto :: Text -> IO Text resto arg = do currentTime <- getCurrentTime let (d, e) = days arg time = currentTime {utctDay = d `addDays` utctDay currentTime} week = formatTime defaultTimeLocale "%V" time day = formatTime defaultTimeLocale "%Y-%m-%d" time url = "http:...
1,235
resto arg = do currentTime <- getCurrentTime let (d, e) = days arg time = currentTime {utctDay = d `addDays` utctDay currentTime} week = formatTime defaultTimeLocale "%V" time day = formatTime defaultTimeLocale "%Y-%m-%d" time url = "http://zeus.ugent.be/hydra/api...
1,210
true
true
6
17
378
333
171
162
null
null
sdiehl/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
srcLocDataConName = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
82
srcLocDataConName = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
82
srcLocDataConName = dcQual gHC_STACK_TYPES (fsLit "SrcLoc") srcLocDataConKey
82
false
false
1
7
12
22
9
13
null
null
gbataille/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
mkImage :: String -> LP Inlines mkImage src = do let alt = str "image" case takeExtension src of "" -> do defaultExt <- getOption readerDefaultImageExtension return $ image (addExtension src defaultExt) "" alt _ -> return $ image src "" alt
291
mkImage :: String -> LP Inlines mkImage src = do let alt = str "image" case takeExtension src of "" -> do defaultExt <- getOption readerDefaultImageExtension return $ image (addExtension src defaultExt) "" alt _ -> return $ image src "" alt
291
mkImage src = do let alt = str "image" case takeExtension src of "" -> do defaultExt <- getOption readerDefaultImageExtension return $ image (addExtension src defaultExt) "" alt _ -> return $ image src "" alt
259
false
true
0
16
92
103
45
58
null
null
bgold-cosmos/Tidal
src/Sound/Tidal/Stream.hs
gpl-3.0
toData :: OSC -> Event ValueMap -> Maybe [O.Datum] toData (OSC {args = ArgList as}) e = fmap (fmap (toDatum)) $ sequence $ map (\(n,v) -> Map.lookup n (value e) <|> v) as
170
toData :: OSC -> Event ValueMap -> Maybe [O.Datum] toData (OSC {args = ArgList as}) e = fmap (fmap (toDatum)) $ sequence $ map (\(n,v) -> Map.lookup n (value e) <|> v) as
170
toData (OSC {args = ArgList as}) e = fmap (fmap (toDatum)) $ sequence $ map (\(n,v) -> Map.lookup n (value e) <|> v) as
119
false
true
1
12
32
110
55
55
null
null
danoctavian/bit-smuggler
BitSmuggler/src/Network/BitSmuggler/Client.hs
gpl-2.0
isStale = undefined
19
isStale = undefined
19
isStale = undefined
19
false
false
0
4
2
6
3
3
null
null
rueshyna/gogol
gogol-books/gen/Network/Google/Resource/Books/Bookshelves/List.hs
mpl-2.0
-- | ID of user for whom to retrieve bookshelves. blUserId :: Lens' BookshelvesList Text blUserId = lens _blUserId (\ s a -> s{_blUserId = a})
142
blUserId :: Lens' BookshelvesList Text blUserId = lens _blUserId (\ s a -> s{_blUserId = a})
92
blUserId = lens _blUserId (\ s a -> s{_blUserId = a})
53
true
true
0
9
25
40
22
18
null
null
wavewave/qft
old/lib/Topology/PrettyPrint.hs
gpl-3.0
makeTexFile :: [FilePath] -> String makeTexFile filenames = header ++ (intercalate "\n" . map makeTexFig) filenames ++ footer where header = "\\documentclass{revtex4}\n\\usepackage{graphicx}\n\\begin{document}\n" footer = "\n\\end{document}\n"
264
makeTexFile :: [FilePath] -> String makeTexFile filenames = header ++ (intercalate "\n" . map makeTexFig) filenames ++ footer where header = "\\documentclass{revtex4}\n\\usepackage{graphicx}\n\\begin{document}\n" footer = "\n\\end{document}\n"
264
makeTexFile filenames = header ++ (intercalate "\n" . map makeTexFig) filenames ++ footer where header = "\\documentclass{revtex4}\n\\usepackage{graphicx}\n\\begin{document}\n" footer = "\n\\end{document}\n"
228
false
true
4
9
45
70
30
40
null
null
alexvong1995/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
endOfCell :: OrgParser Char endOfCell = try $ char '|' <|> lookAhead newline
76
endOfCell :: OrgParser Char endOfCell = try $ char '|' <|> lookAhead newline
76
endOfCell = try $ char '|' <|> lookAhead newline
48
false
true
0
7
12
28
13
15
null
null
christiaanb/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey, typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey :: Unique typeableClassKey = mkPreludeClassUnique 20
217
typeableClassKey, typeable1ClassKey, typeable2ClassKey, typeable3ClassKey, typeable4ClassKey, typeable5ClassKey, typeable6ClassKey, typeable7ClassKey :: Unique typeableClassKey = mkPreludeClassUnique 20
217
typeableClassKey = mkPreludeClassUnique 20
49
false
true
0
5
28
28
21
7
null
null
mdsteele/fallback
src/Fallback/Data/TotalMap.hs
gpl-3.0
make :: (Bounded k, Ix k) => (k -> a) -> TotalMap k a make fn = unsafeFromList $ map fn $ range (minBound, maxBound)
116
make :: (Bounded k, Ix k) => (k -> a) -> TotalMap k a make fn = unsafeFromList $ map fn $ range (minBound, maxBound)
116
make fn = unsafeFromList $ map fn $ range (minBound, maxBound)
62
false
true
0
8
24
65
33
32
null
null
HIPERFIT/futhark
src/Futhark/Test/Spec.hs
isc
parseTags :: Parser () -> Parser [T.Text] parseTags sep = lexeme' "tags" *> inBraces sep (many parseTag) <|> pure [] where parseTag = T.pack <$> lexeme sep (some $ satisfy tagConstituent)
193
parseTags :: Parser () -> Parser [T.Text] parseTags sep = lexeme' "tags" *> inBraces sep (many parseTag) <|> pure [] where parseTag = T.pack <$> lexeme sep (some $ satisfy tagConstituent)
193
parseTags sep = lexeme' "tags" *> inBraces sep (many parseTag) <|> pure [] where parseTag = T.pack <$> lexeme sep (some $ satisfy tagConstituent)
151
false
true
0
9
36
87
41
46
null
null
ethercrow/docopt.hs
System/Console/Docopt/ParseUtils.hs
mit
ellipsis :: CharParser u String ellipsis = inlineSpaces >> string "..." <?> "'...'"
92
ellipsis :: CharParser u String ellipsis = inlineSpaces >> string "..." <?> "'...'"
92
ellipsis = inlineSpaces >> string "..." <?> "'...'"
60
false
true
4
6
21
35
14
21
null
null
stevezhee/shootout
src/Shoot.hs
bsd-3-clause
bvar t i = Var t $ "%v" ++ show i
33
bvar t i = Var t $ "%v" ++ show i
33
bvar t i = Var t $ "%v" ++ show i
33
false
false
0
7
10
25
11
14
null
null
NICTA/validation
examples/src/PolymorphicEmail.hs
bsd-3-clause
-- Failure [MustContainAt] failurePeriod :: (Applicative (f [VError]), Validate f) => f [VError] Email failurePeriod = email "bob@gmailcom"
140
failurePeriod :: (Applicative (f [VError]), Validate f) => f [VError] Email failurePeriod = email "bob@gmailcom"
112
failurePeriod = email "bob@gmailcom"
36
true
true
0
9
18
47
25
22
null
null
jyp/MarXup
MarXup/Tex.hs
gpl-2.0
inBox :: Tex a -> Tex (a, BoxSpec) inBox = helpBox True
55
inBox :: Tex a -> Tex (a, BoxSpec) inBox = helpBox True
55
inBox = helpBox True
20
false
true
0
7
11
30
15
15
null
null
quakehead/haskell-scheme
Eval.hs
gpl-3.0
-- car, cdr, and cons ----------------------- -- -- car takes in a list of LispVals since car can syntactically take multiple -- arguments. e.g. if it was called with -- (car '(1 2) '(3 4)). In this case, it would throw an error. car :: [LispVal] -> ThrowsError LispVal car [List (x : xs)] = return x
308
car :: [LispVal] -> ThrowsError LispVal car [List (x : xs)] = return x
78
car [List (x : xs)] = return x
38
true
true
0
9
64
45
25
20
null
null
myShoggoth/shakespeare
Text/Hamlet/Parse.hs
mit
nestToDoc set (Nest (LineContent content avoidNewLine) inside:rest) docMode ident = do inside' <- nestToDoc set inside docMode ident rest' <- nestToDoc set rest docMode ident let newline' = DocContent $ ContentRaw $ case hamletNewlines set of { NoNewlines -> ""; _ -> if nextIsContent && n...
1,085
nestToDoc set (Nest (LineContent content avoidNewLine) inside:rest) docMode ident = do inside' <- nestToDoc set inside docMode ident rest' <- nestToDoc set rest docMode ident let newline' = DocContent $ ContentRaw $ case hamletNewlines set of { NoNewlines -> ""; _ -> if nextIsContent && n...
1,085
nestToDoc set (Nest (LineContent content avoidNewLine) inside:rest) docMode ident = do inside' <- nestToDoc set inside docMode ident rest' <- nestToDoc set rest docMode ident let newline' = DocContent $ ContentRaw $ case hamletNewlines set of { NoNewlines -> ""; _ -> if nextIsContent && n...
1,085
false
false
0
19
344
395
194
201
null
null
fugyk/cabal
cabal-install/Distribution/Client/Setup.hs
bsd-3-clause
fetchCommand :: CommandUI FetchFlags fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescriptio...
2,061
fetchCommand :: CommandUI FetchFlags fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescriptio...
2,061
fetchCommand = CommandUI { commandName = "fetch", commandSynopsis = "Downloads packages for later installation.", commandUsage = usageAlternatives "fetch" [ "[FLAGS] PACKAGES" ], commandDescription = Just $ \_ -> "Note tha...
2,024
false
true
0
15
738
381
222
159
null
null
rahulmutt/ghcvm
compiler/Eta/TypeCheck/TcType.hs
bsd-3-clause
toTcTypeBag :: Bag EvVar -> Bag EvVar -- All TyVars are transformed to TcTyVars toTcTypeBag evvars = mapBag (\tv -> setTyVarKind tv (toTcType (tyVarKind tv))) evvars
165
toTcTypeBag :: Bag EvVar -> Bag EvVar toTcTypeBag evvars = mapBag (\tv -> setTyVarKind tv (toTcType (tyVarKind tv))) evvars
123
toTcTypeBag evvars = mapBag (\tv -> setTyVarKind tv (toTcType (tyVarKind tv))) evvars
85
true
true
0
12
25
59
28
31
null
null
ssoudan/hsChess
src/Minimax.hs
apache-2.0
-- | Build the 'GameTree's for the next moves, evaluate their payoff and select the best one based on the player color. -- -- Thie method consumes a 'State' and return a 'State' with the history and the player updated. -- The depth of the 'GameTree's used for the evaluation is defined by 'defaultDepth'. -- -- Because o...
1,356
doMove :: SuperState -> SuperState doMove state = getState $ snd (optimizeBy compareOption options) where gt = getGameTree $ buildGameTree defaultDepth state doPlay g = (play g, g) options = map doPlay gt optimizeBy = case (getPlayer . fst) state of Whit...
416
doMove state = getState $ snd (optimizeBy compareOption options) where gt = getGameTree $ buildGameTree defaultDepth state doPlay g = (play g, g) options = map doPlay gt optimizeBy = case (getPlayer . fst) state of White -> minimumBy ...
381
true
true
0
10
426
135
82
53
null
null
hbrouwer/pdrt-sandbox
src/Data/DRS/Show.hs
apache-2.0
--------------------------------------------------------------------------- -- | Shows the conditions @c@ of a 'DRS'. --------------------------------------------------------------------------- showConditions :: [DRSCon] -> String showConditions [] = " "
254
showConditions :: [DRSCon] -> String showConditions [] = " "
60
showConditions [] = " "
23
true
true
0
8
20
32
16
16
null
null
brendanhay/gogol
gogol-texttospeech/gen/Network/Google/Resource/TextToSpeech/Voices/List.hs
mpl-2.0
-- | Optional. Recommended. -- [BCP-47](https:\/\/www.rfc-editor.org\/rfc\/bcp\/bcp47.txt) language -- tag. If not specified, the API will return all supported voices. If -- specified, the ListVoices call will only return voices that can be used -- to synthesize this language_code. E.g. when specifying \"en-NZ\", you -...
733
vlLanguageCode :: Lens' VoicesList (Maybe Text) vlLanguageCode = lens _vlLanguageCode (\ s a -> s{_vlLanguageCode = a})
127
vlLanguageCode = lens _vlLanguageCode (\ s a -> s{_vlLanguageCode = a})
79
true
true
0
8
106
57
33
24
null
null
Palmik/data-store
benchmarks/src/DS/B01.hs
bsd-3-clause
lookupOMEQLens :: Int -> DS -> [C01] lookupOMEQLens x o = S.elements (o ^. with (sD2 .== x))
92
lookupOMEQLens :: Int -> DS -> [C01] lookupOMEQLens x o = S.elements (o ^. with (sD2 .== x))
92
lookupOMEQLens x o = S.elements (o ^. with (sD2 .== x))
55
false
true
0
10
17
49
25
24
null
null
rdnetto/persistent
persistent/Database/Persist/Class/PersistUnique.hs
mit
onlyUnique :: (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend) => record -> ReaderT backend m (Unique record) onlyUnique record = case onlyUniqueEither record of Right u -> return u Left us -> requireUniques record us >>= liftIO . throwIO . OnlyUniqueException . show . len...
323
onlyUnique :: (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend) => record -> ReaderT backend m (Unique record) onlyUnique record = case onlyUniqueEither record of Right u -> return u Left us -> requireUniques record us >>= liftIO . throwIO . OnlyUniqueException . show . len...
323
onlyUnique record = case onlyUniqueEither record of Right u -> return u Left us -> requireUniques record us >>= liftIO . throwIO . OnlyUniqueException . show . length
174
false
true
0
13
63
107
51
56
null
null
termite2/tsl
Frontend/Inline.hs
bsd-3-clause
mkRetVarDecl :: (?spec::Spec) => Maybe PrID -> Method -> Maybe I.Var mkRetVarDecl mpid meth = case methRettyp meth of Nothing -> Nothing Just t -> Just $ I.Var False I.VarState ...
485
mkRetVarDecl :: (?spec::Spec) => Maybe PrID -> Method -> Maybe I.Var mkRetVarDecl mpid meth = case methRettyp meth of Nothing -> Nothing Just t -> Just $ I.Var False I.VarState ...
485
mkRetVarDecl mpid meth = case methRettyp meth of Nothing -> Nothing Just t -> Just $ I.Var False I.VarState (mkVarNameS (NSID mpid (Just meth)) "$ret")...
416
false
true
0
15
265
120
59
61
null
null
BartAdv/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
highestFC (PApp fc _ _) = Just fc
33
highestFC (PApp fc _ _) = Just fc
33
highestFC (PApp fc _ _) = Just fc
33
false
false
0
7
7
22
10
12
null
null
stoimenoff/functional-programming
examples/sorting.hs
mit
deleteFirst x (y:ys) | x == y = ys | otherwise = y : (deleteFirst x ys)
79
deleteFirst x (y:ys) | x == y = ys | otherwise = y : (deleteFirst x ys)
79
deleteFirst x (y:ys) | x == y = ys | otherwise = y : (deleteFirst x ys)
79
false
false
0
8
24
49
23
26
null
null
DanielOberg/case-in-point
CaseInPoint.hs
bsd-3-clause
tryTestCase :: FilePath -> (String, String) -> IO (Maybe String) tryTestCase f c@(example, expected_result) = do session <- runTestCase f c case session of Left e -> return $ Just ("Compilation error: \n" ++ f ++ " :" ++ combineIntoEqualTest example expected_result ++ ...
1,064
tryTestCase :: FilePath -> (String, String) -> IO (Maybe String) tryTestCase f c@(example, expected_result) = do session <- runTestCase f c case session of Left e -> return $ Just ("Compilation error: \n" ++ f ++ " :" ++ combineIntoEqualTest example expected_result ++ ...
1,064
tryTestCase f c@(example, expected_result) = do session <- runTestCase f c case session of Left e -> return $ Just ("Compilation error: \n" ++ f ++ " :" ++ combineIntoEqualTest example expected_result ++ " make sure it works in ghci.") Right Nothing ->...
999
false
true
0
19
357
199
101
98
null
null
lueck/htcf
src/HTCF/TokenLayer.hs
gpl-3.0
-- * Arrows for reading a tcf token layer. parseTokens :: (ArrowXml a) => [Config] -> Int -> Int -> a XmlTree Token parseTokens cfg pfxLen base = --traceMsg 1 ("Parsing token layer with prefix length " ++ (show pfxLen) ++ " and base " ++ (show base)) >>> isElem >>> hasQNameCase (mkNsName "tokens" $ getTcfTextCorp...
387
parseTokens :: (ArrowXml a) => [Config] -> Int -> Int -> a XmlTree Token parseTokens cfg pfxLen base = --traceMsg 1 ("Parsing token layer with prefix length " ++ (show pfxLen) ++ " and base " ++ (show base)) >>> isElem >>> hasQNameCase (mkNsName "tokens" $ getTcfTextCorpusNamespace cfg) >>> getChildren >>> par...
343
parseTokens cfg pfxLen base = --traceMsg 1 ("Parsing token layer with prefix length " ++ (show pfxLen) ++ " and base " ++ (show base)) >>> isElem >>> hasQNameCase (mkNsName "tokens" $ getTcfTextCorpusNamespace cfg) >>> getChildren >>> parseToken cfg pfxLen base
270
true
true
0
11
73
84
42
42
null
null
markhibberd/boltjs-refactor
test/Language/JavaScript/Bolt/Tests.hs
bsd-3-clause
main :: IO () main = defaultMain [test]
43
main :: IO () main = defaultMain [test]
43
main = defaultMain [test]
27
false
true
0
6
11
22
11
11
null
null
wavewave/ghcjs-vdom
example/Example.hs
mit
render :: State -> VNode render s = div (cls "state") [ch|pixelDiv,numDiv|] where xd = textDiv (y s) yd = textDiv (x s) numDiv = div (cls "numeric") [ch|xd,yd|] pixelDiv = div (cls "pixels") . mkChildren $ map (renderRowM (w s) . (pixels s IM.!)) [0..h s-1]
309
render :: State -> VNode render s = div (cls "state") [ch|pixelDiv,numDiv|] where xd = textDiv (y s) yd = textDiv (x s) numDiv = div (cls "numeric") [ch|xd,yd|] pixelDiv = div (cls "pixels") . mkChildren $ map (renderRowM (w s) . (pixels s IM.!)) [0..h s-1]
309
render s = div (cls "state") [ch|pixelDiv,numDiv|] where xd = textDiv (y s) yd = textDiv (x s) numDiv = div (cls "numeric") [ch|xd,yd|] pixelDiv = div (cls "pixels") . mkChildren $ map (renderRowM (w s) . (pixels s IM.!)) [0..h s-1]
284
false
true
4
10
98
167
78
89
null
null
AccelerateHS/accelerate-cuda
Data/Array/Accelerate/CUDA/Analysis/Launch.hs
bsd-3-clause
sharedMem _ Map{} _ = 0
44
sharedMem _ Map{} _ = 0
44
sharedMem _ Map{} _ = 0
44
false
false
1
5
26
17
8
9
null
null
Jugendhackt/haskell-ricochet
src/Network/Ricochet/Connection.hs
gpl-3.0
pickVersion :: Connection -> Ricochet () pickVersion connection = do availableVersions <- use versions response <- liftIO . awaitIntroMessage availableVersions $ connection ^. cHandle case fmap (first M.toList) response of -- No matching versions Just ([], rest) -> do liftIO . B.hPutStr (connection ...
931
pickVersion :: Connection -> Ricochet () pickVersion connection = do availableVersions <- use versions response <- liftIO . awaitIntroMessage availableVersions $ connection ^. cHandle case fmap (first M.toList) response of -- No matching versions Just ([], rest) -> do liftIO . B.hPutStr (connection ...
931
pickVersion connection = do availableVersions <- use versions response <- liftIO . awaitIntroMessage availableVersions $ connection ^. cHandle case fmap (first M.toList) response of -- No matching versions Just ([], rest) -> do liftIO . B.hPutStr (connection ^. cHandle) $ B.singleton 0xFF clos...
890
false
true
0
18
209
257
123
134
null
null
takano-akio/hdevtools
src/CommandArgs.hs
mit
cabalVersion :: String cabalVersion = "cabal-" ++ VERSION_Cabal
67
cabalVersion :: String cabalVersion = "cabal-" ++ VERSION_Cabal
67
cabalVersion = "cabal-" ++ VERSION_Cabal
44
false
true
0
5
11
15
8
7
null
null
nikki-and-the-robots/nikki
src/Profiling/FPS.hs
lgpl-3.0
erminate :: Configuration -> IO () terminate config | graphics_profiling config = hFlush logHandle >> hClose logHandle
127
terminate :: Configuration -> IO () terminate config | graphics_profiling config = hFlush logHandle >> hClose logHandle
127
terminate config | graphics_profiling config = hFlush logHandle >> hClose logHandle
91
false
true
0
8
25
42
18
24
null
null
HugoDaniel/GLHUI
Graphics/UI/GLWindow.hs
bsd-3-clause
frame :: IO (Integer) frame = fromIntegral <$> c_frame
54
frame :: IO (Integer) frame = fromIntegral <$> c_frame
54
frame = fromIntegral <$> c_frame
32
false
true
0
6
8
21
11
10
null
null
sdiehl/ghc
compiler/GHC/Hs/Binds.hs
bsd-3-clause
isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool isEmptyIPBindsTc (IPBinds ds is) = null is && isEmptyTcEvBinds ds
109
isEmptyIPBindsTc :: HsIPBinds GhcTc -> Bool isEmptyIPBindsTc (IPBinds ds is) = null is && isEmptyTcEvBinds ds
109
isEmptyIPBindsTc (IPBinds ds is) = null is && isEmptyTcEvBinds ds
65
false
true
0
7
15
39
18
21
null
null
Jonplussed/iCalendar
src/Text/ICalendar/Parser/Combinator.hs
bsd-3-clause
lineBreak :: Parser String lineBreak = string "\r\n"
52
lineBreak :: Parser String lineBreak = string "\r\n"
52
lineBreak = string "\r\n"
25
false
true
0
6
7
23
9
14
null
null
ulan/hisp
level0/Hisp0.hs
unlicense
mkFalse = Atom "false"
22
mkFalse = Atom "false"
22
mkFalse = Atom "false"
22
false
false
0
5
3
9
4
5
null
null
geekingfrog/advent-of-code
src/Y2017/Day20.hs
bsd-3-clause
answer2 = do ps <- parseInput let allParticules = iterate (removeCollided . fmap step) ps -- 100 is arbitrarily chosen, not super clean but it works™ print $ length $ allParticules !! 100
203
answer2 = do ps <- parseInput let allParticules = iterate (removeCollided . fmap step) ps -- 100 is arbitrarily chosen, not super clean but it works™ print $ length $ allParticules !! 100
203
answer2 = do ps <- parseInput let allParticules = iterate (removeCollided . fmap step) ps -- 100 is arbitrarily chosen, not super clean but it works™ print $ length $ allParticules !! 100
203
false
false
0
13
48
53
25
28
null
null
brendanhay/gogol
gogol-servicenetworking/gen/Network/Google/Resource/ServiceNetworking/Services/Roles/Add.hs
mpl-2.0
-- | Multipart request metadata. sraPayload :: Lens' ServicesRolesAdd AddRolesRequest sraPayload = lens _sraPayload (\ s a -> s{_sraPayload = a})
147
sraPayload :: Lens' ServicesRolesAdd AddRolesRequest sraPayload = lens _sraPayload (\ s a -> s{_sraPayload = a})
114
sraPayload = lens _sraPayload (\ s a -> s{_sraPayload = a})
61
true
true
0
9
22
42
22
20
null
null
agocorona/MFlow
Demos/IncreaseString.hs
bsd-3-clause
clicks s= do s' <- page $ p << b << "increase a String" ++> p << b << "press the back button to go back to the menu" ++>(getString (Just s) <* submitButton "submit") `validate` (\s -> return $ if length s > 5 then Just (b << "length must be < 5") else Nothing...
343
clicks s= do s' <- page $ p << b << "increase a String" ++> p << b << "press the back button to go back to the menu" ++>(getString (Just s) <* submitButton "submit") `validate` (\s -> return $ if length s > 5 then Just (b << "length must be < 5") else Nothing...
343
clicks s= do s' <- page $ p << b << "increase a String" ++> p << b << "press the back button to go back to the menu" ++>(getString (Just s) <* submitButton "submit") `validate` (\s -> return $ if length s > 5 then Just (b << "length must be < 5") else Nothing...
343
false
false
1
15
124
122
59
63
null
null
toddmohney/branch-deleter
src/Git.hs
mit
parseResult :: (ExitCode, String, String) -> Either GitError Text parseResult (ExitSuccess, stdout, stderr) = Right(Text.pack $ stderr ++ stdout)
145
parseResult :: (ExitCode, String, String) -> Either GitError Text parseResult (ExitSuccess, stdout, stderr) = Right(Text.pack $ stderr ++ stdout)
145
parseResult (ExitSuccess, stdout, stderr) = Right(Text.pack $ stderr ++ stdout)
79
false
true
0
9
18
57
31
26
null
null
noughtmare/yi
yi-language/src/Yi/Lexer/Alex.hs
gpl-2.0
-- | Combine a character scanner with a lexer to produce a token -- scanner. May be used together with 'mkHighlighter' to produce a -- 'Highlighter', or with 'linearSyntaxMode' to produce a 'Mode'. lexScanner :: Lexer l s t i -> CharScanner -> Scanner (l s) t lexScanner Lexer {..} src = Scanner { scanLooked = _looked...
650
lexScanner :: Lexer l s t i -> CharScanner -> Scanner (l s) t lexScanner Lexer {..} src = Scanner { scanLooked = _looked , scanInit = _starting _startingState 0 startPosn , scanRun = \st -> case posnOfs $ _statePosn st of 0 -> unfoldLexer _step (st, _withChars '\n' $ scanRun src 0) ofs -> case scanRun...
452
lexScanner Lexer {..} src = Scanner { scanLooked = _looked , scanInit = _starting _startingState 0 startPosn , scanRun = \st -> case posnOfs $ _statePosn st of 0 -> unfoldLexer _step (st, _withChars '\n' $ scanRun src 0) ofs -> case scanRun src (ofs -1) of [] -> [] (_, ch) : rest -> un...
390
true
true
0
17
150
199
103
96
null
null
pdmurray/haskell-book-ex
src/ch3/exercises3.hs
bsd-3-clause
curryString :: String curryString = "Curry is awesome"
54
curryString :: String curryString = "Curry is awesome"
54
curryString = "Curry is awesome"
32
false
true
0
4
7
11
6
5
null
null
pascal-knodel/haskell-craft
_/links/E'9'11.hs
mit
-- Ex. 9.7: prop_SumReverse :: [Integer] -> Bool prop_SumReverse integerList = sum ( reverse integerList ) == sum integerList
130
prop_SumReverse :: [Integer] -> Bool prop_SumReverse integerList = sum ( reverse integerList ) == sum integerList
116
prop_SumReverse integerList = sum ( reverse integerList ) == sum integerList
79
true
true
0
8
23
38
19
19
null
null
clarissalittler/randomimages
Shapes.hs
gpl-2.0
mirrorH (Horizontal s1 s2) = Vertical (mirrorH s2) (mirrorH s1)
63
mirrorH (Horizontal s1 s2) = Vertical (mirrorH s2) (mirrorH s1)
63
mirrorH (Horizontal s1 s2) = Vertical (mirrorH s2) (mirrorH s1)
63
false
false
0
7
9
34
16
18
null
null
fatuhoku/haskell-noughts-and-crosses
src/NAA/Logic.hs
bsd-3-clause
apply :: BoardState -> Move -> BoardState apply bs@(BoardState {board=(Board brd),turn=p'}) (p,coord) | p == p' = bs {board=Board $ brd // [(coord,Piece p)],turn=other p} | otherwise = error $ "apply: player " ++ show p ++ " tried to move when it's actually " ++ show p' ++"'s turn...
322
apply :: BoardState -> Move -> BoardState apply bs@(BoardState {board=(Board brd),turn=p'}) (p,coord) | p == p' = bs {board=Board $ brd // [(coord,Piece p)],turn=other p} | otherwise = error $ "apply: player " ++ show p ++ " tried to move when it's actually " ++ show p' ++"'s turn...
322
apply bs@(BoardState {board=(Board brd),turn=p'}) (p,coord) | p == p' = bs {board=Board $ brd // [(coord,Piece p)],turn=other p} | otherwise = error $ "apply: player " ++ show p ++ " tried to move when it's actually " ++ show p' ++"'s turn!"
280
false
true
22
13
88
143
73
70
null
null
hargettp/paxos
src/Control/Consensus/Paxos.hs
mit
proposition :: Protocol d -> Decree d -> Paxos d Bool proposition p d = do (members,proposal,proposed) <- safely $ do proposed <- getNextProposedBallotNumber ledger <- get instId <- getInstanceId let proposal = Proposal { proposalInstanceId = instId, proposedBallotNumber = proposed...
735
proposition :: Protocol d -> Decree d -> Paxos d Bool proposition p d = do (members,proposal,proposed) <- safely $ do proposed <- getNextProposedBallotNumber ledger <- get instId <- getInstanceId let proposal = Proposal { proposalInstanceId = instId, proposedBallotNumber = proposed...
735
proposition p d = do (members,proposal,proposed) <- safely $ do proposed <- getNextProposedBallotNumber ledger <- get instId <- getInstanceId let proposal = Proposal { proposalInstanceId = instId, proposedBallotNumber = proposed, proposedDecree = d } mem...
681
false
true
0
20
223
233
112
121
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB :: GLenum gl_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A
94
gl_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB :: GLenum gl_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A
94
gl_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A
46
false
true
0
4
5
11
6
5
null
null
phaazon/OpenGLRaw
src/Graphics/Rendering/OpenGL/Raw/Tokens.hs
bsd-3-clause
gl_RENDERBUFFER_COVERAGE_SAMPLES_NV :: GLenum gl_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB
90
gl_RENDERBUFFER_COVERAGE_SAMPLES_NV :: GLenum gl_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB
90
gl_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB
44
false
true
0
4
5
11
6
5
null
null
xmonad/xmonad-contrib
XMonad/Config/Bluetile.hs
bsd-3-clause
bluetileManageHook :: ManageHook bluetileManageHook = composeAll [ workspaceByPos, positionStoreManageHook (Just defaultThemeWithButtons) , className =? "MPlayer" --> doFloat , isFullscreen --> doFullFloat]
253
bluetileManageHook :: ManageHook bluetileManageHook = composeAll [ workspaceByPos, positionStoreManageHook (Just defaultThemeWithButtons) , className =? "MPlayer" --> doFloat , isFullscreen --> doFullFloat]
253
bluetileManageHook = composeAll [ workspaceByPos, positionStoreManageHook (Just defaultThemeWithButtons) , className =? "MPlayer" --> doFloat , isFullscreen --> doFullFloat]
220
false
true
0
9
67
47
25
22
null
null
lamdu/lamdu
src/Lamdu/Sugar/Names/Walk.hs
gpl-3.0
isGlobal _ = False
18
isGlobal _ = False
18
isGlobal _ = False
18
false
false
0
4
3
10
4
6
null
null
OS2World/DEV-UTIL-HUGS
demos/Expr.hs
bsd-3-clause
-- Putting the initial prefix parser first: -- eval "1" (96 reductions, 168 cells) -- eval "(1)" (191 reductions, 335 cells) -- eval "((1))" (283 reductions, 498 cells) -- eval "(((1)))" (375 reductions, 661 cells) -- eval "1+2+3+4+5" (472 reductions, 905 cells) -- eval "1+" (124 ...
525
expr = term &&& (tok "+" &&& expr >>> (\(p,y) -> (+y)) ||| tok "-" &&& expr >>> (\(m,y) -> subtract y) ||| result id) >>> \(n,f) -> f n
181
expr = term &&& (tok "+" &&& expr >>> (\(p,y) -> (+y)) ||| tok "-" &&& expr >>> (\(m,y) -> subtract y) ||| result id) >>> \(n,f) -> f n
181
true
false
0
15
164
106
61
45
null
null
dagle/hermite
src/System/Hermite/Tabs.hs
bsd-3-clause
liftTermIndex :: NotebookClass self => (Terminal -> IO b) -> Int -> self -> IO b liftTermIndex f i note = do w <- notebookGetNthPage note i case w of (Just w') -> f (castToTerminal w') Nothing -> do Just w' <- notebookGetNthPage note 0 f (castToTerminal ...
323
liftTermIndex :: NotebookClass self => (Terminal -> IO b) -> Int -> self -> IO b liftTermIndex f i note = do w <- notebookGetNthPage note i case w of (Just w') -> f (castToTerminal w') Nothing -> do Just w' <- notebookGetNthPage note 0 f (castToTerminal ...
323
liftTermIndex f i note = do w <- notebookGetNthPage note i case w of (Just w') -> f (castToTerminal w') Nothing -> do Just w' <- notebookGetNthPage note 0 f (castToTerminal w')
233
false
true
0
16
113
129
57
72
null
null
romanb/aws
Aws/DynamoDb/Core.hs
bsd-3-clause
getAttr' :: forall a. (Typeable a, DynVal a) => T.Text -- ^ Attribute name -> Item -- ^ Item from DynamoDb -> Parser (Maybe a) getAttr' k m = do case M.lookup k m of Nothing -> return Nothing Just dv -> return $ fromValue dv -----------------------------------------------------...
421
getAttr' :: forall a. (Typeable a, DynVal a) => T.Text -- ^ Attribute name -> Item -- ^ Item from DynamoDb -> Parser (Maybe a) getAttr' k m = do case M.lookup k m of Nothing -> return Nothing Just dv -> return $ fromValue dv -----------------------------------------------------...
421
getAttr' k m = do case M.lookup k m of Nothing -> return Nothing Just dv -> return $ fromValue dv ------------------------------------------------------------------------------- -- | Parse an 'Item' into target type using the 'FromDynItem' -- instance.
270
false
true
0
12
101
104
51
53
null
null
Laar/haskell-src-exts-quickcheck
src/Test/QuickCheck/Instances/HaskellSrcExts/Generators.hs
bsd-3-clause
isPrim (Int _) = False
25
isPrim (Int _) = False
25
isPrim (Int _) = False
25
false
false
0
6
7
16
7
9
null
null
mauriciofierrom/cis194-homework
homework01/src/Basis.hs
mit
---------------------------------------------------------------------- -- Exercise 4 ---------------------------------------------------------------------- -- |which solves this problem in as few moves as possible. -- -- >>> validate 4012888888881881 -- True -- >>> validate 4012888888881882 -- False validate :: Integ...
401
validate :: Integer -> Bool validate x = (sumDigits . doubleEveryOther . toDigits) x `mod` 10 == 0
98
validate x = (sumDigits . doubleEveryOther . toDigits) x `mod` 10 == 0
70
true
true
0
10
48
51
31
20
null
null
dsalisbury/xmobar
src/Plugins/Monitors/Net.hs
bsd-3-clause
runNets :: [(NetDevRef, String)] -> [String] -> Monitor String runNets refs argv = do dev <- io $ parseActive refs opts <- io $ parseOpts argv printNet opts dev where parseActive refs' = liftM selectActive (parseNets refs') selectActive = maximum
267
runNets :: [(NetDevRef, String)] -> [String] -> Monitor String runNets refs argv = do dev <- io $ parseActive refs opts <- io $ parseOpts argv printNet opts dev where parseActive refs' = liftM selectActive (parseNets refs') selectActive = maximum
267
runNets refs argv = do dev <- io $ parseActive refs opts <- io $ parseOpts argv printNet opts dev where parseActive refs' = liftM selectActive (parseNets refs') selectActive = maximum
204
false
true
0
9
60
101
49
52
null
null
polar-engine/polar-configfile
src/Polar/ConfigFile.hs
bsd-3-clause
options :: MonadError ConfigError m => ConfigParser -> SectionName -> m [OptionName] options cp x = maybeToEither (NoSection x, "options") $ do o <- Map.lookup x (content cp) return $ Map.keys o {- | Indicates whether the given option is present. Returns True ...
499
options :: MonadError ConfigError m => ConfigParser -> SectionName -> m [OptionName] options cp x = maybeToEither (NoSection x, "options") $ do o <- Map.lookup x (content cp) return $ Map.keys o {- | Indicates whether the given option is present. Returns True ...
499
options cp x = maybeToEither (NoSection x, "options") $ do o <- Map.lookup x (content cp) return $ Map.keys o {- | Indicates whether the given option is present. Returns True only if the given section is present AND the given option is present in that section. No special ...
401
false
true
0
12
135
93
43
50
null
null
d0kt0r0/Tidal
src/Sound/Tidal/old/Strategies.hs
gpl-3.0
{- normEv :: Event a -> Event a -> Event a normEv ev@(_, (s,e), _) ev'@(_, (s',e'), _) | not on && not off = [] -- shouldn't happen | on && off = splitEv ev' | not on && s' > sam s = [] | not off && e' < nextSam s = [(fst' ev, mapSnd' (mapSnd (min $ nextSam s)) ev, thd' ev)] where on = ons...
1,005
en :: [(Int, Int)] -> Pattern String -> Pattern String en ns p = stack $ map (\(i, (k, n)) -> _e k n (samples p (pure i))) $ enumerate ns
137
en ns p = stack $ map (\(i, (k, n)) -> _e k n (samples p (pure i))) $ enumerate ns
82
true
true
2
12
277
106
57
49
null
null