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
meteficha/skein
tests/runtests.hs
bsd-3-clause
isTree (_:xs) = isTree xs
25
isTree (_:xs) = isTree xs
25
isTree (_:xs) = isTree xs
25
false
false
0
6
4
20
9
11
null
null
iblumenfeld/saw-core
src/Verifier/SAW/TypedAST.hs
bsd-3-clause
incVars :: DeBruijnIndex -> DeBruijnIndex -> Term -> Term incVars _ 0 = id
74
incVars :: DeBruijnIndex -> DeBruijnIndex -> Term -> Term incVars _ 0 = id
74
incVars _ 0 = id
16
false
true
0
7
13
28
14
14
null
null
dblia/nosql-ganeti
test/hs/Test/Ganeti/Block/Drbd/Parser.hs
gpl-2.0
-- | Function for splitting a list in chunks of a given size. -- FIXME: an equivalent function exists in Data.List.Split, but it seems -- pointless to add this package as a dependence just for this single -- use. In case it is ever added, just remove this function definition -- and use the one from the package. splitEvery :: Int -> [e] -> [[e]] splitEvery i l = map (take i) (splitter l (:) []) where splitter [] _ n = n splitter li c n = li `c` splitter (drop i li) c n -- | Function for testing whether a single comma-separated integer is -- parsed correctly.
569
splitEvery :: Int -> [e] -> [[e]] splitEvery i l = map (take i) (splitter l (:) []) where splitter [] _ n = n splitter li c n = li `c` splitter (drop i li) c n -- | Function for testing whether a single comma-separated integer is -- parsed correctly.
256
splitEvery i l = map (take i) (splitter l (:) []) where splitter [] _ n = n splitter li c n = li `c` splitter (drop i li) c n -- | Function for testing whether a single comma-separated integer is -- parsed correctly.
222
true
true
2
10
115
130
65
65
null
null
fpco/schoolofhaskell.com
src/Handler/LikeContent.hs
mit
getLikeContentR :: TcontentId -> Handler Value getLikeContentR tcid = do muid <- maybeAuthId $runDB $ do myLike <- case muid of Nothing -> return "not-logged-in" Just uid -> fmap (maybe "no-like" $ const "like") $ getBy $ UniqueContentLike tcid uid cnt <- count [ContentLikeContent ==. tcid] return $ object [ "myLike" .= asText myLike , "likes" .= cnt ]
466
getLikeContentR :: TcontentId -> Handler Value getLikeContentR tcid = do muid <- maybeAuthId $runDB $ do myLike <- case muid of Nothing -> return "not-logged-in" Just uid -> fmap (maybe "no-like" $ const "like") $ getBy $ UniqueContentLike tcid uid cnt <- count [ContentLikeContent ==. tcid] return $ object [ "myLike" .= asText myLike , "likes" .= cnt ]
466
getLikeContentR tcid = do muid <- maybeAuthId $runDB $ do myLike <- case muid of Nothing -> return "not-logged-in" Just uid -> fmap (maybe "no-like" $ const "like") $ getBy $ UniqueContentLike tcid uid cnt <- count [ContentLikeContent ==. tcid] return $ object [ "myLike" .= asText myLike , "likes" .= cnt ]
419
false
true
0
20
170
143
64
79
null
null
ryzhyk/cocoon
cocoon/NS.hs
apache-2.0
checkKey :: (MonadError String me) => Pos -> Role -> String -> me Field checkKey p rl n = case lookupKey rl n of Nothing -> err p $ "Unknown key: " ++ n Just k -> return k
218
checkKey :: (MonadError String me) => Pos -> Role -> String -> me Field checkKey p rl n = case lookupKey rl n of Nothing -> err p $ "Unknown key: " ++ n Just k -> return k
218
checkKey p rl n = case lookupKey rl n of Nothing -> err p $ "Unknown key: " ++ n Just k -> return k
146
false
true
0
10
85
86
40
46
null
null
ml9951/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
orphNamesOfType (AppTy fun arg) = orphNamesOfType fun `unionNameSet` orphNamesOfType arg
93
orphNamesOfType (AppTy fun arg) = orphNamesOfType fun `unionNameSet` orphNamesOfType arg
93
orphNamesOfType (AppTy fun arg) = orphNamesOfType fun `unionNameSet` orphNamesOfType arg
93
false
false
0
6
14
30
14
16
null
null
christiaanb/ghc
compiler/prelude/TysPrim.hs
bsd-3-clause
mkPrimTyConName :: FastString -> Unique -> TyCon -> Name mkPrimTyConName = mkPrimTcName BuiltInSyntax
101
mkPrimTyConName :: FastString -> Unique -> TyCon -> Name mkPrimTyConName = mkPrimTcName BuiltInSyntax
101
mkPrimTyConName = mkPrimTcName BuiltInSyntax
44
false
true
0
9
12
32
14
18
null
null
vehk/Indoril
src/Options.hs
bsd-3-clause
-- |Some sane default Options. -- Connect as "Indoril "to "irc.freenode.org:6667" without joining -- channels. Log output goes to stdout. No ident. defaults = Opts { ircHost = "irc.freenode.org" , ircPort = 6667 , channelList = "" , showVer = False , showHelp = False , logTarget = "" , identFile = "" , nick = "Indoril" }
476
defaults = Opts { ircHost = "irc.freenode.org" , ircPort = 6667 , channelList = "" , showVer = False , showHelp = False , logTarget = "" , identFile = "" , nick = "Indoril" }
328
defaults = Opts { ircHost = "irc.freenode.org" , ircPort = 6667 , channelList = "" , showVer = False , showHelp = False , logTarget = "" , identFile = "" , nick = "Indoril" }
328
true
false
0
6
211
59
39
20
null
null
rueshyna/gogol
gogol-people/gen/Network/Google/People/Types/Product.hs
mpl-2.0
-- | The end date when the person left the organization. orgEndDate :: Lens' Organization (Maybe Date) orgEndDate = lens _orgEndDate (\ s a -> s{_orgEndDate = a})
164
orgEndDate :: Lens' Organization (Maybe Date) orgEndDate = lens _orgEndDate (\ s a -> s{_orgEndDate = a})
107
orgEndDate = lens _orgEndDate (\ s a -> s{_orgEndDate = a})
61
true
true
0
9
29
48
25
23
null
null
chadbrewbaker/shellcheck
ShellCheck/Parser.hs
gpl-3.0
prop_readIfClause2 = isWarning readIfClause "if false; then; echo oo; fi"
73
prop_readIfClause2 = isWarning readIfClause "if false; then; echo oo; fi"
73
prop_readIfClause2 = isWarning readIfClause "if false; then; echo oo; fi"
73
false
false
1
5
9
14
5
9
null
null
m-alvarez/jhc
drift_processed/FrontEnd/KindInfer.hs
mit
-- hsKindToKind (HsKind n) = toName SortName n kiApps :: Kind -> [HsType] -> Kind -> Ki () kiApps ca args fk = f ca args fk where f ca [] fk = unify ca fk f (x `Kfun` y) (a:as) fk = do kiType' x a y <- findKind y f y as fk f (KVar var) as fk = do x <- newKindVar KindAny y <- newKindVar KindAny let nv = (KVar x `Kfun` KVar y) varBind var nv f nv as fk f _ _ _ = error "KindInfer.kiApps: bad."
474
kiApps :: Kind -> [HsType] -> Kind -> Ki () kiApps ca args fk = f ca args fk where f ca [] fk = unify ca fk f (x `Kfun` y) (a:as) fk = do kiType' x a y <- findKind y f y as fk f (KVar var) as fk = do x <- newKindVar KindAny y <- newKindVar KindAny let nv = (KVar x `Kfun` KVar y) varBind var nv f nv as fk f _ _ _ = error "KindInfer.kiApps: bad."
426
kiApps ca args fk = f ca args fk where f ca [] fk = unify ca fk f (x `Kfun` y) (a:as) fk = do kiType' x a y <- findKind y f y as fk f (KVar var) as fk = do x <- newKindVar KindAny y <- newKindVar KindAny let nv = (KVar x `Kfun` KVar y) varBind var nv f nv as fk f _ _ _ = error "KindInfer.kiApps: bad."
382
true
true
0
12
173
217
103
114
null
null
ericTsiliacos/jsonAPI
src/Main.hs
bsd-3-clause
routes :: ScottyM () routes = do get "/hello" helloHandler get "/hello/:name" $ do name <- param "name" text ("hello " <> name <> "!") get "/users" $ json allUsers get "/users/:id" $ do id <- param "id" json (filter (matchesId id) allUsers)
267
routes :: ScottyM () routes = do get "/hello" helloHandler get "/hello/:name" $ do name <- param "name" text ("hello " <> name <> "!") get "/users" $ json allUsers get "/users/:id" $ do id <- param "id" json (filter (matchesId id) allUsers)
267
routes = do get "/hello" helloHandler get "/hello/:name" $ do name <- param "name" text ("hello " <> name <> "!") get "/users" $ json allUsers get "/users/:id" $ do id <- param "id" json (filter (matchesId id) allUsers)
246
false
true
1
15
69
118
49
69
null
null
erantapaa/happstack-server
src/Happstack/Server/Internal/Monads.hs
bsd-3-clause
-- | An alternate form of 'escape' that can be easily used within a do -- block. escape' :: (WebMonad a m, FilterMonad a m) => a -> m b escape' a = ignoreFilters >> finishWith a
177
escape' :: (WebMonad a m, FilterMonad a m) => a -> m b escape' a = ignoreFilters >> finishWith a
96
escape' a = ignoreFilters >> finishWith a
41
true
true
0
7
36
49
25
24
null
null
threetreeslight/learning-haskell
practice/old/20150823.hs
mit
productOdds :: Integer -> Integer productOdds n = product $ filter ((/= 0) . (`mod` 3)) $ filter odd [1..(2*n+1)]
113
productOdds :: Integer -> Integer productOdds n = product $ filter ((/= 0) . (`mod` 3)) $ filter odd [1..(2*n+1)]
113
productOdds n = product $ filter ((/= 0) . (`mod` 3)) $ filter odd [1..(2*n+1)]
79
false
true
0
10
19
67
37
30
null
null
ijks/hexagons
tests/Util.hs
mit
approxEq :: (Ord a, Num a) => a -> a -> a -> Bool approxEq epsilon a b = abs (a - b) < epsilon
94
approxEq :: (Ord a, Num a) => a -> a -> a -> Bool approxEq epsilon a b = abs (a - b) < epsilon
94
approxEq epsilon a b = abs (a - b) < epsilon
44
false
true
0
10
24
65
31
34
null
null
dimara/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- * Disk replacement mode replaceDiskAuto :: String replaceDiskAuto = Types.replaceDisksModeToRaw ReplaceAuto
111
replaceDiskAuto :: String replaceDiskAuto = Types.replaceDisksModeToRaw ReplaceAuto
83
replaceDiskAuto = Types.replaceDisksModeToRaw ReplaceAuto
57
true
true
0
6
12
23
10
13
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/original/CodeGenMonad.hs
bsd-3-clause
unCG :: CG i x a -> (CGState i x -> (a, CGState i x)) unCG (CG f) = f
69
unCG :: CG i x a -> (CGState i x -> (a, CGState i x)) unCG (CG f) = f
69
unCG (CG f) = f
15
false
true
0
9
19
58
28
30
null
null
batterseapower/supercompilation-by-evaluation
Core/Syntax.hs
bsd-3-clause
pPrintPrecAlt :: (Pretty a, Pretty b) => PrettyLevel -> Rational -> (a, b) -> Doc pPrintPrecAlt level _ (alt_con, alt_e) = hang (pPrintPrec level noPrec alt_con <+> text "->") 2 (pPrintPrec level noPrec alt_e)
209
pPrintPrecAlt :: (Pretty a, Pretty b) => PrettyLevel -> Rational -> (a, b) -> Doc pPrintPrecAlt level _ (alt_con, alt_e) = hang (pPrintPrec level noPrec alt_con <+> text "->") 2 (pPrintPrec level noPrec alt_e)
209
pPrintPrecAlt level _ (alt_con, alt_e) = hang (pPrintPrec level noPrec alt_con <+> text "->") 2 (pPrintPrec level noPrec alt_e)
127
false
true
0
9
33
95
48
47
null
null
AubreyEAnderson/shellcheck
ShellCheck/Parser.hs
gpl-3.0
readLetSuffix = many1 (readIoRedirect <|> try readLetExpression <|> readCmdWord) where readLetExpression = do startPos <- getPosition expression <- readStringForParser readCmdWord subParse startPos readArithmeticContents expression -- bash allows a=(b), ksh allows $a=(b). dash allows neither. Let's warn.
336
readLetSuffix = many1 (readIoRedirect <|> try readLetExpression <|> readCmdWord) where readLetExpression = do startPos <- getPosition expression <- readStringForParser readCmdWord subParse startPos readArithmeticContents expression -- bash allows a=(b), ksh allows $a=(b). dash allows neither. Let's warn.
336
readLetSuffix = many1 (readIoRedirect <|> try readLetExpression <|> readCmdWord) where readLetExpression = do startPos <- getPosition expression <- readStringForParser readCmdWord subParse startPos readArithmeticContents expression -- bash allows a=(b), ksh allows $a=(b). dash allows neither. Let's warn.
336
false
false
0
9
66
59
27
32
null
null
rueshyna/gogol
gogol-compute/gen/Network/Google/Resource/Compute/InstanceTemplates/Insert.hs
mpl-2.0
-- | Multipart request metadata. itiPayload :: Lens' InstanceTemplatesInsert InstanceTemplate itiPayload = lens _itiPayload (\ s a -> s{_itiPayload = a})
155
itiPayload :: Lens' InstanceTemplatesInsert InstanceTemplate itiPayload = lens _itiPayload (\ s a -> s{_itiPayload = a})
122
itiPayload = lens _itiPayload (\ s a -> s{_itiPayload = a})
61
true
true
0
9
22
42
22
20
null
null
gafiatulin/codewars
src/2 kyu/AlgebraicIsomorphism.hs
mit
multSO :: ISO ((), b) b multSO = isoProd one refl `trans` multS `trans` isoPlus refl multO `trans` plusComm `trans` plusO
121
multSO :: ISO ((), b) b multSO = isoProd one refl `trans` multS `trans` isoPlus refl multO `trans` plusComm `trans` plusO
121
multSO = isoProd one refl `trans` multS `trans` isoPlus refl multO `trans` plusComm `trans` plusO
97
false
true
0
9
20
65
34
31
null
null
SuperDrew/sql-server-gen
src/Database/SqlServer/Definition/View.hs
bsd-2-clause
renderWithOptions :: View -> Doc renderWithOptions v | noneSet = empty | otherwise = text "WITH" <+> hcat (punctuate comma (filter (not . (== empty)) [enc,vm])) where noneSet = not (encryption v) && not (viewMetadata v) enc = if (encryption v) then text "ENCRYPTION" else empty vm = if (viewMetadata v) then text "VIEW_METADATA" else empty
373
renderWithOptions :: View -> Doc renderWithOptions v | noneSet = empty | otherwise = text "WITH" <+> hcat (punctuate comma (filter (not . (== empty)) [enc,vm])) where noneSet = not (encryption v) && not (viewMetadata v) enc = if (encryption v) then text "ENCRYPTION" else empty vm = if (viewMetadata v) then text "VIEW_METADATA" else empty
373
renderWithOptions v | noneSet = empty | otherwise = text "WITH" <+> hcat (punctuate comma (filter (not . (== empty)) [enc,vm])) where noneSet = not (encryption v) && not (viewMetadata v) enc = if (encryption v) then text "ENCRYPTION" else empty vm = if (viewMetadata v) then text "VIEW_METADATA" else empty
340
false
true
3
13
89
151
76
75
null
null
izgzhen/static-hs
src/Language/CFA/ZCFA.hs
mit
genCon (Expr l (TIf e0@(Expr l0 t0) e1@(Expr l1 t1) e2@(Expr l2 t2))) = do ce0 <- genCon e0 ce1 <- genCon e1 ce2 <- genCon e2 cl <- cacheOf l cl1 <- cacheOf l1 cl2 <- cacheOf l2 return $ ce0 `union` ce1 `union` ce2 `union` S.singleton (Subset cl1 cl) `union` S.singleton (Subset cl2 cl)
341
genCon (Expr l (TIf e0@(Expr l0 t0) e1@(Expr l1 t1) e2@(Expr l2 t2))) = do ce0 <- genCon e0 ce1 <- genCon e1 ce2 <- genCon e2 cl <- cacheOf l cl1 <- cacheOf l1 cl2 <- cacheOf l2 return $ ce0 `union` ce1 `union` ce2 `union` S.singleton (Subset cl1 cl) `union` S.singleton (Subset cl2 cl)
341
genCon (Expr l (TIf e0@(Expr l0 t0) e1@(Expr l1 t1) e2@(Expr l2 t2))) = do ce0 <- genCon e0 ce1 <- genCon e1 ce2 <- genCon e2 cl <- cacheOf l cl1 <- cacheOf l1 cl2 <- cacheOf l2 return $ ce0 `union` ce1 `union` ce2 `union` S.singleton (Subset cl1 cl) `union` S.singleton (Subset cl2 cl)
341
false
false
0
12
110
177
86
91
null
null
lemol/HaskellNet
src/Network/HaskellNet/IMAP/Parsers.hs
bsd-3-clause
pSelectLine :: Parser RespDerivs (MailboxInfo -> MailboxInfo) pSelectLine = do string "* " choice [ pExistsLine >>= \n -> return (\mbox -> mbox { _exists = n }) , pRecentLine >>= \n -> return (\mbox -> mbox { _recent = n }) , pFlags >>= \fs -> return (\mbox -> mbox { _flags = fs }) , string "OK " >> okResps ] where pFlags = do string "FLAGS " char '(' fs <- pFlag `sepBy` space char ')' >> crlfP return fs okResps = do char '[' v <- choice [ do { string "UNSEEN " ; many1 digit ; return id } , do { string "PERMANENTFLAGS (" ; fs <- pFlag `sepBy` space ; char ')' ; return $ \mbox -> mbox { _isFlagWritable = Keyword "*" `elem` fs , _permanentFlags = filter (/= Keyword "*") fs } } , do { string "UIDNEXT " ; n <- many1 digit ; return $ \mbox -> mbox { _uidNext = read n } } , do { string "UIDVALIDITY " ; n <- many1 digit ; return $ \mbox -> mbox { _uidValidity = read n } } ] char ']' anyChar `manyTill` crlfP return v
1,833
pSelectLine :: Parser RespDerivs (MailboxInfo -> MailboxInfo) pSelectLine = do string "* " choice [ pExistsLine >>= \n -> return (\mbox -> mbox { _exists = n }) , pRecentLine >>= \n -> return (\mbox -> mbox { _recent = n }) , pFlags >>= \fs -> return (\mbox -> mbox { _flags = fs }) , string "OK " >> okResps ] where pFlags = do string "FLAGS " char '(' fs <- pFlag `sepBy` space char ')' >> crlfP return fs okResps = do char '[' v <- choice [ do { string "UNSEEN " ; many1 digit ; return id } , do { string "PERMANENTFLAGS (" ; fs <- pFlag `sepBy` space ; char ')' ; return $ \mbox -> mbox { _isFlagWritable = Keyword "*" `elem` fs , _permanentFlags = filter (/= Keyword "*") fs } } , do { string "UIDNEXT " ; n <- many1 digit ; return $ \mbox -> mbox { _uidNext = read n } } , do { string "UIDVALIDITY " ; n <- many1 digit ; return $ \mbox -> mbox { _uidValidity = read n } } ] char ']' anyChar `manyTill` crlfP return v
1,833
pSelectLine = do string "* " choice [ pExistsLine >>= \n -> return (\mbox -> mbox { _exists = n }) , pRecentLine >>= \n -> return (\mbox -> mbox { _recent = n }) , pFlags >>= \fs -> return (\mbox -> mbox { _flags = fs }) , string "OK " >> okResps ] where pFlags = do string "FLAGS " char '(' fs <- pFlag `sepBy` space char ')' >> crlfP return fs okResps = do char '[' v <- choice [ do { string "UNSEEN " ; many1 digit ; return id } , do { string "PERMANENTFLAGS (" ; fs <- pFlag `sepBy` space ; char ')' ; return $ \mbox -> mbox { _isFlagWritable = Keyword "*" `elem` fs , _permanentFlags = filter (/= Keyword "*") fs } } , do { string "UIDNEXT " ; n <- many1 digit ; return $ \mbox -> mbox { _uidNext = read n } } , do { string "UIDVALIDITY " ; n <- many1 digit ; return $ \mbox -> mbox { _uidValidity = read n } } ] char ']' anyChar `manyTill` crlfP return v
1,771
false
true
2
19
1,108
433
218
215
null
null
mightymoose/liquidhaskell
external/hsmisc/Graphs.hs
bsd-3-clause
postFront g reach frnt = M.fromList $ nubBy (\x y -> fst x == fst y) $ sortBy (\x y -> let m = length . snd in compare (m x) (m y)) [ (v, u:path) | (u, path) <- M.assocs frnt , v <- S.elems (post g u) , not (M.member v reach) ]
297
postFront g reach frnt = M.fromList $ nubBy (\x y -> fst x == fst y) $ sortBy (\x y -> let m = length . snd in compare (m x) (m y)) [ (v, u:path) | (u, path) <- M.assocs frnt , v <- S.elems (post g u) , not (M.member v reach) ]
297
postFront g reach frnt = M.fromList $ nubBy (\x y -> fst x == fst y) $ sortBy (\x y -> let m = length . snd in compare (m x) (m y)) [ (v, u:path) | (u, path) <- M.assocs frnt , v <- S.elems (post g u) , not (M.member v reach) ]
297
false
false
4
12
124
167
81
86
null
null
ben-han-cn/hdns
Network/ZDNS/Types/RRset.hs
bsd-3-clause
getRdataDescriptor OPT = [RBinary]
34
getRdataDescriptor OPT = [RBinary]
34
getRdataDescriptor OPT = [RBinary]
34
false
false
0
5
3
12
6
6
null
null
rueshyna/gogol
gogol-admin-directory/gen/Network/Google/Directory/Types/Product.hs
mpl-2.0
-- | Kind of resource this is. domKind :: Lens' Domains Text domKind = lens _domKind (\ s a -> s{_domKind = a})
111
domKind :: Lens' Domains Text domKind = lens _domKind (\ s a -> s{_domKind = a})
80
domKind = lens _domKind (\ s a -> s{_domKind = a})
50
true
true
0
9
22
40
22
18
null
null
GaloisInc/halvm-ghc
compiler/stranal/WorkWrap.hs
bsd-3-clause
wwExpr dflags fam_envs (Tick note expr) = Tick note <$> wwExpr dflags fam_envs expr
85
wwExpr dflags fam_envs (Tick note expr) = Tick note <$> wwExpr dflags fam_envs expr
85
wwExpr dflags fam_envs (Tick note expr) = Tick note <$> wwExpr dflags fam_envs expr
85
false
false
0
7
15
35
16
19
null
null
svenpanne/tiger
chapter05/src/Semant.hs
bsd-3-clause
evalT :: Trans a -> Either String a evalT = runIdentity . runErrorT . flip runReaderT initialEnvs . flip evalStateT Types.uniqueSupply
134
evalT :: Trans a -> Either String a evalT = runIdentity . runErrorT . flip runReaderT initialEnvs . flip evalStateT Types.uniqueSupply
134
evalT = runIdentity . runErrorT . flip runReaderT initialEnvs . flip evalStateT Types.uniqueSupply
98
false
true
0
7
20
52
23
29
null
null
Fuuzetsu/haddock
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
bsd-2-clause
ppCtxType :: Unicode -> Qualification -> HsType DocName -> Html ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual HideEmptyContexts
146
ppCtxType :: Unicode -> Qualification -> HsType DocName -> Html ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual HideEmptyContexts
146
ppCtxType unicode qual ty = ppr_mono_ty pREC_CTX ty unicode qual HideEmptyContexts
82
false
true
0
8
20
44
21
23
null
null
kevinbackhouse/Control-Monad-MultiPass
src/Control/Monad/MultiPass/Instrument/EmitST2ArrayFxp.hs
bsd-3-clause
getIndex :: (Ix i, Num i, Monad p1, Monad p2, Monad p3) => EmitST2ArrayFxp i a r w p1 p2 p3 tc -- ^ Instrument -> MultiPass r w' tc (p2 i) -- ^ Current index getIndex = getIndexInternal
206
getIndex :: (Ix i, Num i, Monad p1, Monad p2, Monad p3) => EmitST2ArrayFxp i a r w p1 p2 p3 tc -- ^ Instrument -> MultiPass r w' tc (p2 i) getIndex = getIndexInternal
175
getIndex = getIndexInternal
29
true
true
0
10
59
88
43
45
null
null
ekmett/containers
tests/intmap-properties.hs
bsd-3-clause
test_keysSet :: Assertion test_keysSet = do keysSet (fromList [(5,"a"), (3,"b")]) @?= Data.IntSet.fromList [3,5] keysSet (empty :: UMap) @?= Data.IntSet.empty
166
test_keysSet :: Assertion test_keysSet = do keysSet (fromList [(5,"a"), (3,"b")]) @?= Data.IntSet.fromList [3,5] keysSet (empty :: UMap) @?= Data.IntSet.empty
166
test_keysSet = do keysSet (fromList [(5,"a"), (3,"b")]) @?= Data.IntSet.fromList [3,5] keysSet (empty :: UMap) @?= Data.IntSet.empty
140
false
true
0
12
26
76
42
34
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Gen2/Profiling.hs
mit
-------------------------------------------------------------------------------- -- Initialization initCostCentres :: CollectedCCs -> G () initCostCentres (local_CCs, _extern_CCs, singleton_CCSs) = do mapM_ emitCostCentreDecl local_CCs mapM_ emitCostCentreStackDecl singleton_CCSs
289
initCostCentres :: CollectedCCs -> G () initCostCentres (local_CCs, _extern_CCs, singleton_CCSs) = do mapM_ emitCostCentreDecl local_CCs mapM_ emitCostCentreStackDecl singleton_CCSs
189
initCostCentres (local_CCs, _extern_CCs, singleton_CCSs) = do mapM_ emitCostCentreDecl local_CCs mapM_ emitCostCentreStackDecl singleton_CCSs
149
true
true
0
7
29
50
25
25
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
1869 = 1868
11
1869 = 1868
11
1869 = 1868
11
false
false
1
5
2
10
3
7
null
null
niteria/deterministic-fvs
NoUnionForce/FV.hs
mit
f (Lam v t) fv_cand in_scope acc = delFV v (f t) fv_cand in_scope $! acc
72
f (Lam v t) fv_cand in_scope acc = delFV v (f t) fv_cand in_scope $! acc
72
f (Lam v t) fv_cand in_scope acc = delFV v (f t) fv_cand in_scope $! acc
72
false
false
1
8
15
45
20
25
null
null
hvr/lens
src/Language/Haskell/TH/Lens.hs
bsd-3-clause
_ParS :: Prism' Stmt [[Stmt]] _ParS = prism remitter reviewer where remitter = ParS reviewer (ParS x) = Right x reviewer x = Left x
153
_ParS :: Prism' Stmt [[Stmt]] _ParS = prism remitter reviewer where remitter = ParS reviewer (ParS x) = Right x reviewer x = Left x
153
_ParS = prism remitter reviewer where remitter = ParS reviewer (ParS x) = Right x reviewer x = Left x
123
false
true
2
8
46
77
32
45
null
null
kkspeed/SICP-Practise
Interpreter/code/Eval.hs
lgpl-3.0
primitiveBindings :: IO Env primitiveBindings = nullEnv >>= (flip bindVars $ map (makeFun IOFunc) ioPrimitives ++ map (makeFun PrimitiveFunc) primitives) where makeFun constructor (var, func) = (var, constructor func)
259
primitiveBindings :: IO Env primitiveBindings = nullEnv >>= (flip bindVars $ map (makeFun IOFunc) ioPrimitives ++ map (makeFun PrimitiveFunc) primitives) where makeFun constructor (var, func) = (var, constructor func)
259
primitiveBindings = nullEnv >>= (flip bindVars $ map (makeFun IOFunc) ioPrimitives ++ map (makeFun PrimitiveFunc) primitives) where makeFun constructor (var, func) = (var, constructor func)
231
false
true
0
11
70
81
41
40
null
null
ChrisBlom/Signs
src/Signs/Interpreter.hs
mit
testrun commands = run $ Load "opt.signs" : commands
52
testrun commands = run $ Load "opt.signs" : commands
52
testrun commands = run $ Load "opt.signs" : commands
52
false
false
3
5
8
24
9
15
null
null
GaloisInc/HaNS
src/Hans/Tcp/Tcb.hs
bsd-3-clause
whenState :: (BaseM m IO, GetState tcb) => tcb -> State -> m () -> m () whenState tcb state m = do state' <- inBase (getState tcb) when (state == state') m -- | The Tcb type is the only one that supports changing state.
227
whenState :: (BaseM m IO, GetState tcb) => tcb -> State -> m () -> m () whenState tcb state m = do state' <- inBase (getState tcb) when (state == state') m -- | The Tcb type is the only one that supports changing state.
227
whenState tcb state m = do state' <- inBase (getState tcb) when (state == state') m -- | The Tcb type is the only one that supports changing state.
155
false
true
0
10
53
89
43
46
null
null
fmapfmapfmap/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/Types/Product.hs
mpl-2.0
-- | The name of the filter. The valid values are: '\"auto-scaling-group\"', -- '\"key\"', '\"value\"', and '\"propagate-at-launch\"'. fName :: Lens' Filter Text fName = lens _fName (\ s a -> s{_fName = a})
206
fName :: Lens' Filter Text fName = lens _fName (\ s a -> s{_fName = a})
71
fName = lens _fName (\ s a -> s{_fName = a})
44
true
true
0
9
32
48
24
24
null
null
urbanslug/ghc
testsuite/tests/perf/compiler/T783.hs
bsd-3-clause
foo x | x == 284 = 284
22
foo x | x == 284 = 284
22
foo x | x == 284 = 284
22
false
false
0
8
7
23
9
14
null
null
rleshchinskiy/vector
Data/Vector/Generic.hs
bsd-3-clause
slice i n v = BOUNDS_CHECK(checkSlice) "slice" i n (length v) $ basicUnsafeSlice i n v
98
slice i n v = BOUNDS_CHECK(checkSlice) "slice" i n (length v) $ basicUnsafeSlice i n v
98
slice i n v = BOUNDS_CHECK(checkSlice) "slice" i n (length v) $ basicUnsafeSlice i n v
98
false
false
0
8
27
44
21
23
null
null
oshyshko/adventofcode
src/Y15/D21.hs
bsd-3-clause
combs _ [] = []
19
combs _ [] = []
19
combs _ [] = []
19
false
false
0
6
8
15
7
8
null
null
tim-m89/hcom
Foreign/COM/Variant.hs
bsd-3-clause
vt_CY = 6 :: VarType
39
vt_CY = 6 :: VarType
39
vt_CY = 6 :: VarType
39
false
false
0
4
23
9
5
4
null
null
RossMeikleham/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
-- | Show Idris name showName :: Maybe IState -- ^^ the Idris state, for information about names and colours -> [(Name, Bool)] -- ^^ the bound variables and whether they're implicit -> PPOption -- ^^ pretty printing options -> Bool -- ^^ whether to colourise -> Name -- ^^ the term to show -> String showName ist bnd ppo colour n = case ist of Just i -> if colour then colourise n (idris_colourTheme i) else showbasic n Nothing -> showbasic n where name = if ppopt_impl ppo then show n else showbasic n showbasic n@(UN _) = showCG n showbasic (MN i s) = str s showbasic (NS n s) = showSep "." (map str (reverse s)) ++ "." ++ showbasic n showbasic (SN s) = show s fst3 (x, _, _) = x colourise n t = let ctxt' = fmap tt_ctxt ist in case ctxt' of Nothing -> name Just ctxt | Just impl <- lookup n bnd -> if impl then colouriseImplicit t name else colouriseBound t name | isDConName n ctxt -> colouriseData t name | isFnName n ctxt -> colouriseFun t name | isTConName n ctxt -> colouriseType t name -- The assumption is that if a name is not bound and does not exist in the -- global context, then we're somewhere in which implicit info has been lost -- (like error messages). Thus, unknown vars are colourised as implicits. | otherwise -> colouriseImplicit t name
1,904
showName :: Maybe IState -- ^^ the Idris state, for information about names and colours -> [(Name, Bool)] -- ^^ the bound variables and whether they're implicit -> PPOption -- ^^ pretty printing options -> Bool -- ^^ whether to colourise -> Name -- ^^ the term to show -> String showName ist bnd ppo colour n = case ist of Just i -> if colour then colourise n (idris_colourTheme i) else showbasic n Nothing -> showbasic n where name = if ppopt_impl ppo then show n else showbasic n showbasic n@(UN _) = showCG n showbasic (MN i s) = str s showbasic (NS n s) = showSep "." (map str (reverse s)) ++ "." ++ showbasic n showbasic (SN s) = show s fst3 (x, _, _) = x colourise n t = let ctxt' = fmap tt_ctxt ist in case ctxt' of Nothing -> name Just ctxt | Just impl <- lookup n bnd -> if impl then colouriseImplicit t name else colouriseBound t name | isDConName n ctxt -> colouriseData t name | isFnName n ctxt -> colouriseFun t name | isTConName n ctxt -> colouriseType t name -- The assumption is that if a name is not bound and does not exist in the -- global context, then we're somewhere in which implicit info has been lost -- (like error messages). Thus, unknown vars are colourised as implicits. | otherwise -> colouriseImplicit t name
1,883
showName ist bnd ppo colour n = case ist of Just i -> if colour then colourise n (idris_colourTheme i) else showbasic n Nothing -> showbasic n where name = if ppopt_impl ppo then show n else showbasic n showbasic n@(UN _) = showCG n showbasic (MN i s) = str s showbasic (NS n s) = showSep "." (map str (reverse s)) ++ "." ++ showbasic n showbasic (SN s) = show s fst3 (x, _, _) = x colourise n t = let ctxt' = fmap tt_ctxt ist in case ctxt' of Nothing -> name Just ctxt | Just impl <- lookup n bnd -> if impl then colouriseImplicit t name else colouriseBound t name | isDConName n ctxt -> colouriseData t name | isFnName n ctxt -> colouriseFun t name | isTConName n ctxt -> colouriseType t name -- The assumption is that if a name is not bound and does not exist in the -- global context, then we're somewhere in which implicit info has been lost -- (like error messages). Thus, unknown vars are colourised as implicits. | otherwise -> colouriseImplicit t name
1,529
true
true
0
16
887
402
196
206
null
null
spinda/liquidhaskell
tests/gsoc15/unknown/pos/polyfun.hs
bsd-3-clause
prop = all (\z -> liquidAssertB (z >= 0)) zs where zs = foo id
74
prop = all (\z -> liquidAssertB (z >= 0)) zs where zs = foo id
74
prop = all (\z -> liquidAssertB (z >= 0)) zs where zs = foo id
74
false
false
1
10
26
43
20
23
null
null
lueck/htcf
testsuite/Test/HTCF/Tokenizer.hs
gpl-3.0
test_invalidLitMonth = do assertEqual ["31", ".", "Octop", ".", "1517", "is", "no", "date", "."] (map getToken (tokenize monthsConfig parsed)) where parsed = [(mkTcfTextSample "31. Octop. 1517 is no date." 1 1)] -- More abbreviations
251
test_invalidLitMonth = do assertEqual ["31", ".", "Octop", ".", "1517", "is", "no", "date", "."] (map getToken (tokenize monthsConfig parsed)) where parsed = [(mkTcfTextSample "31. Octop. 1517 is no date." 1 1)] -- More abbreviations
251
test_invalidLitMonth = do assertEqual ["31", ".", "Octop", ".", "1517", "is", "no", "date", "."] (map getToken (tokenize monthsConfig parsed)) where parsed = [(mkTcfTextSample "31. Octop. 1517 is no date." 1 1)] -- More abbreviations
251
false
false
2
11
50
86
44
42
null
null
JacquesCarette/literate-scientific-software
code/drasil-data/Data/Drasil/Concepts/Math.hs
bsd-2-clause
surface = dcc "surface" (cn' "surface") "The outer or topmost boundary of an object"
110
surface = dcc "surface" (cn' "surface") "The outer or topmost boundary of an object"
110
surface = dcc "surface" (cn' "surface") "The outer or topmost boundary of an object"
110
false
false
1
7
39
23
9
14
null
null
Cedev/monad-computed
Main.hs
mit
setIORefPublished published value = do writeIORef (valueRef published) value notify $ subscribers published --readIORefPublished = readIORef . valueRef
190
setIORefPublished published value = do writeIORef (valueRef published) value notify $ subscribers published --readIORefPublished = readIORef . valueRef
190
setIORefPublished published value = do writeIORef (valueRef published) value notify $ subscribers published --readIORefPublished = readIORef . valueRef
190
false
false
0
9
56
36
16
20
null
null
energyflowanalysis/efa-2.1
sandbox/makestub/Main.hs
bsd-3-clause
mainFunc :: [Decl] mainFunc = TypeSig noLoc [ident] ty : PatBind noLoc lhs Nothing rhs (BDecls []) : [] where ident = name "main" ty = TyCon (UnQual $ name "IO ()") lhs = pvar ident rhs = UnGuardedRhs $ var (name "undefined")
256
mainFunc :: [Decl] mainFunc = TypeSig noLoc [ident] ty : PatBind noLoc lhs Nothing rhs (BDecls []) : [] where ident = name "main" ty = TyCon (UnQual $ name "IO ()") lhs = pvar ident rhs = UnGuardedRhs $ var (name "undefined")
256
mainFunc = TypeSig noLoc [ident] ty : PatBind noLoc lhs Nothing rhs (BDecls []) : [] where ident = name "main" ty = TyCon (UnQual $ name "IO ()") lhs = pvar ident rhs = UnGuardedRhs $ var (name "undefined")
237
false
true
4
9
73
131
55
76
null
null
ganeti/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
ssHvparamsXenKvm :: String ssHvparamsXenKvm = ssHvparamsPref ++ htKvm
69
ssHvparamsXenKvm :: String ssHvparamsXenKvm = ssHvparamsPref ++ htKvm
69
ssHvparamsXenKvm = ssHvparamsPref ++ htKvm
42
false
true
0
5
7
15
8
7
null
null
fpco/wai-middleware-crowd
src/Network/Wai/Middleware/Crowd.hs
mit
-- | Get the username for the current user. -- -- If called on a @Request@ behind the middleware, should always return a -- @Just@ value. -- -- Since 0.1.1.0 getUserName :: Request -> Maybe S.ByteString getUserName = Vault.lookup userKey . vault
245
getUserName :: Request -> Maybe S.ByteString getUserName = Vault.lookup userKey . vault
87
getUserName = Vault.lookup userKey . vault
42
true
true
0
7
41
35
20
15
null
null
Saulzar/pong
src/Pong4.hs
bsd-3-clause
radius :: Float radius = 6
26
radius :: Float radius = 6
26
radius = 6
10
false
true
0
4
5
11
6
5
null
null
dmvianna/haskellbook
src/Ch23-MyState.hs
unlicense
exec :: State s a -> s -> s exec (State sa) x = let (_, s) = sa x in s
90
exec :: State s a -> s -> s exec (State sa) x = let (_, s) = sa x in s
90
exec (State sa) x = let (_, s) = sa x in s
62
false
true
0
9
41
56
27
29
null
null
mcschroeder/ghc
compiler/types/Type.hs
bsd-3-clause
-- | Extract a bound variable in a binder, if any binderVar_maybe :: TyBinder -> Maybe Var binderVar_maybe (Named v _) = Just v
127
binderVar_maybe :: TyBinder -> Maybe Var binderVar_maybe (Named v _) = Just v
77
binderVar_maybe (Named v _) = Just v
36
true
true
0
6
23
37
17
20
null
null
k0001/gtk2hs
cairo/Graphics/Rendering/Cairo.hs
gpl-3.0
-- | -- inFill :: Double -> Double -> Render Bool inFill = liftRender2 Internal.inFill
86
inFill :: Double -> Double -> Render Bool inFill = liftRender2 Internal.inFill
78
inFill = liftRender2 Internal.inFill
36
true
true
0
8
14
35
16
19
null
null
olsner/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
exprCtOrigin (HsUnboundVar uv) = UnboundOccurrenceOf (unboundVarOcc uv)
72
exprCtOrigin (HsUnboundVar uv) = UnboundOccurrenceOf (unboundVarOcc uv)
72
exprCtOrigin (HsUnboundVar uv) = UnboundOccurrenceOf (unboundVarOcc uv)
72
false
false
0
7
7
25
11
14
null
null
shockkolate/containers
Data/IntSet/Base.hs
bsd-3-clause
unsafeFindMin (Tip kx bm) = Just $ kx + lowestBitSet bm
55
unsafeFindMin (Tip kx bm) = Just $ kx + lowestBitSet bm
55
unsafeFindMin (Tip kx bm) = Just $ kx + lowestBitSet bm
55
false
false
0
7
10
28
13
15
null
null
bergey/demos
Boxen.hs
bsd-3-clause
cliParser :: O.Parser Config cliParser = Config <$> O.strOption (O.value "fingerjointed-box.svg" <> O.long "output" <> O.short 'o' <> O.help "filename for output" <> O.showDefault ) <*> O.option O.auto (O.long "length" <> O.short 'L' <> O.help "length of box") <*> O.option O.auto (O.long "width" <> O.short 'W' <> O.help "width of box") <*> O.option O.auto (O.long "height" <> O.short 'H' <> O.help "height of box") <*> O.option O.auto (O.long "thickness" <> O.short 'T' <> O.help "thickness of material / depth of notches") <*> O.option (Just <$> O.auto) (O.value Nothing <> O.long "notches" <> O.short 'n' <> O.help "The number of notch pairs in each direction (length, width, height)") <*> O.option (Just <$> O.auto) ( O.value Nothing <> O.long "finger" <> O.short 'x' <> O.help "target length of each finger") <*> O.option O.auto (O.value 0 <> O.long "relief" <> O.short 'R' <> O.help "Cut diagonally in the inside corners, so the square outside corners can fit. The argument is the diameter of the cutting bit. Generally this is needed when cutting on a CNC router, but not when laser cutting.") <*> O.option O.auto (O.value 1 <> O.long "margin" <> O.short 'm' <> O.showDefault <> O.help "space between seperate pieces to be cut. You likely want to rearrange the pieces anyway, to better fit the raw material.") <*> O.switch (O.long "feet" <> O.short 'f' <> O.help "add two feet to help align & stack boxes") <*> O.option O.auto (O.value Finger <> O.long "bottom" <> O.short 'b' <> O.help "method of attaching box bottom to sides. Can be Finger or Rabbet" <> O.showDefault)
2,117
cliParser :: O.Parser Config cliParser = Config <$> O.strOption (O.value "fingerjointed-box.svg" <> O.long "output" <> O.short 'o' <> O.help "filename for output" <> O.showDefault ) <*> O.option O.auto (O.long "length" <> O.short 'L' <> O.help "length of box") <*> O.option O.auto (O.long "width" <> O.short 'W' <> O.help "width of box") <*> O.option O.auto (O.long "height" <> O.short 'H' <> O.help "height of box") <*> O.option O.auto (O.long "thickness" <> O.short 'T' <> O.help "thickness of material / depth of notches") <*> O.option (Just <$> O.auto) (O.value Nothing <> O.long "notches" <> O.short 'n' <> O.help "The number of notch pairs in each direction (length, width, height)") <*> O.option (Just <$> O.auto) ( O.value Nothing <> O.long "finger" <> O.short 'x' <> O.help "target length of each finger") <*> O.option O.auto (O.value 0 <> O.long "relief" <> O.short 'R' <> O.help "Cut diagonally in the inside corners, so the square outside corners can fit. The argument is the diameter of the cutting bit. Generally this is needed when cutting on a CNC router, but not when laser cutting.") <*> O.option O.auto (O.value 1 <> O.long "margin" <> O.short 'm' <> O.showDefault <> O.help "space between seperate pieces to be cut. You likely want to rearrange the pieces anyway, to better fit the raw material.") <*> O.switch (O.long "feet" <> O.short 'f' <> O.help "add two feet to help align & stack boxes") <*> O.option O.auto (O.value Finger <> O.long "bottom" <> O.short 'b' <> O.help "method of attaching box bottom to sides. Can be Finger or Rabbet" <> O.showDefault)
2,117
cliParser = Config <$> O.strOption (O.value "fingerjointed-box.svg" <> O.long "output" <> O.short 'o' <> O.help "filename for output" <> O.showDefault ) <*> O.option O.auto (O.long "length" <> O.short 'L' <> O.help "length of box") <*> O.option O.auto (O.long "width" <> O.short 'W' <> O.help "width of box") <*> O.option O.auto (O.long "height" <> O.short 'H' <> O.help "height of box") <*> O.option O.auto (O.long "thickness" <> O.short 'T' <> O.help "thickness of material / depth of notches") <*> O.option (Just <$> O.auto) (O.value Nothing <> O.long "notches" <> O.short 'n' <> O.help "The number of notch pairs in each direction (length, width, height)") <*> O.option (Just <$> O.auto) ( O.value Nothing <> O.long "finger" <> O.short 'x' <> O.help "target length of each finger") <*> O.option O.auto (O.value 0 <> O.long "relief" <> O.short 'R' <> O.help "Cut diagonally in the inside corners, so the square outside corners can fit. The argument is the diameter of the cutting bit. Generally this is needed when cutting on a CNC router, but not when laser cutting.") <*> O.option O.auto (O.value 1 <> O.long "margin" <> O.short 'm' <> O.showDefault <> O.help "space between seperate pieces to be cut. You likely want to rearrange the pieces anyway, to better fit the raw material.") <*> O.switch (O.long "feet" <> O.short 'f' <> O.help "add two feet to help align & stack boxes") <*> O.option O.auto (O.value Finger <> O.long "bottom" <> O.short 'b' <> O.help "method of attaching box bottom to sides. Can be Finger or Rabbet" <> O.showDefault)
2,088
false
true
0
23
796
523
243
280
null
null
pparkkin/eta
compiler/ETA/BasicTypes/Lexeme.hs
bsd-3-clause
okTcOcc str@(c:_) | startsConId c = okConIdOcc str | startsConSym c = okConSymOcc str | startsVarSym c = okVarSymOcc str
132
okTcOcc str@(c:_) | startsConId c = okConIdOcc str | startsConSym c = okConSymOcc str | startsVarSym c = okVarSymOcc str
132
okTcOcc str@(c:_) | startsConId c = okConIdOcc str | startsConSym c = okConSymOcc str | startsVarSym c = okVarSymOcc str
132
false
false
0
8
31
71
29
42
null
null
Arguggi/Frinfo
src/Frinfo/Scripts.hs
mit
filterCpuStats :: T.Text -> T.Text filterCpuStats = T.unlines . filter ("cpu" `T.isPrefixOf`) . T.lines
103
filterCpuStats :: T.Text -> T.Text filterCpuStats = T.unlines . filter ("cpu" `T.isPrefixOf`) . T.lines
103
filterCpuStats = T.unlines . filter ("cpu" `T.isPrefixOf`) . T.lines
68
false
true
0
8
13
42
23
19
null
null
clockworkdevstudio/Idlewild-Lang
Semantics.hs
bsd-2-clause
dwarfGenericAttributeSize (DWARFAttribute4 _) = 4
49
dwarfGenericAttributeSize (DWARFAttribute4 _) = 4
49
dwarfGenericAttributeSize (DWARFAttribute4 _) = 4
49
false
false
0
7
4
15
7
8
null
null
siddhanathan/yi
yi-core/src/Yi/UI/Utils.hs
gpl-2.0
paintStrokes _ x0 lf [] = fmap (second ($ x0)) lf
50
paintStrokes _ x0 lf [] = fmap (second ($ x0)) lf
50
paintStrokes _ x0 lf [] = fmap (second ($ x0)) lf
50
false
false
0
8
11
32
16
16
null
null
silky/bibtexier
src/Text/BibTeX/Format.hs
bsd-3-clause
entry :: Entry.T -> String entry (Entry.Cons entryType bibId items) = let formatItem (name, value) = " "++name++" = {"++value++"},\n" in "@" ++ entryType ++ "{" ++ bibId ++ ",\n" ++ concatMap formatItem items ++ "}\n"
248
entry :: Entry.T -> String entry (Entry.Cons entryType bibId items) = let formatItem (name, value) = " "++name++" = {"++value++"},\n" in "@" ++ entryType ++ "{" ++ bibId ++ ",\n" ++ concatMap formatItem items ++ "}\n"
248
entry (Entry.Cons entryType bibId items) = let formatItem (name, value) = " "++name++" = {"++value++"},\n" in "@" ++ entryType ++ "{" ++ bibId ++ ",\n" ++ concatMap formatItem items ++ "}\n"
221
false
true
0
12
66
97
48
49
null
null
Rydgel/advent-of-code
src/Day13.hs
bsd-3-clause
parseSeat :: Parser (SeatPair, Int) parseSeat = do p <- many1 letter _ <- string " would " s <- many1 letter _ <- space x <- decimal _ <- string " happiness units by sitting next to " n <- many1 letter _ <- char '.' let v = x * (if s == "gain" then 1 else -1) return ((p, n), v)
298
parseSeat :: Parser (SeatPair, Int) parseSeat = do p <- many1 letter _ <- string " would " s <- many1 letter _ <- space x <- decimal _ <- string " happiness units by sitting next to " n <- many1 letter _ <- char '.' let v = x * (if s == "gain" then 1 else -1) return ((p, n), v)
298
parseSeat = do p <- many1 letter _ <- string " would " s <- many1 letter _ <- space x <- decimal _ <- string " happiness units by sitting next to " n <- many1 letter _ <- char '.' let v = x * (if s == "gain" then 1 else -1) return ((p, n), v)
262
false
true
1
14
83
146
67
79
null
null
ryzhyk/cocoon
cocoon/Builtins.hs
apache-2.0
arrayArray = Builtin "array" arrayArrayValidate arrayArrayType arrayArrayPrintBoogie arrayArrayPrintP4 arrayArrayToSMT arrayArrayEval
266
arrayArray = Builtin "array" arrayArrayValidate arrayArrayType arrayArrayPrintBoogie arrayArrayPrintP4 arrayArrayToSMT arrayArrayEval
266
arrayArray = Builtin "array" arrayArrayValidate arrayArrayType arrayArrayPrintBoogie arrayArrayPrintP4 arrayArrayToSMT arrayArrayEval
266
false
false
1
5
142
31
10
21
null
null
shlevy/ghc
compiler/nativeGen/PPC/CodeGen.hs
bsd-3-clause
getRegister' dflags (CmmMachOp (MO_SS_Conv W64 W32) [CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]]) | target32Bit (targetPlatform dflags) = do ChildCode64 code rlo <- iselExpr64 x return $ Fixed II32 (getHiVRegFromLo rlo) code
257
getRegister' dflags (CmmMachOp (MO_SS_Conv W64 W32) [CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]]) | target32Bit (targetPlatform dflags) = do ChildCode64 code rlo <- iselExpr64 x return $ Fixed II32 (getHiVRegFromLo rlo) code
257
getRegister' dflags (CmmMachOp (MO_SS_Conv W64 W32) [CmmMachOp (MO_U_Shr W64) [x,CmmLit (CmmInt 32 _)]]) | target32Bit (targetPlatform dflags) = do ChildCode64 code rlo <- iselExpr64 x return $ Fixed II32 (getHiVRegFromLo rlo) code
257
false
false
0
12
57
110
50
60
null
null
rueshyna/gogol
gogol-discovery/gen/Network/Google/Discovery/Types/Product.hs
mpl-2.0
-- | If this is a schema for an array, this property is the schema for each -- element in the array. jsItems :: Lens' JSONSchema (Maybe JSONSchema) jsItems = lens _jsItems (\ s a -> s{_jsItems = a})
198
jsItems :: Lens' JSONSchema (Maybe JSONSchema) jsItems = lens _jsItems (\ s a -> s{_jsItems = a})
97
jsItems = lens _jsItems (\ s a -> s{_jsItems = a})
50
true
true
0
9
38
47
26
21
null
null
phischu/fragnix
builtins/ghc-prim/GHC.Prim.hs
bsd-3-clause
writeAddrOffAddr# :: Addr# -> Int# -> Addr# -> State# s -> State# s writeAddrOffAddr# = writeAddrOffAddr#
105
writeAddrOffAddr# :: Addr# -> Int# -> Addr# -> State# s -> State# s writeAddrOffAddr# = writeAddrOffAddr#
105
writeAddrOffAddr# = writeAddrOffAddr#
37
false
true
0
9
15
33
16
17
null
null
walck/learn-physics
src/Physics/Learn/Schrodinger1D.hs
bsd-3-clause
coherent :: R -- ^ length scale = sqrt(hbar / m omega) -> C -- ^ parameter z -> R -> C -- ^ wavefunction coherent l z x = ((1/(pi*l**2))**0.25 * exp(-x**2/(2*l**2)) :+ 0) * exp(-z**2/2 + (sqrt(2/l**2) * x :+ 0) * z)
250
coherent :: R -- ^ length scale = sqrt(hbar / m omega) -> C -- ^ parameter z -> R -> C coherent l z x = ((1/(pi*l**2))**0.25 * exp(-x**2/(2*l**2)) :+ 0) * exp(-z**2/2 + (sqrt(2/l**2) * x :+ 0) * z)
231
coherent l z x = ((1/(pi*l**2))**0.25 * exp(-x**2/(2*l**2)) :+ 0) * exp(-z**2/2 + (sqrt(2/l**2) * x :+ 0) * z)
120
true
true
0
16
79
146
77
69
null
null
cpennington/h4sh
Build.hs
gpl-2.0
doRawArgs :: Type -> String -> String -> String doRawArgs ((S `To` S) `To` (LS `To` LS)) = createRawEval "String -> String"
123
doRawArgs :: Type -> String -> String -> String doRawArgs ((S `To` S) `To` (LS `To` LS)) = createRawEval "String -> String"
123
doRawArgs ((S `To` S) `To` (LS `To` LS)) = createRawEval "String -> String"
75
false
true
0
9
21
56
32
24
null
null
philopon/apiary
tests/Application.hs
mit
multiPartTestApp :: Application multiPartTestApp = runIdentity . runApiary return def $ do root $ do method POST . action $ do p <- getReqBodyParams f <- getReqBodyFiles guard (not . null $ p) guard (not . null $ f) case fileContent (head f) of Left lbs -> bytes "lbs file"
361
multiPartTestApp :: Application multiPartTestApp = runIdentity . runApiary return def $ do root $ do method POST . action $ do p <- getReqBodyParams f <- getReqBodyFiles guard (not . null $ p) guard (not . null $ f) case fileContent (head f) of Left lbs -> bytes "lbs file"
361
multiPartTestApp = runIdentity . runApiary return def $ do root $ do method POST . action $ do p <- getReqBodyParams f <- getReqBodyFiles guard (not . null $ p) guard (not . null $ f) case fileContent (head f) of Left lbs -> bytes "lbs file"
329
false
true
0
18
137
128
56
72
null
null
nomeata/cryptonite
Crypto/Cipher/Types/Block.hs
bsd-3-clause
xtsEncryptGeneric :: (ByteArray ba, BlockCipher128 cipher) => XTS ba cipher xtsEncryptGeneric = xtsGeneric ecbEncrypt
117
xtsEncryptGeneric :: (ByteArray ba, BlockCipher128 cipher) => XTS ba cipher xtsEncryptGeneric = xtsGeneric ecbEncrypt
117
xtsEncryptGeneric = xtsGeneric ecbEncrypt
41
false
true
0
6
13
34
17
17
null
null
gbaz/cabal
cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/Solver.hs
bsd-3-clause
-- | Makes a solver test case, consisting of the following components: -- -- 1. An 'ExampleDb', representing the package database (both -- installed and remote) we are doing dependency solving over, -- 2. A 'String' name for the test, -- 3. A list '[String]' of package names to solve for -- 4. The expected result, either 'Nothing' if there is no -- satisfying solution, or a list '[(String, Int)]' of -- packages to install, at which versions. -- -- See 'UnitTests.Distribution.Client.Dependency.Modular.DSL' for how -- to construct an 'ExampleDb', as well as definitions of 'db1' etc. -- in this file. mkTest :: ExampleDb -> String -> [String] -> Maybe [(String, Int)] -> SolverTest mkTest = mkTestExtLangPC Nothing Nothing []
801
mkTest :: ExampleDb -> String -> [String] -> Maybe [(String, Int)] -> SolverTest mkTest = mkTestExtLangPC Nothing Nothing []
152
mkTest = mkTestExtLangPC Nothing Nothing []
43
true
true
0
12
190
70
41
29
null
null
brownsys/pane
src/HFT.hs
bsd-3-clause
emptyAction = Nothing
21
emptyAction = Nothing
21
emptyAction = Nothing
21
false
false
1
5
2
10
3
7
null
null
svenssonjoel/ObsidianGFX
Examples/ReductionTutorial/Reduce.hs
bsd-3-clause
--------------------------------------------------------------------------- -- Kernel5 (Thread performs sequential computations, in a coalesced fashion) --------------------------------------------------------------------------- red5 :: Storable a => (a -> a -> a) -> Pull Word32 a -> Program Block a red5 f arr = do arr' <- force (tConcat (fmap (seqReducePush f) (coalesce 8 arr))) red3 2 f arr'
469
red5 :: Storable a => (a -> a -> a) -> Pull Word32 a -> Program Block a red5 f arr = do arr' <- force (tConcat (fmap (seqReducePush f) (coalesce 8 arr))) red3 2 f arr'
238
red5 f arr = do arr' <- force (tConcat (fmap (seqReducePush f) (coalesce 8 arr))) red3 2 f arr'
133
true
true
0
15
121
108
51
57
null
null
hmgibson23/kwikup
Maven.hs
apache-2.0
versionParser :: Parser Version versionParser = do m <- char '"' *> many1 digit <* char '.' mi <- many1 digit <* (char '"' <|> char '.') optional (many1 digit) return $ Version (read m) (read mi)
203
versionParser :: Parser Version versionParser = do m <- char '"' *> many1 digit <* char '.' mi <- many1 digit <* (char '"' <|> char '.') optional (many1 digit) return $ Version (read m) (read mi)
203
versionParser = do m <- char '"' *> many1 digit <* char '.' mi <- many1 digit <* (char '"' <|> char '.') optional (many1 digit) return $ Version (read m) (read mi)
171
false
true
0
11
44
101
45
56
null
null
sgillespie/ghc
compiler/basicTypes/Lexeme.hs
bsd-3-clause
isLexConId, isLexConSym, isLexVarId, isLexVarSym :: FastString -> Bool isLexCon cs = isLexConId cs || isLexConSym cs
118
isLexConId, isLexConSym, isLexVarId, isLexVarSym :: FastString -> Bool isLexCon cs = isLexConId cs || isLexConSym cs
117
isLexCon cs = isLexConId cs || isLexConSym cs
46
false
true
0
6
17
34
19
15
null
null
ghc-android/ghc
testsuite/tests/ghci/should_run/ghcirun004.hs
bsd-3-clause
313 = 312
9
313 = 312
9
313 = 312
9
false
false
1
5
2
10
3
7
null
null
samplecount/shake-language-c
src/Development/Shake/Language/C/Target/OSX.hs
apache-2.0
-- | iOS simulator platform. iPhoneSimulator :: Platform iPhoneSimulator = Platform "iPhoneSimulator"
101
iPhoneSimulator :: Platform iPhoneSimulator = Platform "iPhoneSimulator"
72
iPhoneSimulator = Platform "iPhoneSimulator"
44
true
true
0
5
11
15
8
7
null
null
shnarazk/satter
Satter/PlayerSAT.hs
gpl-3.0
mapOfBall :: GameContext -> Maybe Ball -> Player -> [Bool] mapOfBall (_ball -> b) _ (_property -> _team -> t) = positionLiterals preds (positionOf b) where preds = (if t == Team1 then gridViewOfTeam1 else gridViewOfTeam2) (viewResolutionX, viewResolutionY) -- | 12 literals: whether i have ball : /n/th literal is on if the player is the /n/th closest player to ball
369
mapOfBall :: GameContext -> Maybe Ball -> Player -> [Bool] mapOfBall (_ball -> b) _ (_property -> _team -> t) = positionLiterals preds (positionOf b) where preds = (if t == Team1 then gridViewOfTeam1 else gridViewOfTeam2) (viewResolutionX, viewResolutionY) -- | 12 literals: whether i have ball : /n/th literal is on if the player is the /n/th closest player to ball
369
mapOfBall (_ball -> b) _ (_property -> _team -> t) = positionLiterals preds (positionOf b) where preds = (if t == Team1 then gridViewOfTeam1 else gridViewOfTeam2) (viewResolutionX, viewResolutionY) -- | 12 literals: whether i have ball : /n/th literal is on if the player is the /n/th closest player to ball
310
false
true
0
8
63
98
52
46
null
null
ahodgen/qualys
Qualys/WasWebApp.hs
bsd-3-clause
-- | Filter by WebApp name. wasFiltName :: CritField Text wasFiltName = CF "name"
81
wasFiltName :: CritField Text wasFiltName = CF "name"
53
wasFiltName = CF "name"
23
true
true
0
5
13
18
9
9
null
null
dmbarbour/awelon
hsrc/AO/Parser.hs
bsd-3-clause
parseText :: (P.Stream s m Char) => P.ParsecT s u m String parseText = multiLineText P.<|> inlineText where atLineStart bExpected = P.getPosition >>= \ pos -> let bAtLineStart = (1 == P.sourceColumn pos) in when (bExpected /= bAtLineStart) mzero multiLineText = atLineStart True >> P.char '"' >> lineOfText >>= \ l0 -> P.manyTill (sp >> lineOfText) mlTerm >>= \ ls -> expectWordSep >> return (L.intercalate "\n" (l0:ls)) lineOfText = P.manyTill P.anyChar lf sp = P.char ' ' P.<?> "SP to escape prior LF" lf = P.char '\n' P.<?> "LF for multi-line text" mlTerm = P.char '~' P.<?> "~ to end multi-line text" inlineText = atLineStart False >> P.char '"' >> P.manyTill ilchr (P.char '"') >>= \ s -> expectWordSep >> return s ilchr = (P.satisfy isInlineTextChar P.<?> "inline text characters") -- parse '{token}' of a known class
939
parseText :: (P.Stream s m Char) => P.ParsecT s u m String parseText = multiLineText P.<|> inlineText where atLineStart bExpected = P.getPosition >>= \ pos -> let bAtLineStart = (1 == P.sourceColumn pos) in when (bExpected /= bAtLineStart) mzero multiLineText = atLineStart True >> P.char '"' >> lineOfText >>= \ l0 -> P.manyTill (sp >> lineOfText) mlTerm >>= \ ls -> expectWordSep >> return (L.intercalate "\n" (l0:ls)) lineOfText = P.manyTill P.anyChar lf sp = P.char ' ' P.<?> "SP to escape prior LF" lf = P.char '\n' P.<?> "LF for multi-line text" mlTerm = P.char '~' P.<?> "~ to end multi-line text" inlineText = atLineStart False >> P.char '"' >> P.manyTill ilchr (P.char '"') >>= \ s -> expectWordSep >> return s ilchr = (P.satisfy isInlineTextChar P.<?> "inline text characters") -- parse '{token}' of a known class
939
parseText = multiLineText P.<|> inlineText where atLineStart bExpected = P.getPosition >>= \ pos -> let bAtLineStart = (1 == P.sourceColumn pos) in when (bExpected /= bAtLineStart) mzero multiLineText = atLineStart True >> P.char '"' >> lineOfText >>= \ l0 -> P.manyTill (sp >> lineOfText) mlTerm >>= \ ls -> expectWordSep >> return (L.intercalate "\n" (l0:ls)) lineOfText = P.manyTill P.anyChar lf sp = P.char ' ' P.<?> "SP to escape prior LF" lf = P.char '\n' P.<?> "LF for multi-line text" mlTerm = P.char '~' P.<?> "~ to end multi-line text" inlineText = atLineStart False >> P.char '"' >> P.manyTill ilchr (P.char '"') >>= \ s -> expectWordSep >> return s ilchr = (P.satisfy isInlineTextChar P.<?> "inline text characters") -- parse '{token}' of a known class
880
false
true
0
14
252
309
156
153
null
null
Fuuzetsu/stack
src/Stack/Config.hs
bsd-3-clause
-- | Determine the extra config file locations which exist. -- -- Returns most local first getExtraConfigs :: (MonadIO m, MonadLogger m) => Path Abs File -- ^ use config path -> m [Path Abs File] getExtraConfigs userConfigPath = do defaultStackGlobalConfigPath <- getDefaultGlobalConfigPath liftIO $ do env <- getEnvironment mstackConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_CONFIG" env mstackGlobalConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_GLOBAL_CONFIG" env filterM doesFileExist $ fromMaybe userConfigPath mstackConfig : maybe [] return (mstackGlobalConfig <|> defaultStackGlobalConfigPath) -- | Load and parse YAML from the given config file. Throws -- 'ParseConfigFileException' when there's a decoding error.
877
getExtraConfigs :: (MonadIO m, MonadLogger m) => Path Abs File -- ^ use config path -> m [Path Abs File] getExtraConfigs userConfigPath = do defaultStackGlobalConfigPath <- getDefaultGlobalConfigPath liftIO $ do env <- getEnvironment mstackConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_CONFIG" env mstackGlobalConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_GLOBAL_CONFIG" env filterM doesFileExist $ fromMaybe userConfigPath mstackConfig : maybe [] return (mstackGlobalConfig <|> defaultStackGlobalConfigPath) -- | Load and parse YAML from the given config file. Throws -- 'ParseConfigFileException' when there's a decoding error.
786
getExtraConfigs userConfigPath = do defaultStackGlobalConfigPath <- getDefaultGlobalConfigPath liftIO $ do env <- getEnvironment mstackConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_CONFIG" env mstackGlobalConfig <- maybe (return Nothing) (fmap Just . parseAbsFile) $ lookup "STACK_GLOBAL_CONFIG" env filterM doesFileExist $ fromMaybe userConfigPath mstackConfig : maybe [] return (mstackGlobalConfig <|> defaultStackGlobalConfigPath) -- | Load and parse YAML from the given config file. Throws -- 'ParseConfigFileException' when there's a decoding error.
649
true
true
0
15
203
185
89
96
null
null
gspia/reflex-dom-htmlea
lib/src/Reflex/Dom/HTML5/Elements/Elements.hs
bsd-3-clause
-- | A short-hand notion for @ elAttr \"rb\" ... @ rb ∷ forall t m a. DomBuilder t m ⇒ Rb → m a → m a rb bm children = snd <$> rb' bm children
142
rb ∷ forall t m a. DomBuilder t m ⇒ Rb → m a → m a rb bm children = snd <$> rb' bm children
91
rb bm children = snd <$> rb' bm children
40
true
true
0
9
36
60
29
31
null
null
onponomarev/ganeti
src/Ganeti/Constants.hs
bsd-2-clause
-- | Rbd tool command rbdCmd :: String rbdCmd = "rbd"
53
rbdCmd :: String rbdCmd = "rbd"
31
rbdCmd = "rbd"
14
true
true
0
6
10
19
8
11
null
null
alexander-at-github/eta
compiler/ETA/DeSugar/DsUtils.hs
bsd-3-clause
selectMatchVar :: Pat Id -> DsM Id selectMatchVar (BangPat pat) = selectMatchVar (unLoc pat)
92
selectMatchVar :: Pat Id -> DsM Id selectMatchVar (BangPat pat) = selectMatchVar (unLoc pat)
92
selectMatchVar (BangPat pat) = selectMatchVar (unLoc pat)
57
false
true
0
7
13
43
19
24
null
null
beni55/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
bsd-3-clause
-- | Unpack the elements of a vector into an unboxed tuple. # unpackInt8X64# :: Int8X64# -> (# Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int# #) unpackInt8X64# = let x = x in x
450
unpackInt8X64# :: Int8X64# -> (# Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int# #) unpackInt8X64# = let x = x in x
387
unpackInt8X64# = let x = x in x
31
true
true
0
8
28
225
142
83
null
null
mettekou/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
pprCtOrigin (FailablePattern pat) = ctoHerald <+> text "the failable pattern" <+> quotes (ppr pat) $$ text "(this will become an error in a future GHC release)"
176
pprCtOrigin (FailablePattern pat) = ctoHerald <+> text "the failable pattern" <+> quotes (ppr pat) $$ text "(this will become an error in a future GHC release)"
176
pprCtOrigin (FailablePattern pat) = ctoHerald <+> text "the failable pattern" <+> quotes (ppr pat) $$ text "(this will become an error in a future GHC release)"
176
false
false
4
8
41
46
19
27
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Genomics/Types/Product.hs
mpl-2.0
-- | The fragment is a PCR or optical duplicate (SAM flag 0x400). rDuplicateFragment :: Lens' Read' (Maybe Bool) rDuplicateFragment = lens _rDuplicateFragment (\ s a -> s{_rDuplicateFragment = a})
204
rDuplicateFragment :: Lens' Read' (Maybe Bool) rDuplicateFragment = lens _rDuplicateFragment (\ s a -> s{_rDuplicateFragment = a})
138
rDuplicateFragment = lens _rDuplicateFragment (\ s a -> s{_rDuplicateFragment = a})
91
true
true
0
9
37
48
25
23
null
null
alang9/deque
Data/Deque/NonCat/LessTyped.hs
bsd-3-clause
toTiny b@B3{} = TinyL b
23
toTiny b@B3{} = TinyL b
23
toTiny b@B3{} = TinyL b
23
false
false
1
6
4
24
9
15
null
null
lukexi/stack
src/Stack/Constants.hs
bsd-3-clause
cabalPackageName :: PackageName cabalPackageName = $(mkPackageName "Cabal")
79
cabalPackageName :: PackageName cabalPackageName = $(mkPackageName "Cabal")
79
cabalPackageName = $(mkPackageName "Cabal")
47
false
true
0
8
10
25
10
15
null
null
BartAdv/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
reifyTTNameApp t [sn] | t == reflm "SN" , (P _ f _, args) <- unApply sn = SN <$> reifySN f args where reifySN :: Name -> [Term] -> ElabD SpecialName reifySN t [Constant (I i), n1, n2] | t == reflm "WhereN" = WhereN i <$> reifyTTName n1 <*> reifyTTName n2 reifySN t [Constant (I i), n] | t == reflm "WithN" = WithN i <$> reifyTTName n reifySN t [n, ss] | t == reflm "InstanceN" = case unList ss of Nothing -> fail "Can't reify InstanceN strings" Just ss' -> InstanceN <$> reifyTTName n <*> pure [T.pack s | Constant (Str s) <- ss'] reifySN t [n, Constant (Str s)] | t == reflm "ParentN" = ParentN <$> reifyTTName n <*> pure (T.pack s) reifySN t [n] | t == reflm "MethodN" = MethodN <$> reifyTTName n reifySN t [n] | t == reflm "CaseN" = CaseN <$> reifyTTName n reifySN t [n] | t == reflm "ElimN" = ElimN <$> reifyTTName n reifySN t [n] | t == reflm "InstanceCtorN" = InstanceCtorN <$> reifyTTName n reifySN t [n1, n2] | t == reflm "MetaN" = MetaN <$> reifyTTName n1 <*> reifyTTName n2 reifySN t args = fail $ "Can't reify special name " ++ show t ++ show args
1,513
reifyTTNameApp t [sn] | t == reflm "SN" , (P _ f _, args) <- unApply sn = SN <$> reifySN f args where reifySN :: Name -> [Term] -> ElabD SpecialName reifySN t [Constant (I i), n1, n2] | t == reflm "WhereN" = WhereN i <$> reifyTTName n1 <*> reifyTTName n2 reifySN t [Constant (I i), n] | t == reflm "WithN" = WithN i <$> reifyTTName n reifySN t [n, ss] | t == reflm "InstanceN" = case unList ss of Nothing -> fail "Can't reify InstanceN strings" Just ss' -> InstanceN <$> reifyTTName n <*> pure [T.pack s | Constant (Str s) <- ss'] reifySN t [n, Constant (Str s)] | t == reflm "ParentN" = ParentN <$> reifyTTName n <*> pure (T.pack s) reifySN t [n] | t == reflm "MethodN" = MethodN <$> reifyTTName n reifySN t [n] | t == reflm "CaseN" = CaseN <$> reifyTTName n reifySN t [n] | t == reflm "ElimN" = ElimN <$> reifyTTName n reifySN t [n] | t == reflm "InstanceCtorN" = InstanceCtorN <$> reifyTTName n reifySN t [n1, n2] | t == reflm "MetaN" = MetaN <$> reifyTTName n1 <*> reifyTTName n2 reifySN t args = fail $ "Can't reify special name " ++ show t ++ show args
1,513
reifyTTNameApp t [sn] | t == reflm "SN" , (P _ f _, args) <- unApply sn = SN <$> reifySN f args where reifySN :: Name -> [Term] -> ElabD SpecialName reifySN t [Constant (I i), n1, n2] | t == reflm "WhereN" = WhereN i <$> reifyTTName n1 <*> reifyTTName n2 reifySN t [Constant (I i), n] | t == reflm "WithN" = WithN i <$> reifyTTName n reifySN t [n, ss] | t == reflm "InstanceN" = case unList ss of Nothing -> fail "Can't reify InstanceN strings" Just ss' -> InstanceN <$> reifyTTName n <*> pure [T.pack s | Constant (Str s) <- ss'] reifySN t [n, Constant (Str s)] | t == reflm "ParentN" = ParentN <$> reifyTTName n <*> pure (T.pack s) reifySN t [n] | t == reflm "MethodN" = MethodN <$> reifyTTName n reifySN t [n] | t == reflm "CaseN" = CaseN <$> reifyTTName n reifySN t [n] | t == reflm "ElimN" = ElimN <$> reifyTTName n reifySN t [n] | t == reflm "InstanceCtorN" = InstanceCtorN <$> reifyTTName n reifySN t [n1, n2] | t == reflm "MetaN" = MetaN <$> reifyTTName n1 <*> reifyTTName n2 reifySN t args = fail $ "Can't reify special name " ++ show t ++ show args
1,513
false
false
0
16
668
544
252
292
null
null
harendra-kumar/asyncly
src/Streamly/Internal/Data/Time/Units.hs
bsd-3-clause
addToAbsTime :: AbsTime -> RelTime -> AbsTime addToAbsTime (AbsTime t1) (RelTime t2) = AbsTime $ t1 + t2
104
addToAbsTime :: AbsTime -> RelTime -> AbsTime addToAbsTime (AbsTime t1) (RelTime t2) = AbsTime $ t1 + t2
104
addToAbsTime (AbsTime t1) (RelTime t2) = AbsTime $ t1 + t2
58
false
true
0
7
17
44
22
22
null
null
fmapfmapfmap/amazonka
amazonka-storagegateway/gen/Network/AWS/StorageGateway/DescribeCache.hs
mpl-2.0
-- | Undocumented member. dcGatewayARN :: Lens' DescribeCache Text dcGatewayARN = lens _dcGatewayARN (\ s a -> s{_dcGatewayARN = a})
132
dcGatewayARN :: Lens' DescribeCache Text dcGatewayARN = lens _dcGatewayARN (\ s a -> s{_dcGatewayARN = a})
106
dcGatewayARN = lens _dcGatewayARN (\ s a -> s{_dcGatewayARN = a})
65
true
true
0
9
19
40
22
18
null
null
elieux/ghc
compiler/main/DynFlags.hs
bsd-3-clause
setHiDir f d = d{ hiDir = Just f}
43
setHiDir f d = d{ hiDir = Just f}
43
setHiDir f d = d{ hiDir = Just f}
43
false
false
0
7
18
22
11
11
null
null
joelwilliamson/reddit-digest
Persist.hs
gpl-3.0
checkS conn = prepare conn "select * from users where addr = ? and sub = ? and freq = ? "
89
checkS conn = prepare conn "select * from users where addr = ? and sub = ? and freq = ? "
89
checkS conn = prepare conn "select * from users where addr = ? and sub = ? and freq = ? "
89
false
false
0
5
21
14
6
8
null
null
fmapfmapfmap/amazonka
amazonka-redshift/test/Test/AWS/Gen/Redshift.hs
mpl-2.0
testCreateSnapshotCopyGrant :: CreateSnapshotCopyGrant -> TestTree testCreateSnapshotCopyGrant = req "CreateSnapshotCopyGrant" "fixture/CreateSnapshotCopyGrant.yaml"
173
testCreateSnapshotCopyGrant :: CreateSnapshotCopyGrant -> TestTree testCreateSnapshotCopyGrant = req "CreateSnapshotCopyGrant" "fixture/CreateSnapshotCopyGrant.yaml"
173
testCreateSnapshotCopyGrant = req "CreateSnapshotCopyGrant" "fixture/CreateSnapshotCopyGrant.yaml"
106
false
true
0
7
17
28
11
17
null
null
christiaanb/ghc
compiler/stgSyn/CoreToStg.hs
bsd-3-clause
getFVs :: FreeVarsInfo -> [Var] getFVs fvs = [id | (id, how_bound, _) <- varEnvElts fvs, not (topLevelBound how_bound) ]
140
getFVs :: FreeVarsInfo -> [Var] getFVs fvs = [id | (id, how_bound, _) <- varEnvElts fvs, not (topLevelBound how_bound) ]
140
getFVs fvs = [id | (id, how_bound, _) <- varEnvElts fvs, not (topLevelBound how_bound) ]
108
false
true
0
10
39
63
31
32
null
null
bhurt/bam
src/Choice.hs
lgpl-2.1
extend :: (a -> Choice c b) -> Choice a b -> Choice c b extend f (Choice a b) = Choice (extend f a) (extend f b)
116
extend :: (a -> Choice c b) -> Choice a b -> Choice c b extend f (Choice a b) = Choice (extend f a) (extend f b)
112
extend f (Choice a b) = Choice (extend f a) (extend f b)
56
false
true
0
8
31
75
36
39
null
null