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
input-output-hk/pos-haskell-prototype
infra/src/Pos/Infra/Diffusion/Subscription/Subscriber.hs
mit
constantSubscriptionTarget :: Applicative m => target -> SubscriptionTarget m target constantSubscriptionTarget target = SubscriptionTarget (pure (Just (target, constantSubscriptionTarget target)))
201
constantSubscriptionTarget :: Applicative m => target -> SubscriptionTarget m target constantSubscriptionTarget target = SubscriptionTarget (pure (Just (target, constantSubscriptionTarget target)))
201
constantSubscriptionTarget target = SubscriptionTarget (pure (Just (target, constantSubscriptionTarget target)))
116
false
true
0
11
22
54
26
28
null
null
UCSD-PL/RefScript
src/Language/Rsc/Liquid/Environment.hs
bsd-3-clause
addFixpointBind g (SI x _ _ t) = do bs <- getCgBinds rbs <- getCgRevBinds let ibs0 = cge_fenv g -- Remove the old binding from IBindEnv of the CGEnv let ibs1 = case F.lookupSEnv x rbs of Just i -> F.deleteIBindEnv i ibs0 Nothing -> ibs0 -- Add Type Invariants (XXX: again?) t' <- addInvariant g t let r = rTypeSortedReft t' -- Update the Monad's BindEnv let (i, bs') = F.insertBindEnv x r bs -- Update the Monad's (Sym -> Bid) mapping let rbs' = F.insertSEnv x i rbs -- Set the Monad' envs setCgBinds bs' setCgRevBinds rbs' -- Update the CGEnv's IBindEnv let ibs2 = F.insertsIBindEnv [i] ibs1 return $ g { cge_fenv = ibs2 } -- | Get the conjunction of class invariants inherited from all ancestry --------------------------------------------------------------------------------
980
addFixpointBind g (SI x _ _ t) = do bs <- getCgBinds rbs <- getCgRevBinds let ibs0 = cge_fenv g -- Remove the old binding from IBindEnv of the CGEnv let ibs1 = case F.lookupSEnv x rbs of Just i -> F.deleteIBindEnv i ibs0 Nothing -> ibs0 -- Add Type Invariants (XXX: again?) t' <- addInvariant g t let r = rTypeSortedReft t' -- Update the Monad's BindEnv let (i, bs') = F.insertBindEnv x r bs -- Update the Monad's (Sym -> Bid) mapping let rbs' = F.insertSEnv x i rbs -- Set the Monad' envs setCgBinds bs' setCgRevBinds rbs' -- Update the CGEnv's IBindEnv let ibs2 = F.insertsIBindEnv [i] ibs1 return $ g { cge_fenv = ibs2 } -- | Get the conjunction of class invariants inherited from all ancestry --------------------------------------------------------------------------------
980
addFixpointBind g (SI x _ _ t) = do bs <- getCgBinds rbs <- getCgRevBinds let ibs0 = cge_fenv g -- Remove the old binding from IBindEnv of the CGEnv let ibs1 = case F.lookupSEnv x rbs of Just i -> F.deleteIBindEnv i ibs0 Nothing -> ibs0 -- Add Type Invariants (XXX: again?) t' <- addInvariant g t let r = rTypeSortedReft t' -- Update the Monad's BindEnv let (i, bs') = F.insertBindEnv x r bs -- Update the Monad's (Sym -> Bid) mapping let rbs' = F.insertSEnv x i rbs -- Set the Monad' envs setCgBinds bs' setCgRevBinds rbs' -- Update the CGEnv's IBindEnv let ibs2 = F.insertsIBindEnv [i] ibs1 return $ g { cge_fenv = ibs2 } -- | Get the conjunction of class invariants inherited from all ancestry --------------------------------------------------------------------------------
980
false
false
0
14
334
214
100
114
null
null
beni55/pwsafe
src/Action.hs
mit
putStrLn :: String -> ActionM () putStrLn = liftAction1 (IO.hPutStrLn . envHandle)
82
putStrLn :: String -> ActionM () putStrLn = liftAction1 (IO.hPutStrLn . envHandle)
82
putStrLn = liftAction1 (IO.hPutStrLn . envHandle)
49
false
true
0
8
11
32
16
16
null
null
FunctionalThinking/ninety-nine
src/Exercises.hs
mit
-- 62B atLevel :: Tree a -> Int -> [a] atLevel Empty _ = []
59
atLevel :: Tree a -> Int -> [a] atLevel Empty _ = []
52
atLevel Empty _ = []
20
true
true
0
9
14
39
18
21
null
null
agrafix/hackmanager
src/Hack/Manager/Collector.hs
bsd-3-clause
onHackageCheck :: T.Text -> IO Bool onHackageCheck projectName = do mgr <- C.newManager C.tlsManagerSettings initReq <- C.parseUrl ("https://hackage.haskell.org/package/" ++ T.unpack projectName) let tryGet = do resp <- C.httpNoBody initReq mgr return $ C.responseStatus resp == Http.ok200 tryGet `catch` \(_ :: SomeException) -> return False
400
onHackageCheck :: T.Text -> IO Bool onHackageCheck projectName = do mgr <- C.newManager C.tlsManagerSettings initReq <- C.parseUrl ("https://hackage.haskell.org/package/" ++ T.unpack projectName) let tryGet = do resp <- C.httpNoBody initReq mgr return $ C.responseStatus resp == Http.ok200 tryGet `catch` \(_ :: SomeException) -> return False
400
onHackageCheck projectName = do mgr <- C.newManager C.tlsManagerSettings initReq <- C.parseUrl ("https://hackage.haskell.org/package/" ++ T.unpack projectName) let tryGet = do resp <- C.httpNoBody initReq mgr return $ C.responseStatus resp == Http.ok200 tryGet `catch` \(_ :: SomeException) -> return False
364
false
true
0
16
101
131
60
71
null
null
GaloisInc/halvm-ghc
compiler/cmm/PprC.hs
bsd-3-clause
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then text "ASSIGN_BaseReg" <> parens x <> semi else pprReg r1 <> text " = " <> x <> semi -- --------------------------------------------------------------------- -- Registers
483
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then text "ASSIGN_BaseReg" <> parens x <> semi else pprReg r1 <> text " = " <> x <> semi -- --------------------------------------------------------------------- -- Registers
483
pprAssign _ r1 r2 | isFixedPtrReg r1 = mkAssign (mkP_ <> pprExpr1 r2) | Just ty <- strangeRegType r1 = mkAssign (parens ty <> pprExpr1 r2) | otherwise = mkAssign (pprExpr r2) where mkAssign x = if r1 == CmmGlobal BaseReg then text "ASSIGN_BaseReg" <> parens x <> semi else pprReg r1 <> text " = " <> x <> semi -- --------------------------------------------------------------------- -- Registers
483
false
false
1
9
152
148
68
80
null
null
bogwonch/SecPAL
src/Logic/General/Parser.hs
gpl-3.0
pString :: forall s u (m :: * -> *). Stream s m Char => ParsecT s u m E pString = (`Constant` []) <$> (char '"' *> many quotedChar <* char '"') where quotedChar = try (string "\\\"" >> return '"') <|> noneOf "\""
214
pString :: forall s u (m :: * -> *). Stream s m Char => ParsecT s u m E pString = (`Constant` []) <$> (char '"' *> many quotedChar <* char '"') where quotedChar = try (string "\\\"" >> return '"') <|> noneOf "\""
214
pString = (`Constant` []) <$> (char '"' *> many quotedChar <* char '"') where quotedChar = try (string "\\\"" >> return '"') <|> noneOf "\""
142
false
true
1
9
46
119
58
61
null
null
thoughtbot/carnival
test/IntegrationImport.hs
mit
waitForElem :: WebDriver m => Selector -> m Element waitForElem = waitUntil timeout . findElem where timeout = 2000
121
waitForElem :: WebDriver m => Selector -> m Element waitForElem = waitUntil timeout . findElem where timeout = 2000
121
waitForElem = waitUntil timeout . findElem where timeout = 2000
69
false
true
0
7
24
40
19
21
null
null
agobi/sizechecking
Tests/LambdaTest.hs
bsd-2-clause
const2 :: (Lambda l) => l ( Int -> Int ) const2 = lam $ \_ -> lit 2
67
const2 :: (Lambda l) => l ( Int -> Int ) const2 = lam $ \_ -> lit 2
67
const2 = lam $ \_ -> lit 2
26
false
true
2
9
18
48
23
25
null
null
Mahdi89/eTeak
src/Options.hs
bsd-3-clause
parseOptions :: CommandLineOptions state -> state -> [String] -> IO (state, [String]) parseOptions options state args = body args where optionList = optionOptions options body [] = return (state, []) body ("--":args) = return (state, args) body (name@('-':'-':longArg):args) = takeOption name args foundArg where foundArg = find (matchLong longArg) optionList body (name@['-', shortArg]:args) = takeOption name args foundArg where foundArg = find (matchShort shortArg) optionList body (name@('-':_:_):args) = takeOption name args Nothing body args = return (state, args) matchLong arg option@(CommandLineOption {}) = longNameGiven option && optionLongName option == arg matchLong _ _ = False matchShort arg option@(CommandLineOption {}) = shortNameGiven option && optionShortName option == arg matchShort _ _ = False takeOption name args Nothing = do optionUsage options $ "unrecognised command line option `" ++ name ++ "'" body args takeOption name args (Just option) | optionCount > argCount = do optionUsage options $ "too few arguments for option `" ++ name ++ "', " ++ show optionCount ++ " needed, only " ++ show argCount ++ " given" body [] | otherwise = do state' <- optionOperation option state theseArgs parseOptions options state' restArgs where argCount = length args (theseArgs, restArgs) = splitAt optionCount args optionCount = length $ optionArgNames option
1,822
parseOptions :: CommandLineOptions state -> state -> [String] -> IO (state, [String]) parseOptions options state args = body args where optionList = optionOptions options body [] = return (state, []) body ("--":args) = return (state, args) body (name@('-':'-':longArg):args) = takeOption name args foundArg where foundArg = find (matchLong longArg) optionList body (name@['-', shortArg]:args) = takeOption name args foundArg where foundArg = find (matchShort shortArg) optionList body (name@('-':_:_):args) = takeOption name args Nothing body args = return (state, args) matchLong arg option@(CommandLineOption {}) = longNameGiven option && optionLongName option == arg matchLong _ _ = False matchShort arg option@(CommandLineOption {}) = shortNameGiven option && optionShortName option == arg matchShort _ _ = False takeOption name args Nothing = do optionUsage options $ "unrecognised command line option `" ++ name ++ "'" body args takeOption name args (Just option) | optionCount > argCount = do optionUsage options $ "too few arguments for option `" ++ name ++ "', " ++ show optionCount ++ " needed, only " ++ show argCount ++ " given" body [] | otherwise = do state' <- optionOperation option state theseArgs parseOptions options state' restArgs where argCount = length args (theseArgs, restArgs) = splitAt optionCount args optionCount = length $ optionArgNames option
1,818
parseOptions options state args = body args where optionList = optionOptions options body [] = return (state, []) body ("--":args) = return (state, args) body (name@('-':'-':longArg):args) = takeOption name args foundArg where foundArg = find (matchLong longArg) optionList body (name@['-', shortArg]:args) = takeOption name args foundArg where foundArg = find (matchShort shortArg) optionList body (name@('-':_:_):args) = takeOption name args Nothing body args = return (state, args) matchLong arg option@(CommandLineOption {}) = longNameGiven option && optionLongName option == arg matchLong _ _ = False matchShort arg option@(CommandLineOption {}) = shortNameGiven option && optionShortName option == arg matchShort _ _ = False takeOption name args Nothing = do optionUsage options $ "unrecognised command line option `" ++ name ++ "'" body args takeOption name args (Just option) | optionCount > argCount = do optionUsage options $ "too few arguments for option `" ++ name ++ "', " ++ show optionCount ++ " needed, only " ++ show argCount ++ " given" body [] | otherwise = do state' <- optionOperation option state theseArgs parseOptions options state' restArgs where argCount = length args (theseArgs, restArgs) = splitAt optionCount args optionCount = length $ optionArgNames option
1,732
false
true
0
17
651
534
265
269
null
null
Lykos/Sara
src/lib/Sara/Codegen/CodeGenerator.hs
gpl-3.0
integerBits :: Word32 integerBits = 64
38
integerBits :: Word32 integerBits = 64
38
integerBits = 64
16
false
true
0
4
5
11
6
5
null
null
alexliew/learn_you_a_haskell
code/recursion.hs
unlicense
zip' :: [a] -> [b] -> [(a, b)] zip' _ [] = []
45
zip' :: [a] -> [b] -> [(a, b)] zip' _ [] = []
45
zip' _ [] = []
14
false
true
0
10
12
49
25
24
null
null
kazu-yamamoto/wai
time-manager/System/TimeManager.hs
mit
-- | Setting the state to canceled. -- 'Manager' eventually removes this without timeout action. cancel :: Handle -> IO () cancel (Handle actionRef stateRef) = do I.writeIORef actionRef (return ()) -- ensuring to release ThreadId I.writeIORef stateRef Canceled -- | Setting the state to paused. -- 'Manager' does not change the value.
347
cancel :: Handle -> IO () cancel (Handle actionRef stateRef) = do I.writeIORef actionRef (return ()) -- ensuring to release ThreadId I.writeIORef stateRef Canceled -- | Setting the state to paused. -- 'Manager' does not change the value.
248
cancel (Handle actionRef stateRef) = do I.writeIORef actionRef (return ()) -- ensuring to release ThreadId I.writeIORef stateRef Canceled -- | Setting the state to paused. -- 'Manager' does not change the value.
222
true
true
0
10
65
64
32
32
null
null
rolph-recto/HTurtle
src/HTurtle.hs
mit
-- step logo stepLogo :: Float -> TurtleState -> IO TurtleState stepLogo _ tstate = do let tstate' = updateZoom tstate replcmd <- fetchReplCmd case replcmd of Just cmdstr -> runCmd tstate' cmdstr Nothing -> return tstate' -- initial config
254
stepLogo :: Float -> TurtleState -> IO TurtleState stepLogo _ tstate = do let tstate' = updateZoom tstate replcmd <- fetchReplCmd case replcmd of Just cmdstr -> runCmd tstate' cmdstr Nothing -> return tstate' -- initial config
241
stepLogo _ tstate = do let tstate' = updateZoom tstate replcmd <- fetchReplCmd case replcmd of Just cmdstr -> runCmd tstate' cmdstr Nothing -> return tstate' -- initial config
190
true
true
0
10
54
78
36
42
null
null
byorgey/BlogLiterately
src/Text/BlogLiterately/Options.hs
gpl-3.0
htmlOnly' :: BlogLiterately -> Bool htmlOnly' = fromMaybe False . view htmlOnly
85
htmlOnly' :: BlogLiterately -> Bool htmlOnly' = fromMaybe False . view htmlOnly
85
htmlOnly' = fromMaybe False . view htmlOnly
49
false
true
0
6
17
25
12
13
null
null
HIPERFIT/futhark
src/Futhark/IR/Primitive.hs
isc
intByteSize Int32 = 4
21
intByteSize Int32 = 4
21
intByteSize Int32 = 4
21
false
false
1
5
3
13
4
9
null
null
ezyang/ghc
compiler/main/ErrUtils.hs
bsd-3-clause
printInfoForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO () printInfoForUser dflags print_unqual msg = logInfo dflags (mkUserStyle dflags print_unqual AllTheWay) msg
175
printInfoForUser :: DynFlags -> PrintUnqualified -> MsgDoc -> IO () printInfoForUser dflags print_unqual msg = logInfo dflags (mkUserStyle dflags print_unqual AllTheWay) msg
175
printInfoForUser dflags print_unqual msg = logInfo dflags (mkUserStyle dflags print_unqual AllTheWay) msg
107
false
true
0
9
23
52
25
27
null
null
shlevy/ghc
compiler/codeGen/StgCmmClosure.hs
bsd-3-clause
staticClosureLabel :: ClosureInfo -> CLabel staticClosureLabel = toClosureLbl . closureInfoLabel
97
staticClosureLabel :: ClosureInfo -> CLabel staticClosureLabel = toClosureLbl . closureInfoLabel
97
staticClosureLabel = toClosureLbl . closureInfoLabel
53
false
true
0
7
10
26
11
15
null
null
brendanhay/gogol
gogol-storage/gen/Network/Google/Resource/Storage/Buckets/Patch.hs
mpl-2.0
-- | The project to be billed for this request. Required for Requester Pays -- buckets. bpUserProject :: Lens' BucketsPatch (Maybe Text) bpUserProject = lens _bpUserProject (\ s a -> s{_bpUserProject = a})
213
bpUserProject :: Lens' BucketsPatch (Maybe Text) bpUserProject = lens _bpUserProject (\ s a -> s{_bpUserProject = a})
125
bpUserProject = lens _bpUserProject (\ s a -> s{_bpUserProject = a})
76
true
true
0
9
40
49
26
23
null
null
kim/amazonka
amazonka-rds/gen/Network/AWS/RDS/Waiters.hs
mpl-2.0
dbSnapshotCompleted :: Wait DescribeDBSnapshots dbSnapshotCompleted = Wait { _waitName = "DBSnapshotCompleted" , _waitAttempts = 40 , _waitDelay = 15 , _waitAcceptors = [ matchError "DBSnapshotNotFound" AcceptSuccess , matchAll "available" AcceptSuccess (folding (concatOf ddbsrDBSnapshots) . dbsStatus . _Just) ] }
381
dbSnapshotCompleted :: Wait DescribeDBSnapshots dbSnapshotCompleted = Wait { _waitName = "DBSnapshotCompleted" , _waitAttempts = 40 , _waitDelay = 15 , _waitAcceptors = [ matchError "DBSnapshotNotFound" AcceptSuccess , matchAll "available" AcceptSuccess (folding (concatOf ddbsrDBSnapshots) . dbsStatus . _Just) ] }
381
dbSnapshotCompleted = Wait { _waitName = "DBSnapshotCompleted" , _waitAttempts = 40 , _waitDelay = 15 , _waitAcceptors = [ matchError "DBSnapshotNotFound" AcceptSuccess , matchAll "available" AcceptSuccess (folding (concatOf ddbsrDBSnapshots) . dbsStatus . _Just) ] }
333
false
true
0
14
104
78
43
35
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/Functions/F05.hs
bsd-3-clause
ptr_glCurrentPaletteMatrixOES :: FunPtr (GLuint -> IO ()) ptr_glCurrentPaletteMatrixOES = unsafePerformIO $ getCommand "glCurrentPaletteMatrixOES"
146
ptr_glCurrentPaletteMatrixOES :: FunPtr (GLuint -> IO ()) ptr_glCurrentPaletteMatrixOES = unsafePerformIO $ getCommand "glCurrentPaletteMatrixOES"
146
ptr_glCurrentPaletteMatrixOES = unsafePerformIO $ getCommand "glCurrentPaletteMatrixOES"
88
false
true
0
9
12
33
16
17
null
null
LinusU/fbthrift
thrift/lib/hs/Thrift/Protocol/JSON.hs
apache-2.0
parseJSONValue T_I64 = TI64 <$> signed decimal
46
parseJSONValue T_I64 = TI64 <$> signed decimal
46
parseJSONValue T_I64 = TI64 <$> signed decimal
46
false
false
0
6
6
16
7
9
null
null
ingemaradahl/bilder
src/TypeChecker/Inferring.hs
lgpl-3.0
inferExp (EAssMul (EVar cid) tk e) = inferAssignment tk cid e
61
inferExp (EAssMul (EVar cid) tk e) = inferAssignment tk cid e
61
inferExp (EAssMul (EVar cid) tk e) = inferAssignment tk cid e
61
false
false
0
9
10
32
15
17
null
null
DougBurke/swish
tests/GraphTest.hs
lgpl-2.1
t12 = arc b2 p3 o1
18
t12 = arc b2 p3 o1
18
t12 = arc b2 p3 o1
18
false
false
1
5
5
16
6
10
null
null
atsukotakahashi/wi
src/library/Yi/Buffer/HighLevel.hs
gpl-2.0
lineStreamB :: Direction -> BufferM [YiString] lineStreamB dir = fmap rev . R.lines <$> (streamB dir =<< pointB) where rev = case dir of Forward -> id Backward -> R.reverse -- | Get the next line of text in the given direction. This returns -- simply 'Nothing' if there no such line.
302
lineStreamB :: Direction -> BufferM [YiString] lineStreamB dir = fmap rev . R.lines <$> (streamB dir =<< pointB) where rev = case dir of Forward -> id Backward -> R.reverse -- | Get the next line of text in the given direction. This returns -- simply 'Nothing' if there no such line.
302
lineStreamB dir = fmap rev . R.lines <$> (streamB dir =<< pointB) where rev = case dir of Forward -> id Backward -> R.reverse -- | Get the next line of text in the given direction. This returns -- simply 'Nothing' if there no such line.
255
false
true
0
8
70
75
38
37
null
null
fgaray/yesod-sass
src/Text/Sass/QQ.hs
bsd-3-clause
sass :: QuasiQuoter sass = qq "sass" exp where exp :: String -> Q Exp exp str = do css <- runIO $ compileSass Nothing str [| $(stringE css) |] -- | Quasiquoter that generate a yesod widget from Sass code --
251
sass :: QuasiQuoter sass = qq "sass" exp where exp :: String -> Q Exp exp str = do css <- runIO $ compileSass Nothing str [| $(stringE css) |] -- | Quasiquoter that generate a yesod widget from Sass code --
251
sass = qq "sass" exp where exp :: String -> Q Exp exp str = do css <- runIO $ compileSass Nothing str [| $(stringE css) |] -- | Quasiquoter that generate a yesod widget from Sass code --
231
false
true
0
9
86
75
34
41
null
null
ducis/haAni
hs/common/Graphics/UI/GLUT/Raw/Tokens.hs
gpl-2.0
glut_KEY_PAGE_DOWN :: CInt glut_KEY_PAGE_DOWN = 0x0069
54
glut_KEY_PAGE_DOWN :: CInt glut_KEY_PAGE_DOWN = 0x0069
54
glut_KEY_PAGE_DOWN = 0x0069
27
false
true
0
4
5
11
6
5
null
null
urbanslug/ghc
compiler/hsSyn/HsDecls.hs
bsd-3-clause
hsDeclHasCusk :: TyClDecl name -> Bool hsDeclHasCusk (FamDecl { tcdFam = fam_decl }) = famDeclHasCusk fam_decl
110
hsDeclHasCusk :: TyClDecl name -> Bool hsDeclHasCusk (FamDecl { tcdFam = fam_decl }) = famDeclHasCusk fam_decl
110
hsDeclHasCusk (FamDecl { tcdFam = fam_decl }) = famDeclHasCusk fam_decl
71
false
true
0
9
15
36
18
18
null
null
nushio3/ghc
libraries/base/Foreign/C/Error.hs
bsd-3-clause
eBADMSG = Errno (CONST_EBADMSG)
39
eBADMSG = Errno (CONST_EBADMSG)
39
eBADMSG = Errno (CONST_EBADMSG)
39
false
false
0
6
11
12
6
6
null
null
3of8/heap
Test/Heap/Common.hs
bsd-2-clause
functorProperty :: (Functor f, Eq (f a), Eq (f c)) => (b -> c) -> (a -> b) -> f a -> Bool functorProperty f g fun = fun == fmap id fun && fmap (f . g) fun == fmap f (fmap g fun)
181
functorProperty :: (Functor f, Eq (f a), Eq (f c)) => (b -> c) -> (a -> b) -> f a -> Bool functorProperty f g fun = fun == fmap id fun && fmap (f . g) fun == fmap f (fmap g fun)
181
functorProperty f g fun = fun == fmap id fun && fmap (f . g) fun == fmap f (fmap g fun)
91
false
true
0
9
48
122
61
61
null
null
cosbynator/haskakafka
tests/TestMain.hs
mit
shouldBeProduceConsume (KafkaProduceKeyedMessage pkey ppayload) m = do ppayload `shouldBe` (messagePayload m) (Just pkey) `shouldBe` (messageKey m)
151
shouldBeProduceConsume (KafkaProduceKeyedMessage pkey ppayload) m = do ppayload `shouldBe` (messagePayload m) (Just pkey) `shouldBe` (messageKey m)
151
shouldBeProduceConsume (KafkaProduceKeyedMessage pkey ppayload) m = do ppayload `shouldBe` (messagePayload m) (Just pkey) `shouldBe` (messageKey m)
151
false
false
0
9
19
55
28
27
null
null
jwiegley/github
samples/Repos/Commits/CommitComment.hs
bsd-3-clause
formatComment :: Github.Comment -> String formatComment comment = "Author: " ++ (formatAuthor $ Github.commentUser comment) ++ "\nUpdated: " ++ (show $ Github.commentUpdatedAt comment) ++ (maybe "" ("\nURL: "++) $ Github.commentHtmlUrl comment) ++ "\n\n" ++ (Github.commentBody comment)
300
formatComment :: Github.Comment -> String formatComment comment = "Author: " ++ (formatAuthor $ Github.commentUser comment) ++ "\nUpdated: " ++ (show $ Github.commentUpdatedAt comment) ++ (maybe "" ("\nURL: "++) $ Github.commentHtmlUrl comment) ++ "\n\n" ++ (Github.commentBody comment)
300
formatComment comment = "Author: " ++ (formatAuthor $ Github.commentUser comment) ++ "\nUpdated: " ++ (show $ Github.commentUpdatedAt comment) ++ (maybe "" ("\nURL: "++) $ Github.commentHtmlUrl comment) ++ "\n\n" ++ (Github.commentBody comment)
258
false
true
0
14
49
97
49
48
null
null
ddssff/pandoc
src/Text/Pandoc/Readers/Org.hs
gpl-2.0
simpleSubOrSuperString :: OrgParser String simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
200
simpleSubOrSuperString :: OrgParser String simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
200
simpleSubOrSuperString = try $ choice [ string "*" , mappend <$> option [] ((:[]) <$> oneOf "+-") <*> many1 alphaNum ]
157
false
true
0
14
63
64
32
32
null
null
gaetjen/FunFreakyPatMan
src/HasseTree.hs
mit
addCount :: Int -> HasseNode -> HasseNode addCount a (HasseTreeNode itm n c)= HasseTreeNode itm (n + a) c
105
addCount :: Int -> HasseNode -> HasseNode addCount a (HasseTreeNode itm n c)= HasseTreeNode itm (n + a) c
105
addCount a (HasseTreeNode itm n c)= HasseTreeNode itm (n + a) c
63
false
true
0
7
18
48
24
24
null
null
rahulmutt/ghcvm
compiler/Eta/BasicTypes/Name.hs
bsd-3-clause
nameIsHomePackageImport :: Module -> Name -> Bool -- True if the Name is defined in module of this package -- /other than/ the this_mod nameIsHomePackageImport this_mod = \nm -> case nameModule_maybe nm of Nothing -> False Just nm_mod -> nm_mod /= this_mod && moduleUnitId nm_mod == this_pkg where this_pkg = moduleUnitId this_mod
392
nameIsHomePackageImport :: Module -> Name -> Bool nameIsHomePackageImport this_mod = \nm -> case nameModule_maybe nm of Nothing -> False Just nm_mod -> nm_mod /= this_mod && moduleUnitId nm_mod == this_pkg where this_pkg = moduleUnitId this_mod
306
nameIsHomePackageImport this_mod = \nm -> case nameModule_maybe nm of Nothing -> False Just nm_mod -> nm_mod /= this_mod && moduleUnitId nm_mod == this_pkg where this_pkg = moduleUnitId this_mod
256
true
true
1
11
113
86
39
47
null
null
GaloisInc/sk-dev-platform
libs/SCD/src/SCD/M4/ModuleFiles.hs
bsd-3-clause
-- | Given a filename, read the interface, implementation and -- file-configuration files (by appending ".if", ".te", and ".fc" to -- the filename stripped from its extension). readPolicyModule :: FilePath -> IO PolicyModule readPolicyModule p = do let p' = dropExtension p i <- parseFile parseInterface interfaceExtension p' t <- parseFile parseImplementation implementationExtension p' let l = fst (getLayerModule p) lm = (l,implementationId t) f <- parseFile parseFileContexts fileContextExtension p' return PolicyModule{ layerModule = lm , interface = i , implementation = t , fileContexts = f , baseName = takeBaseName p' } -- | Extract the layer and the name from the filename prefix of a policy module
833
readPolicyModule :: FilePath -> IO PolicyModule readPolicyModule p = do let p' = dropExtension p i <- parseFile parseInterface interfaceExtension p' t <- parseFile parseImplementation implementationExtension p' let l = fst (getLayerModule p) lm = (l,implementationId t) f <- parseFile parseFileContexts fileContextExtension p' return PolicyModule{ layerModule = lm , interface = i , implementation = t , fileContexts = f , baseName = takeBaseName p' } -- | Extract the layer and the name from the filename prefix of a policy module
655
readPolicyModule p = do let p' = dropExtension p i <- parseFile parseInterface interfaceExtension p' t <- parseFile parseImplementation implementationExtension p' let l = fst (getLayerModule p) lm = (l,implementationId t) f <- parseFile parseFileContexts fileContextExtension p' return PolicyModule{ layerModule = lm , interface = i , implementation = t , fileContexts = f , baseName = takeBaseName p' } -- | Extract the layer and the name from the filename prefix of a policy module
607
true
true
0
13
233
157
78
79
null
null
DavidAlphaFox/ghc
libraries/Cabal/cabal-install/Distribution/Client/Dependency/Modular/Tree.hs
bsd-3-clause
out (FChoice p i b m ts) = FChoiceF p i b m ts
52
out (FChoice p i b m ts) = FChoiceF p i b m ts
52
out (FChoice p i b m ts) = FChoiceF p i b m ts
52
false
false
0
7
19
34
16
18
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * User separation daemonsGroup :: String daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup)
105
daemonsGroup :: String daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup)
83
daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup)
60
true
true
0
7
12
29
13
16
null
null
peterokagey/haskellOEIS
src/Sandbox/WichitaPoset/src/A999998.hs
apache-2.0
a999998_row :: Integer -> [Integer] a999998_row = Set.toAscList . parents
73
a999998_row :: Integer -> [Integer] a999998_row = Set.toAscList . parents
73
a999998_row = Set.toAscList . parents
37
false
true
0
6
9
24
13
11
null
null
silky/ImplicitCAD
tests/ParserSpec/Util.hs
gpl-2.0
num :: ℝ -> Expr num x -- note that the parser should handle negative number literals -- directly, we abstract that deficiency away here | x < 0 = app' "negate" [LitE $ ONum (-x)] | otherwise = LitE $ ONum x
215
num :: ℝ -> Expr num x -- note that the parser should handle negative number literals -- directly, we abstract that deficiency away here | x < 0 = app' "negate" [LitE $ ONum (-x)] | otherwise = LitE $ ONum x
215
num x -- note that the parser should handle negative number literals -- directly, we abstract that deficiency away here | x < 0 = app' "negate" [LitE $ ONum (-x)] | otherwise = LitE $ ONum x
198
false
true
1
11
50
64
32
32
null
null
abakst/symmetry
checker/src/cloud-haskell-tests/StateFactory.hs
mit
state_factory = do n1 <- any_nat funWithState <- factory n1 (\_ _ -> any_nat) n2 <- any_nat say $ "call_loop with " ++ (show (fromPeano n2)) ++ " times" call_loop n2 funWithState return ()
283
state_factory = do n1 <- any_nat funWithState <- factory n1 (\_ _ -> any_nat) n2 <- any_nat say $ "call_loop with " ++ (show (fromPeano n2)) ++ " times" call_loop n2 funWithState return ()
283
state_factory = do n1 <- any_nat funWithState <- factory n1 (\_ _ -> any_nat) n2 <- any_nat say $ "call_loop with " ++ (show (fromPeano n2)) ++ " times" call_loop n2 funWithState return ()
283
false
false
1
13
128
89
39
50
null
null
abbradar/aeson
Data/Aeson/Encode/Builder.hs
bsd-3-clause
encodeToBuilder (Object m) = object m
37
encodeToBuilder (Object m) = object m
37
encodeToBuilder (Object m) = object m
37
false
false
0
7
5
18
8
10
null
null
mmirman/haskogeneous
src/Main.hs
bsd-3-clause
main = withSocketsDo $ do socket <- listenOn $ PortNumber 1338 installHandler sigINT (Catch $ handler socket) Nothing sequence_ $ repeat $ do (h,_,_) <- accept socket forkIO $ do t <- page <$> msg hPutStr h $ t hFlush h hClose h
266
main = withSocketsDo $ do socket <- listenOn $ PortNumber 1338 installHandler sigINT (Catch $ handler socket) Nothing sequence_ $ repeat $ do (h,_,_) <- accept socket forkIO $ do t <- page <$> msg hPutStr h $ t hFlush h hClose h
266
main = withSocketsDo $ do socket <- listenOn $ PortNumber 1338 installHandler sigINT (Catch $ handler socket) Nothing sequence_ $ repeat $ do (h,_,_) <- accept socket forkIO $ do t <- page <$> msg hPutStr h $ t hFlush h hClose h
266
false
false
0
15
80
114
51
63
null
null
mightybyte/reflex-dom-stubs
src/GHCJS/DOM/HTMLSelectElement.hs
bsd-3-clause
htmlSelectElementSetLength = undefined
38
htmlSelectElementSetLength = undefined
38
htmlSelectElementSetLength = undefined
38
false
false
0
4
2
6
3
3
null
null
prt2121/haskell-practice
exercism/leap/LeapYear.hs
apache-2.0
-- Write a program that will take a year and report if it is a leap year. -- http://exercism.io/exercises/haskell/leap/readme isLeapYear :: Int -> Bool isLeapYear n = (n `mod` 4) == 0 && (n `mod` 100) /= 0 || (n `mod` 400) == 0
232
isLeapYear :: Int -> Bool isLeapYear n = (n `mod` 4) == 0 && (n `mod` 100) /= 0 || (n `mod` 400) == 0
101
isLeapYear n = (n `mod` 4) == 0 && (n `mod` 100) /= 0 || (n `mod` 400) == 0
75
true
true
0
11
48
67
39
28
null
null
donomii/srt-collector
srt2json.hs
gpl-3.0
printErr result = case result of Left val -> print (show val) Right val -> putStr ""
126
printErr result = case result of Left val -> print (show val) Right val -> putStr ""
126
printErr result = case result of Left val -> print (show val) Right val -> putStr ""
126
false
false
1
10
58
46
19
27
null
null
beni55/haste-compiler
libraries/ghc-7.8/base/Control/Arrow.hs
bsd-3-clause
returnA :: Arrow a => a b b returnA = arr id
44
returnA :: Arrow a => a b b returnA = arr id
44
returnA = arr id
16
false
true
0
7
11
32
13
19
null
null
nevrenato/Hets_Fork
utils/DrIFT-src/ChaseImports.hs
gpl-2.0
-- GHC version try :: IO a -> IO (Either IOError a) try x = catch (fmap Right x) (return . Left)
96
try :: IO a -> IO (Either IOError a) try x = catch (fmap Right x) (return . Left)
81
try x = catch (fmap Right x) (return . Left)
44
true
true
0
8
21
56
27
29
null
null
rahulmutt/ghcvm
compiler/Eta/Backpack/DriverBkp.hs
bsd-3-clause
compileInclude :: Int -> (Int, UnitId) -> BkpM () compileInclude n (i, uid) = do hsc_env <- getSession let dflags = hsc_dflags hsc_env msgInclude (i, n) uid -- Check if we've compiled it already case lookupPackage dflags uid of Nothing -> do case splitUnitIdInsts uid of (_, Just indef) -> innerBkpM $ compileUnit (indefUnitIdComponentId indef) (indefUnitIdInsts indef) _ -> return () Just _ -> return () -- ---------------------------------------------------------------------------- -- Backpack monad -- | Backpack monad is a 'GhcMonad' which also maintains a little extra state -- beyond the 'Session', c.f. 'BkpEnv'.
766
compileInclude :: Int -> (Int, UnitId) -> BkpM () compileInclude n (i, uid) = do hsc_env <- getSession let dflags = hsc_dflags hsc_env msgInclude (i, n) uid -- Check if we've compiled it already case lookupPackage dflags uid of Nothing -> do case splitUnitIdInsts uid of (_, Just indef) -> innerBkpM $ compileUnit (indefUnitIdComponentId indef) (indefUnitIdInsts indef) _ -> return () Just _ -> return () -- ---------------------------------------------------------------------------- -- Backpack monad -- | Backpack monad is a 'GhcMonad' which also maintains a little extra state -- beyond the 'Session', c.f. 'BkpEnv'.
766
compileInclude n (i, uid) = do hsc_env <- getSession let dflags = hsc_dflags hsc_env msgInclude (i, n) uid -- Check if we've compiled it already case lookupPackage dflags uid of Nothing -> do case splitUnitIdInsts uid of (_, Just indef) -> innerBkpM $ compileUnit (indefUnitIdComponentId indef) (indefUnitIdInsts indef) _ -> return () Just _ -> return () -- ---------------------------------------------------------------------------- -- Backpack monad -- | Backpack monad is a 'GhcMonad' which also maintains a little extra state -- beyond the 'Session', c.f. 'BkpEnv'.
716
false
true
0
18
236
168
83
85
null
null
olsner/ghc
compiler/basicTypes/MkId.hs
bsd-3-clause
{- ************************************************************************ * * \subsection{Primitive operations} * * ************************************************************************ -} mkPrimOpId :: PrimOp -> Id mkPrimOpId prim_op = id where (tyvars,arg_tys,res_ty, arity, strict_sig) = primOpSig prim_op ty = mkSpecForAllTys tyvars (mkFunTys arg_tys res_ty) name = mkWiredInName gHC_PRIM (primOpOcc prim_op) (mkPrimOpIdUnique (primOpTag prim_op)) (AnId id) UserSyntax id = mkGlobalId (PrimOpId prim_op) name ty info info = noCafIdInfo `setRuleInfo` mkRuleInfo (maybeToList $ primOpRules name prim_op) `setArityInfo` arity `setStrictnessInfo` strict_sig `setInlinePragInfo` neverInlinePragma -- We give PrimOps a NOINLINE pragma so that we don't -- get silly warnings from Desugar.dsRule (the inline_shadows_rule -- test) about a RULE conflicting with a possible inlining -- cf Trac #7287 -- For each ccall we manufacture a separate CCallOpId, giving it -- a fresh unique, a type that is correct for this particular ccall, -- and a CCall structure that gives the correct details about calling -- convention etc. -- -- The *name* of this Id is a local name whose OccName gives the full -- details of the ccall, type and all. This means that the interface -- file reader can reconstruct a suitable Id
1,654
mkPrimOpId :: PrimOp -> Id mkPrimOpId prim_op = id where (tyvars,arg_tys,res_ty, arity, strict_sig) = primOpSig prim_op ty = mkSpecForAllTys tyvars (mkFunTys arg_tys res_ty) name = mkWiredInName gHC_PRIM (primOpOcc prim_op) (mkPrimOpIdUnique (primOpTag prim_op)) (AnId id) UserSyntax id = mkGlobalId (PrimOpId prim_op) name ty info info = noCafIdInfo `setRuleInfo` mkRuleInfo (maybeToList $ primOpRules name prim_op) `setArityInfo` arity `setStrictnessInfo` strict_sig `setInlinePragInfo` neverInlinePragma -- We give PrimOps a NOINLINE pragma so that we don't -- get silly warnings from Desugar.dsRule (the inline_shadows_rule -- test) about a RULE conflicting with a possible inlining -- cf Trac #7287 -- For each ccall we manufacture a separate CCallOpId, giving it -- a fresh unique, a type that is correct for this particular ccall, -- and a CCall structure that gives the correct details about calling -- convention etc. -- -- The *name* of this Id is a local name whose OccName gives the full -- details of the ccall, type and all. This means that the interface -- file reader can reconstruct a suitable Id
1,321
mkPrimOpId prim_op = id where (tyvars,arg_tys,res_ty, arity, strict_sig) = primOpSig prim_op ty = mkSpecForAllTys tyvars (mkFunTys arg_tys res_ty) name = mkWiredInName gHC_PRIM (primOpOcc prim_op) (mkPrimOpIdUnique (primOpTag prim_op)) (AnId id) UserSyntax id = mkGlobalId (PrimOpId prim_op) name ty info info = noCafIdInfo `setRuleInfo` mkRuleInfo (maybeToList $ primOpRules name prim_op) `setArityInfo` arity `setStrictnessInfo` strict_sig `setInlinePragInfo` neverInlinePragma -- We give PrimOps a NOINLINE pragma so that we don't -- get silly warnings from Desugar.dsRule (the inline_shadows_rule -- test) about a RULE conflicting with a possible inlining -- cf Trac #7287 -- For each ccall we manufacture a separate CCallOpId, giving it -- a fresh unique, a type that is correct for this particular ccall, -- and a CCall structure that gives the correct details about calling -- convention etc. -- -- The *name* of this Id is a local name whose OccName gives the full -- details of the ccall, type and all. This means that the interface -- file reader can reconstruct a suitable Id
1,294
true
true
0
12
524
180
102
78
null
null
ezyang/ghc
hadrian/src/Oracles/PackageData.hs
bsd-3-clause
-- | For each @PackageData path@ the file 'path/package-data.mk' contains a line -- of the form 'path_VERSION = 1.2.3.4'. @pkgData (PackageData path)@ is an -- Action that consults the file and returns "1.2.3.4". pkgData :: PackageData -> Action String pkgData packageData = case packageData of BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB" -- | @PackageDataList path@ is used for multiple string options separated by -- spaces, such as @path_MODULES = Data.Array Data.Array.Base ...@. -- @pkgListData Modules@ therefore returns ["Data.Array", "Data.Array.Base", ...]
584
pkgData :: PackageData -> Action String pkgData packageData = case packageData of BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB" -- | @PackageDataList path@ is used for multiple string options separated by -- spaces, such as @path_MODULES = Data.Array Data.Array.Base ...@. -- @pkgListData Modules@ therefore returns ["Data.Array", "Data.Array.Base", ...]
371
pkgData packageData = case packageData of BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB" -- | @PackageDataList path@ is used for multiple string options separated by -- spaces, such as @path_MODULES = Data.Array Data.Array.Base ...@. -- @pkgListData Modules@ therefore returns ["Data.Array", "Data.Array.Base", ...]
331
true
true
0
8
84
48
25
23
null
null
pepeiborra/bytestring-xml
src/Text/Xml/Tiny/Internal.hs
bsd-3-clause
-- | Returns a list of indexes toList :: Config => Slice -> [Int] toList (Slice o l) = genericTake l [ fromIntegral o ..]
121
toList :: Config => Slice -> [Int] toList (Slice o l) = genericTake l [ fromIntegral o ..]
90
toList (Slice o l) = genericTake l [ fromIntegral o ..]
55
true
true
0
7
24
47
24
23
null
null
bkach/HaskellRaycaster
src/RayCaster/Render.hs
apache-2.0
reflectionColor :: Scene -> Ray -> Vector -> Object -> Int -> Color reflectionColor scene (Ray origin direction) hitPoint (Object shape _) reflections = let maxReflections = 2 reflectionDirection = Vector.reflect (Shapes.normalAtPoint hitPoint shape) direction reflectionRay = Ray hitPoint reflectionDirection in if reflections == maxReflections then Color 0 0 0 else traceRayReflect scene reflectionRay (reflections + 1)
459
reflectionColor :: Scene -> Ray -> Vector -> Object -> Int -> Color reflectionColor scene (Ray origin direction) hitPoint (Object shape _) reflections = let maxReflections = 2 reflectionDirection = Vector.reflect (Shapes.normalAtPoint hitPoint shape) direction reflectionRay = Ray hitPoint reflectionDirection in if reflections == maxReflections then Color 0 0 0 else traceRayReflect scene reflectionRay (reflections + 1)
459
reflectionColor scene (Ray origin direction) hitPoint (Object shape _) reflections = let maxReflections = 2 reflectionDirection = Vector.reflect (Shapes.normalAtPoint hitPoint shape) direction reflectionRay = Ray hitPoint reflectionDirection in if reflections == maxReflections then Color 0 0 0 else traceRayReflect scene reflectionRay (reflections + 1)
391
false
true
0
12
94
134
67
67
null
null
haskell-distributed/distributed-process-registry
tests/TestRegistry.hs
bsd-3-clause
testUnregisterUnknownName :: Registry String () -> Process () testUnregisterUnknownName reg = do result <- unregisterName reg "no.such.name" result `shouldBe` equalTo UnregisterKeyNotFound
192
testUnregisterUnknownName :: Registry String () -> Process () testUnregisterUnknownName reg = do result <- unregisterName reg "no.such.name" result `shouldBe` equalTo UnregisterKeyNotFound
192
testUnregisterUnknownName reg = do result <- unregisterName reg "no.such.name" result `shouldBe` equalTo UnregisterKeyNotFound
130
false
true
0
8
24
54
25
29
null
null
brendanhay/gogol
gogol-composer/gen/Network/Google/Composer/Types/Product.hs
mpl-2.0
-- | The resource name of the environment, in the form: -- \"projects\/{projectId}\/locations\/{locationId}\/environments\/{environmentId}\" -- EnvironmentId must start with a lowercase letter followed by up to 63 -- lowercase letters, numbers, or hyphens, and cannot end with a hyphen. eName :: Lens' Environment (Maybe Text) eName = lens _eName (\ s a -> s{_eName = a})
371
eName :: Lens' Environment (Maybe Text) eName = lens _eName (\ s a -> s{_eName = a})
84
eName = lens _eName (\ s a -> s{_eName = a})
44
true
true
1
9
54
55
28
27
null
null
kylcarte/ink-ui
src/Lucid/Ink.hs
bsd-3-clause
font400_ = fw_ 400
18
font400_ = fw_ 400
18
font400_ = fw_ 400
18
false
false
0
5
3
9
4
5
null
null
ben-schulz/Idris-dev
src/IRTS/Lang.hs
bsd-3-clause
lsubst n new (LLam ns sc) = LLam ns (lsubst n new sc)
53
lsubst n new (LLam ns sc) = LLam ns (lsubst n new sc)
53
lsubst n new (LLam ns sc) = LLam ns (lsubst n new sc)
53
false
false
0
6
12
40
17
23
null
null
adarqui/99problems-hs
Experimentation/P05.hs
gpl-3.0
reverse_rec (a:as) = reverse_rec as ++ [a]
42
reverse_rec (a:as) = reverse_rec as ++ [a]
42
reverse_rec (a:as) = reverse_rec as ++ [a]
42
false
false
0
7
6
26
13
13
null
null
lambdageek/insomnia
src/Insomnia/Types.hs
bsd-3-clause
transformEveryTypeM :: (TraverseTypes a a, Plated a, Monad m) => (Type -> m Type) -> a -> m a transformEveryTypeM f = transformM (transformMOn traverseTypes f)
159
transformEveryTypeM :: (TraverseTypes a a, Plated a, Monad m) => (Type -> m Type) -> a -> m a transformEveryTypeM f = transformM (transformMOn traverseTypes f)
159
transformEveryTypeM f = transformM (transformMOn traverseTypes f)
65
false
true
0
10
25
74
35
39
null
null
spockwangs/scheme.in.haskell
list9.hs
unlicense
evalAndPrint :: Env -> String -> IO () evalAndPrint env expr = evalString env expr >>= putStrLn
96
evalAndPrint :: Env -> String -> IO () evalAndPrint env expr = evalString env expr >>= putStrLn
96
evalAndPrint env expr = evalString env expr >>= putStrLn
57
false
true
0
8
17
38
18
20
null
null
erochest/phaedrus
Phaedrus/Text/BetaCode.hs
apache-2.0
cchar '\x03b2' = 'b'
20
cchar '\x03b2' = 'b'
20
cchar '\x03b2' = 'b'
20
false
false
0
5
3
9
4
5
null
null
gafiatulin/codewars
src/7 kyu/LofLs.hs
mit
processData :: [[Int]] -> Int processData = product . map (foldl1 (-))
70
processData :: [[Int]] -> Int processData = product . map (foldl1 (-))
70
processData = product . map (foldl1 (-))
40
false
true
0
8
11
36
20
16
null
null
Tener/deeplearning-thesis
src/gg-exp3.hs
bsd-3-clause
playerUseCoinstraints = 1500
28
playerUseCoinstraints = 1500
28
playerUseCoinstraints = 1500
28
false
false
0
4
2
6
3
3
null
null
ltcmelo/psychec
formalism/muC.hs
bsd-3-clause
isSubTyPtr' :: Type -> Type -> Bool isSubTyPtr' (TyVar _) _ = error $ "expected ground type "
93
isSubTyPtr' :: Type -> Type -> Bool isSubTyPtr' (TyVar _) _ = error $ "expected ground type "
93
isSubTyPtr' (TyVar _) _ = error $ "expected ground type "
57
false
true
0
7
17
34
17
17
null
null
futufeld/eclogues
eclogues/src/Eclogues/Job.hs
bsd-3-clause
-- | > isActiveStage = not . 'isTerminationStage' isActiveStage :: Stage -> Bool isActiveStage = not . isTerminationStage
121
isActiveStage :: Stage -> Bool isActiveStage = not . isTerminationStage
71
isActiveStage = not . isTerminationStage
40
true
true
0
5
17
20
11
9
null
null
hooplab/hoopla-telepay-cruncher
src/HooplaTelepay/Parser/Record.hs
mit
parseForetaksnummer :: Parser String parseForetaksnummer = replicateM 11 digit
78
parseForetaksnummer :: Parser String parseForetaksnummer = replicateM 11 digit
78
parseForetaksnummer = replicateM 11 digit
41
false
true
0
5
8
19
9
10
null
null
remyoudompheng/hs-language-go
tests/Tests/ParseStatements.hs
gpl-3.0
testIf5 = testParse "if stmt with composite literal in call" goStatement "if l(two{40, 50}) { return }" $ GoStmtIf (GoCond Nothing (Just $ GoPrim $ GoCall (GoQual Nothing (GoId "l")) [GoPrim $ GoLiteral $ GoLitComp (GoTypeName Nothing (GoId "two")) (GoComp [lit 40, lit 50]) ] False)) (GoBlock [GoStmtReturn []]) Nothing where lit n = GoElement GoKeyNone $ GoValueExpr $ GoPrim $ GoLiteral $ GoLitInt (show n) n
483
testIf5 = testParse "if stmt with composite literal in call" goStatement "if l(two{40, 50}) { return }" $ GoStmtIf (GoCond Nothing (Just $ GoPrim $ GoCall (GoQual Nothing (GoId "l")) [GoPrim $ GoLiteral $ GoLitComp (GoTypeName Nothing (GoId "two")) (GoComp [lit 40, lit 50]) ] False)) (GoBlock [GoStmtReturn []]) Nothing where lit n = GoElement GoKeyNone $ GoValueExpr $ GoPrim $ GoLiteral $ GoLitInt (show n) n
483
testIf5 = testParse "if stmt with composite literal in call" goStatement "if l(two{40, 50}) { return }" $ GoStmtIf (GoCond Nothing (Just $ GoPrim $ GoCall (GoQual Nothing (GoId "l")) [GoPrim $ GoLiteral $ GoLitComp (GoTypeName Nothing (GoId "two")) (GoComp [lit 40, lit 50]) ] False)) (GoBlock [GoStmtReturn []]) Nothing where lit n = GoElement GoKeyNone $ GoValueExpr $ GoPrim $ GoLiteral $ GoLitInt (show n) n
483
false
false
0
18
138
168
81
87
null
null
jmitchell/Idris-dev
src/Idris/REPL/Parser.hs
bsd-3-clause
help :: [([String], CmdArg, String)] help = (["<expr>"], NoArg, "Evaluate an expression") : [ (map (':' :) names, args, text) | (names, args, text, _) <- parserCommandsForHelp ]
179
help :: [([String], CmdArg, String)] help = (["<expr>"], NoArg, "Evaluate an expression") : [ (map (':' :) names, args, text) | (names, args, text, _) <- parserCommandsForHelp ]
179
help = (["<expr>"], NoArg, "Evaluate an expression") : [ (map (':' :) names, args, text) | (names, args, text, _) <- parserCommandsForHelp ]
142
false
true
0
9
29
83
51
32
null
null
anchor/rados-haskell
tests/TestSuite.hs
bsd-3-clause
testConnectBug = it "does not segfault" $ do -- Make 8 connections at once as <- replicateM 8 $ Async.async $ runTestPool $ return () mapM Async.wait as assertBool "Failed" True
225
testConnectBug = it "does not segfault" $ do -- Make 8 connections at once as <- replicateM 8 $ Async.async $ runTestPool $ return () mapM Async.wait as assertBool "Failed" True
225
testConnectBug = it "does not segfault" $ do -- Make 8 connections at once as <- replicateM 8 $ Async.async $ runTestPool $ return () mapM Async.wait as assertBool "Failed" True
225
false
false
0
12
78
61
27
34
null
null
ekmett/succinct
src/Succinct/Tree/LOUDS.hs
bsd-2-clause
-- | Convert a finite 'Rose' to 'Rank9' fromRose' :: ( Bitwise [Bool] v, PackedBits v , G.Vector (Packed v) Word64, G.Vector v Word64) => Proxy v -> Rose -> Rank9 (Packed v) fromRose' p = rank9 p . louds
226
fromRose' :: ( Bitwise [Bool] v, PackedBits v , G.Vector (Packed v) Word64, G.Vector v Word64) => Proxy v -> Rose -> Rank9 (Packed v) fromRose' p = rank9 p . louds
186
fromRose' p = rank9 p . louds
29
true
true
0
10
62
88
44
44
null
null
HMPerson1/soi
src/Language/Soi/Internal/Codegen.hs
gpl-3.0
getelemptr :: Type -> Operand -> Integer -> Codegen Operand getelemptr ptTy arr idx = instr ptTy (GetElementPtr True arr [iconst 0, iconst idx] [])
147
getelemptr :: Type -> Operand -> Integer -> Codegen Operand getelemptr ptTy arr idx = instr ptTy (GetElementPtr True arr [iconst 0, iconst idx] [])
147
getelemptr ptTy arr idx = instr ptTy (GetElementPtr True arr [iconst 0, iconst idx] [])
87
false
true
0
9
24
64
31
33
null
null
urbit/urbit
pkg/hs/urbit-king/test/LogTests.hs
mit
withDb :: FilePath -> Db -> (EventLog -> RIO KingEnv a) -> RIO KingEnv a withDb dir (Db dId dEvs dFx) act = do rwith (Log.new dir dId) $ \log -> do Log.appendEvents log (fromList dEvs) for_ (mapToList dFx) $ \(k,v) -> Log.writeEffectsRow log k v act log --------------------------------------------------------------------------------
375
withDb :: FilePath -> Db -> (EventLog -> RIO KingEnv a) -> RIO KingEnv a withDb dir (Db dId dEvs dFx) act = do rwith (Log.new dir dId) $ \log -> do Log.appendEvents log (fromList dEvs) for_ (mapToList dFx) $ \(k,v) -> Log.writeEffectsRow log k v act log --------------------------------------------------------------------------------
375
withDb dir (Db dId dEvs dFx) act = do rwith (Log.new dir dId) $ \log -> do Log.appendEvents log (fromList dEvs) for_ (mapToList dFx) $ \(k,v) -> Log.writeEffectsRow log k v act log --------------------------------------------------------------------------------
302
false
true
0
14
89
141
68
73
null
null
dysinger/amazonka
amazonka-cloudhsm/gen/Network/AWS/CloudHSM/DescribeLunaClient.hs
mpl-2.0
-- | The date and time the client was last modified. dlcrLastModifiedTimestamp :: Lens' DescribeLunaClientResponse (Maybe Text) dlcrLastModifiedTimestamp = lens _dlcrLastModifiedTimestamp (\s a -> s { _dlcrLastModifiedTimestamp = a })
246
dlcrLastModifiedTimestamp :: Lens' DescribeLunaClientResponse (Maybe Text) dlcrLastModifiedTimestamp = lens _dlcrLastModifiedTimestamp (\s a -> s { _dlcrLastModifiedTimestamp = a })
193
dlcrLastModifiedTimestamp = lens _dlcrLastModifiedTimestamp (\s a -> s { _dlcrLastModifiedTimestamp = a })
118
true
true
0
9
41
46
25
21
null
null
phaazon/quaazar
src/Quaazar/Render/GL/Log.hs
bsd-3-clause
-- |OpenGL 'LogCommitter'. gllog :: LogCommitter gllog = BackendLog "gl"
74
gllog :: LogCommitter gllog = BackendLog "gl"
45
gllog = BackendLog "gl"
23
true
true
0
5
11
15
8
7
null
null
brendanhay/gogol
gogol-partners/gen/Network/Google/Resource/Partners/UpdateLeads.hs
mpl-2.0
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). ulUploadType :: Lens' UpdateLeads (Maybe Text) ulUploadType = lens _ulUploadType (\ s a -> s{_ulUploadType = a})
185
ulUploadType :: Lens' UpdateLeads (Maybe Text) ulUploadType = lens _ulUploadType (\ s a -> s{_ulUploadType = a})
114
ulUploadType = lens _ulUploadType (\ s a -> s{_ulUploadType = a})
67
true
true
0
9
28
48
25
23
null
null
konn/derive-IG
Generics/Instant/Derive.hs
bsd-3-clause
buildQ :: Tree a => Type -> Q [([Name], a)] buildQ (AppT (AppT (ConT c) _) ty) | c == ''C = do {(nms,bs):_ <- buildQ ty; return [(nms, con 'C [bs])]}
149
buildQ :: Tree a => Type -> Q [([Name], a)] buildQ (AppT (AppT (ConT c) _) ty) | c == ''C = do {(nms,bs):_ <- buildQ ty; return [(nms, con 'C [bs])]}
149
buildQ (AppT (AppT (ConT c) _) ty) | c == ''C = do {(nms,bs):_ <- buildQ ty; return [(nms, con 'C [bs])]}
105
false
true
0
12
31
121
63
58
null
null
bitemyapp/ghc
compiler/main/HscTypes.hs
bsd-3-clause
implicitTyThings (AConLike cl) = implicitConLikeThings cl
58
implicitTyThings (AConLike cl) = implicitConLikeThings cl
58
implicitTyThings (AConLike cl) = implicitConLikeThings cl
58
false
false
0
7
6
18
8
10
null
null
majecty/SpaceKite
app/SpaceKite.hs
bsd-3-clause
readInt :: Parser Int readInt = Parser $ listToMaybe `fmap` reads
65
readInt :: Parser Int readInt = Parser $ listToMaybe `fmap` reads
65
readInt = Parser $ listToMaybe `fmap` reads
43
false
true
2
6
10
33
15
18
null
null
shayan-najd/QHaskell
Examples/VHDL/BackEnd.hs
gpl-3.0
idElim (p@(x,VarB y) : _) (xs , rt) = chg (onFst (delete p) ( [ onSnd (rename x y) n | n <- xs] , update x y rt))
252
idElim (p@(x,VarB y) : _) (xs , rt) = chg (onFst (delete p) ( [ onSnd (rename x y) n | n <- xs] , update x y rt))
252
idElim (p@(x,VarB y) : _) (xs , rt) = chg (onFst (delete p) ( [ onSnd (rename x y) n | n <- xs] , update x y rt))
252
false
false
0
12
167
93
48
45
null
null
elbrujohalcon/hPage
src/HPage/Test/Server.hs
bsd-3-clause
prop_open_page_fail hps file' = unsafePerformIO $ HPS.runIn hps $ do let file = "f-" ++ (show $ length file') let path = testDir </> "NO-Test" ++ file HP.closeAllPages shouldFail $ HP.openPage path
381
prop_open_page_fail hps file' = unsafePerformIO $ HPS.runIn hps $ do let file = "f-" ++ (show $ length file') let path = testDir </> "NO-Test" ++ file HP.closeAllPages shouldFail $ HP.openPage path
381
prop_open_page_fail hps file' = unsafePerformIO $ HPS.runIn hps $ do let file = "f-" ++ (show $ length file') let path = testDir </> "NO-Test" ++ file HP.closeAllPages shouldFail $ HP.openPage path
381
false
false
0
14
215
81
37
44
null
null
mboes/language-arm
Language/ARM/Instr.hs
gpl-3.0
imm12 :: CC Operand imm12 = K7 f g where f k k' s = k (\s _ -> k' s) s (I x) where imm = (range 26 26 s `shiftL` 11) .|. (range 14 12 s `shiftL` 8) .|. range 7 0 s n = range 7 0 imm x = case range 11 8 imm of [b|0000|] -> n [b|0001|] -> n `shiftL` 16 .|. n [b|0010|] -> n `shiftL` 24 .|. n `shiftL` 8 [b|0011|] -> n `shiftL` 24 .|. n `shiftL` 16 .|. n `shiftL` 8 .|. n _ -> (0 `setBit` 7 .|. range 6 0 imm) `rotateR` fromIntegral (range 11 7 imm) g k k' s o@(I x) | x <= 0xff = k (\s -> k' s o) (setRange 7 0 x s) | otherwise = k (\s -> k' s o) (explode imm s) where explode imm s = setRange 26 26 (range 11 11 imm) $ setRange 14 12 (range 10 8 imm) $ setRange 7 0 (range 7 0 imm) s imm | let octet = range 7 0 x mask = ((0 `shiftL` 8 .|. octet) `shiftL` 8 .|. 0) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0001|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. 0) `shiftL` 8 .|. octet) `shiftL` 8 .|. 0, x `xor` mask == 0 = exp [b|0010|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. octet) `shiftL` 8 .|. octet) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0011|] $ base octet 0 | (i,n):_ <- [ (i,n) | i <- [0..31], let n = x `rotateL` i, complement [b|1111111|] .&. n == [b|10000000|] ] = setRange 11 7 (fromIntegral i) $ setRange 6 0 (range 6 0 n) 0 | otherwise = error "imm12: Cannot represent immediate value." base = setRange 7 0 exp = setRange 11 8
1,708
imm12 :: CC Operand imm12 = K7 f g where f k k' s = k (\s _ -> k' s) s (I x) where imm = (range 26 26 s `shiftL` 11) .|. (range 14 12 s `shiftL` 8) .|. range 7 0 s n = range 7 0 imm x = case range 11 8 imm of [b|0000|] -> n [b|0001|] -> n `shiftL` 16 .|. n [b|0010|] -> n `shiftL` 24 .|. n `shiftL` 8 [b|0011|] -> n `shiftL` 24 .|. n `shiftL` 16 .|. n `shiftL` 8 .|. n _ -> (0 `setBit` 7 .|. range 6 0 imm) `rotateR` fromIntegral (range 11 7 imm) g k k' s o@(I x) | x <= 0xff = k (\s -> k' s o) (setRange 7 0 x s) | otherwise = k (\s -> k' s o) (explode imm s) where explode imm s = setRange 26 26 (range 11 11 imm) $ setRange 14 12 (range 10 8 imm) $ setRange 7 0 (range 7 0 imm) s imm | let octet = range 7 0 x mask = ((0 `shiftL` 8 .|. octet) `shiftL` 8 .|. 0) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0001|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. 0) `shiftL` 8 .|. octet) `shiftL` 8 .|. 0, x `xor` mask == 0 = exp [b|0010|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. octet) `shiftL` 8 .|. octet) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0011|] $ base octet 0 | (i,n):_ <- [ (i,n) | i <- [0..31], let n = x `rotateL` i, complement [b|1111111|] .&. n == [b|10000000|] ] = setRange 11 7 (fromIntegral i) $ setRange 6 0 (range 6 0 n) 0 | otherwise = error "imm12: Cannot represent immediate value." base = setRange 7 0 exp = setRange 11 8
1,708
imm12 = K7 f g where f k k' s = k (\s _ -> k' s) s (I x) where imm = (range 26 26 s `shiftL` 11) .|. (range 14 12 s `shiftL` 8) .|. range 7 0 s n = range 7 0 imm x = case range 11 8 imm of [b|0000|] -> n [b|0001|] -> n `shiftL` 16 .|. n [b|0010|] -> n `shiftL` 24 .|. n `shiftL` 8 [b|0011|] -> n `shiftL` 24 .|. n `shiftL` 16 .|. n `shiftL` 8 .|. n _ -> (0 `setBit` 7 .|. range 6 0 imm) `rotateR` fromIntegral (range 11 7 imm) g k k' s o@(I x) | x <= 0xff = k (\s -> k' s o) (setRange 7 0 x s) | otherwise = k (\s -> k' s o) (explode imm s) where explode imm s = setRange 26 26 (range 11 11 imm) $ setRange 14 12 (range 10 8 imm) $ setRange 7 0 (range 7 0 imm) s imm | let octet = range 7 0 x mask = ((0 `shiftL` 8 .|. octet) `shiftL` 8 .|. 0) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0001|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. 0) `shiftL` 8 .|. octet) `shiftL` 8 .|. 0, x `xor` mask == 0 = exp [b|0010|] $ base octet 0 | let octet = range 7 0 x mask = ((octet `shiftL` 8 .|. octet) `shiftL` 8 .|. octet) `shiftL` 8 .|. octet, x `xor` mask == 0 = exp [b|0011|] $ base octet 0 | (i,n):_ <- [ (i,n) | i <- [0..31], let n = x `rotateL` i, complement [b|1111111|] .&. n == [b|10000000|] ] = setRange 11 7 (fromIntegral i) $ setRange 6 0 (range 6 0 n) 0 | otherwise = error "imm12: Cannot represent immediate value." base = setRange 7 0 exp = setRange 11 8
1,688
false
true
0
22
627
887
479
408
null
null
MortimerMcMire315/sparkive
src/Exception/TH.hs
gpl-3.0
instanceDec :: Name -> Q Dec instanceDec typeName = do maybeException <- lookupTypeName "Exception" let exception = fromJust maybeException return $ InstanceD Nothing [] (AppT (ConT exception) (ConT typeName)) []
291
instanceDec :: Name -> Q Dec instanceDec typeName = do maybeException <- lookupTypeName "Exception" let exception = fromJust maybeException return $ InstanceD Nothing [] (AppT (ConT exception) (ConT typeName)) []
291
instanceDec typeName = do maybeException <- lookupTypeName "Exception" let exception = fromJust maybeException return $ InstanceD Nothing [] (AppT (ConT exception) (ConT typeName)) []
262
false
true
0
12
108
83
38
45
null
null
Copilot-Language/sbv-for-copilot
Data/SBV/Bridge/Boolector.hs
bsd-3-clause
isTheorem :: Provable a => Maybe Int -- ^ Optional time-out, specify in seconds -> a -- ^ Property to check -> IO (Maybe Bool) -- ^ Returns Nothing if time-out expires isTheorem = isTheoremWith sbvCurrentSolver
269
isTheorem :: Provable a => Maybe Int -- ^ Optional time-out, specify in seconds -> a -- ^ Property to check -> IO (Maybe Bool) isTheorem = isTheoremWith sbvCurrentSolver
225
isTheorem = isTheoremWith sbvCurrentSolver
42
true
true
0
10
94
44
22
22
null
null
AlexeyRaga/eta
compiler/ETA/CodeGen/Rts.hs
bsd-3-clause
contextLoadStore :: Text -> FieldType -> (Code, Code) contextLoadStore name ft = ( invokevirtual $ mkMethodRef stgContext name [jint, ft] void , invokevirtual $ mkMethodRef stgContext name [jint] (ret ft))
209
contextLoadStore :: Text -> FieldType -> (Code, Code) contextLoadStore name ft = ( invokevirtual $ mkMethodRef stgContext name [jint, ft] void , invokevirtual $ mkMethodRef stgContext name [jint] (ret ft))
209
contextLoadStore name ft = ( invokevirtual $ mkMethodRef stgContext name [jint, ft] void , invokevirtual $ mkMethodRef stgContext name [jint] (ret ft))
155
false
true
0
9
33
77
41
36
null
null
mbakke/ganeti
src/Ganeti/HTools/Types.hs
bsd-2-clause
-- | The default instance policy. defIPolicy :: IPolicy defIPolicy = IPolicy { iPolicyMinMaxISpecs = defMinMaxISpecs , iPolicyStdSpec = defStdISpec -- hardcoding here since Constants.hs exports the -- string values, not the actual type; and in -- htools, we are mostly looking at DRBD , iPolicyDiskTemplates = [minBound..maxBound] , iPolicyVcpuRatio = ConstantUtils.ipolicyDefaultsVcpuRatio , iPolicySpindleRatio = ConstantUtils.ipolicyDefaultsSpindleRatio }
540
defIPolicy :: IPolicy defIPolicy = IPolicy { iPolicyMinMaxISpecs = defMinMaxISpecs , iPolicyStdSpec = defStdISpec -- hardcoding here since Constants.hs exports the -- string values, not the actual type; and in -- htools, we are mostly looking at DRBD , iPolicyDiskTemplates = [minBound..maxBound] , iPolicyVcpuRatio = ConstantUtils.ipolicyDefaultsVcpuRatio , iPolicySpindleRatio = ConstantUtils.ipolicyDefaultsSpindleRatio }
506
defIPolicy = IPolicy { iPolicyMinMaxISpecs = defMinMaxISpecs , iPolicyStdSpec = defStdISpec -- hardcoding here since Constants.hs exports the -- string values, not the actual type; and in -- htools, we are mostly looking at DRBD , iPolicyDiskTemplates = [minBound..maxBound] , iPolicyVcpuRatio = ConstantUtils.ipolicyDefaultsVcpuRatio , iPolicySpindleRatio = ConstantUtils.ipolicyDefaultsSpindleRatio }
484
true
true
0
7
138
56
36
20
null
null
mrak/stubby4hs
src/lib/Stubby/Data/Common.hs
apache-2.0
parseHeaders :: Object -> Parser ResponseHeaders parseHeaders o = case HM.lookup "headers" o of Nothing -> return [] Just (Object h) -> return $ HM.foldrWithKey parseHeader [] h _ -> mzero
273
parseHeaders :: Object -> Parser ResponseHeaders parseHeaders o = case HM.lookup "headers" o of Nothing -> return [] Just (Object h) -> return $ HM.foldrWithKey parseHeader [] h _ -> mzero
273
parseHeaders o = case HM.lookup "headers" o of Nothing -> return [] Just (Object h) -> return $ HM.foldrWithKey parseHeader [] h _ -> mzero
224
false
true
0
10
115
79
37
42
null
null
vTurbine/ghc
compiler/cmm/CLabel.hs
bsd-3-clause
toEntryLbl (CmmLabel m str CmmInfo) = CmmLabel m str CmmEntry
66
toEntryLbl (CmmLabel m str CmmInfo) = CmmLabel m str CmmEntry
66
toEntryLbl (CmmLabel m str CmmInfo) = CmmLabel m str CmmEntry
66
false
false
0
7
14
26
12
14
null
null
bacchanalia/KitchenSink
KitchenSink/Qualified.hs
gpl-3.0
-- |'IntMapS.mapAccum' ims_mapAccum = IntMapS.mapAccum
54
ims_mapAccum = IntMapS.mapAccum
31
ims_mapAccum = IntMapS.mapAccum
31
true
false
0
5
4
9
5
4
null
null
GaloisInc/halvm-ghc
compiler/utils/OrdList.hs
bsd-3-clause
snocOL as b = Snoc as b
28
snocOL as b = Snoc as b
28
snocOL as b = Snoc as b
28
false
false
0
5
11
16
7
9
null
null
cartazio/arithmoi
Math/NumberTheory/Primes/Sieve/Eratosthenes.hs
mit
primes :: Integral a => [Prime a] primes = (coerce :: [a] -> [Prime a]) $ takeWhileIncreasing $ 2 : 3 : 5 : concatMap primeListInternal psieveList
150
primes :: Integral a => [Prime a] primes = (coerce :: [a] -> [Prime a]) $ takeWhileIncreasing $ 2 : 3 : 5 : concatMap primeListInternal psieveList
150
primes = (coerce :: [a] -> [Prime a]) $ takeWhileIncreasing $ 2 : 3 : 5 : concatMap primeListInternal psieveList
116
false
true
2
9
30
72
35
37
null
null
ciderpunx/57-exercises-for-programmers
src/P48Weather.hs
gpl-3.0
getSunrise :: AsValue b => Response b -> String getSunrise w = getItem w (key "sys" . key "sunrise" . _Integer) unixToDateString "sunrise"
142
getSunrise :: AsValue b => Response b -> String getSunrise w = getItem w (key "sys" . key "sunrise" . _Integer) unixToDateString "sunrise"
142
getSunrise w = getItem w (key "sys" . key "sunrise" . _Integer) unixToDateString "sunrise"
94
false
true
0
9
26
54
25
29
null
null
DavidAlphaFox/ghc
libraries/Cabal/Cabal/tests/PackageTests/PackageTester.hs
bsd-3-clause
assertInstallSucceeded :: Result -> Assertion assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
218
assertInstallSucceeded :: Result -> Assertion assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
218
assertInstallSucceeded result = unless (successful result) $ assertFailure $ "expected: \'setup install\' should succeed\n" ++ " output: " ++ outputText result
172
false
true
0
11
38
46
22
24
null
null
MichielDerhaeg/stack
src/Stack/FileWatch.hs
bsd-3-clause
fileWatchPoll :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () fileWatchPoll = fileWatchConf $ defaultConfig { confUsePolling = True }
177
fileWatchPoll :: Handle -> ((Set (Path Abs File) -> IO ()) -> IO ()) -> IO () fileWatchPoll = fileWatchConf $ defaultConfig { confUsePolling = True }
177
fileWatchPoll = fileWatchConf $ defaultConfig { confUsePolling = True }
71
false
true
0
13
54
71
36
35
null
null
kfish/zoom-cache
Data/ZoomCache/Write.hs
bsd-2-clause
flushWork :: SampleOffset -> SampleOffset -> TrackNo -> ZoomWork -> (ZoomWork, IntMap Builder) flushWork _ _ _ op@(ZoomWork _ Nothing) = (op, IM.empty)
182
flushWork :: SampleOffset -> SampleOffset -> TrackNo -> ZoomWork -> (ZoomWork, IntMap Builder) flushWork _ _ _ op@(ZoomWork _ Nothing) = (op, IM.empty)
182
flushWork _ _ _ op@(ZoomWork _ Nothing) = (op, IM.empty)
77
false
true
1
12
53
71
35
36
null
null
hy-zhang/parser
Haskell/src/Lib.hs
bsd-3-clause
parseWord :: Parsec String ParserContext String parseWord = do w <- many1 (letter <|> char '\'') pwCheck w
110
parseWord :: Parsec String ParserContext String parseWord = do w <- many1 (letter <|> char '\'') pwCheck w
110
parseWord = do w <- many1 (letter <|> char '\'') pwCheck w
62
false
true
0
11
21
44
20
24
null
null
vTurbine/ghc
compiler/iface/IfaceType.hs
bsd-3-clause
---------------- toIfaceTypes :: [Type] -> [IfaceType] toIfaceTypes ts = map toIfaceType ts
91
toIfaceTypes :: [Type] -> [IfaceType] toIfaceTypes ts = map toIfaceType ts
74
toIfaceTypes ts = map toIfaceType ts
36
true
true
0
6
11
30
16
14
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/divMod_1.hs
mit
primQuotInt :: MyInt -> MyInt -> MyInt; primQuotInt (Pos x) (Pos (Succ y)) = Pos (primDivNatS x (Succ y))
109
primQuotInt :: MyInt -> MyInt -> MyInt primQuotInt (Pos x) (Pos (Succ y)) = Pos (primDivNatS x (Succ y))
108
primQuotInt (Pos x) (Pos (Succ y)) = Pos (primDivNatS x (Succ y))
65
false
true
0
9
22
60
30
30
null
null
DSLsofMath/Hatlab
src/Hatlab/Relations.hs
bsd-3-clause
label :: Relation String -> String label (Relation _ s) = s
63
label :: Relation String -> String label (Relation _ s) = s
63
label (Relation _ s) = s
28
false
true
0
7
15
29
14
15
null
null
ganeti-github-testing/ganeti-test-1
test/hs/Test/Ganeti/OpCodes.hs
bsd-2-clause
-- | Gets a list of names (non-fqdn) in non-empty type. genNamesNE :: Gen [NonEmptyString] genNamesNE = resize maxNodes (listOf genNameNE)
138
genNamesNE :: Gen [NonEmptyString] genNamesNE = resize maxNodes (listOf genNameNE)
82
genNamesNE = resize maxNodes (listOf genNameNE)
47
true
true
0
7
20
36
16
20
null
null
ml9951/ghc
utils/deriveConstants/DeriveConstants.hs
bsd-3-clause
writeHaskellType :: FilePath -> [What Fst] -> IO () writeHaskellType fn ws = writeFile fn xs where xs = unlines (headers ++ body ++ footers) headers = ["data PlatformConstants = PlatformConstants {" -- Now a kludge that allows the real entries to -- all start with a comma, which makes life a -- little easier ," pc_platformConstants :: ()"] footers = [" } deriving Read"] body = concatMap doWhat ws doWhat (GetClosureSize name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetFieldType name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetWord name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetInt name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetNatural name _) = [" , pc_" ++ name ++ " :: Integer"] doWhat (GetBool name _) = [" , pc_" ++ name ++ " :: Bool"] doWhat (StructFieldMacro {}) = [] doWhat (ClosureFieldMacro {}) = [] doWhat (ClosurePayloadMacro {}) = [] doWhat (FieldTypeGcptrMacro {}) = []
1,176
writeHaskellType :: FilePath -> [What Fst] -> IO () writeHaskellType fn ws = writeFile fn xs where xs = unlines (headers ++ body ++ footers) headers = ["data PlatformConstants = PlatformConstants {" -- Now a kludge that allows the real entries to -- all start with a comma, which makes life a -- little easier ," pc_platformConstants :: ()"] footers = [" } deriving Read"] body = concatMap doWhat ws doWhat (GetClosureSize name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetFieldType name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetWord name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetInt name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetNatural name _) = [" , pc_" ++ name ++ " :: Integer"] doWhat (GetBool name _) = [" , pc_" ++ name ++ " :: Bool"] doWhat (StructFieldMacro {}) = [] doWhat (ClosureFieldMacro {}) = [] doWhat (ClosurePayloadMacro {}) = [] doWhat (FieldTypeGcptrMacro {}) = []
1,176
writeHaskellType fn ws = writeFile fn xs where xs = unlines (headers ++ body ++ footers) headers = ["data PlatformConstants = PlatformConstants {" -- Now a kludge that allows the real entries to -- all start with a comma, which makes life a -- little easier ," pc_platformConstants :: ()"] footers = [" } deriving Read"] body = concatMap doWhat ws doWhat (GetClosureSize name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetFieldType name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetWord name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetInt name _) = [" , pc_" ++ name ++ " :: Int"] doWhat (GetNatural name _) = [" , pc_" ++ name ++ " :: Integer"] doWhat (GetBool name _) = [" , pc_" ++ name ++ " :: Bool"] doWhat (StructFieldMacro {}) = [] doWhat (ClosureFieldMacro {}) = [] doWhat (ClosurePayloadMacro {}) = [] doWhat (FieldTypeGcptrMacro {}) = []
1,124
false
true
2
8
440
331
170
161
null
null