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
JustinUnger/haskell-book
ch17/list-app-ex.hs
mit
concat' :: List (List a) -> List a concat' = fold append Nil
60
concat' :: List (List a) -> List a concat' = fold append Nil
60
concat' = fold append Nil
25
false
true
0
9
12
39
16
23
null
null
christiaanb/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
62
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
62
bcc i (TOPBASE n) = indent i ++ "TOPBASE(" ++ show n ++ ");\n"
62
false
false
0
8
13
37
16
21
null
null
muspellsson/hiccup
TclChan.hs
lgpl-2.1
namesChan (CM m) = Map.keys m
29
namesChan (CM m) = Map.keys m
29
namesChan (CM m) = Map.keys m
29
false
false
0
7
5
20
9
11
null
null
brendanhay/gogol
gogol-youtube/gen/Network/Google/Resource/YouTube/ChannelSections/Update.hs
mpl-2.0
-- | The *part* parameter serves two purposes in this operation. It -- identifies the properties that the write operation will set as well as -- the properties that the API response will include. The part names that -- you can include in the parameter value are snippet and contentDetails. csuPart :: Lens' ChannelSectio...
398
csuPart :: Lens' ChannelSectionsUpdate [Text] csuPart = lens _csuPart (\ s a -> s{_csuPart = a}) . _Coerce
108
csuPart = lens _csuPart (\ s a -> s{_csuPart = a}) . _Coerce
62
true
true
0
10
69
52
29
23
null
null
Tr1p0d/WisRegister
dist/build/autogen/Paths_WisRegister.hs
gpl-3.0
getDataFileName :: FilePath -> IO FilePath getDataFileName name = do dir <- getDataDir return (dir ++ "/" ++ name)
118
getDataFileName :: FilePath -> IO FilePath getDataFileName name = do dir <- getDataDir return (dir ++ "/" ++ name)
118
getDataFileName name = do dir <- getDataDir return (dir ++ "/" ++ name)
75
false
true
0
10
22
45
21
24
null
null
Mokosha/HsTetrisAttack
TetrisAttack/Grid.hs
mit
imapGridM :: Monad m => ((Int, Int) -> a -> m b) -> Grid2D a -> m (Grid2D b) imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid) where locGrid = uncurry generateGrid (gridSize grid) (,)
202
imapGridM :: Monad m => ((Int, Int) -> a -> m b) -> Grid2D a -> m (Grid2D b) imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid) where locGrid = uncurry generateGrid (gridSize grid) (,)
202
imapGridM f grid = mapGridM (uncurry f) (zipGrid locGrid grid) where locGrid = uncurry generateGrid (gridSize grid) (,)
125
false
true
0
10
42
106
52
54
null
null
mainland/dph
dph-prim-seq/Data/Array/Parallel/Unlifted/Stream/Locked.hs
bsd-3-clause
------------------------------------------------- -- | Zip the first 'n' elements of five streams. lockedZip5S :: Monad m => Int -> Bundle m v a -> Bundle m v b -> Bundle m v c -> Bundle m v d -> Bundle m v e -> Bundle m v (a, b, c, d, e) lockedZip5S len (Bundle {sElems=Stream ...
1,183
lockedZip5S :: Monad m => Int -> Bundle m v a -> Bundle m v b -> Bundle m v c -> Bundle m v d -> Bundle m v e -> Bundle m v (a, b, c, d, e) lockedZip5S len (Bundle {sElems=Stream mkStep1 sa1}) (Bundle {sElems=Stream mkStep2 sa2}) (Bundle {sElems=Stream mkStep3 sa...
1,083
lockedZip5S len (Bundle {sElems=Stream mkStep1 sa1}) (Bundle {sElems=Stream mkStep2 sa2}) (Bundle {sElems=Stream mkStep3 sa3}) (Bundle {sElems=Stream mkStep4 sa4}) (Bundle {sElems=Stream mkStep5 sa5}) = B.fromStream (Stream step (sa1, sa2, sa3, sa4, sa5, 0)) (S.Exact len) where...
910
true
true
0
15
457
455
238
217
null
null
ItsLastDay/academic_university_2016-2018
subjects/Haskell/5/homework.hs
gpl-3.0
sum3 [] x [] = x
16
sum3 [] x [] = x
16
sum3 [] x [] = x
16
false
false
1
5
5
23
8
15
null
null
unisonweb/platform
parser-typechecker/src/Unison/Codebase/Branch.hs
mit
-- Discards the history of a Branch0's children, recursively discardHistory0 :: Applicative m => Branch0 m -> Branch0 m discardHistory0 = over children (fmap tweak) where tweak b = cons (discardHistory0 (head b)) empty
220
discardHistory0 :: Applicative m => Branch0 m -> Branch0 m discardHistory0 = over children (fmap tweak) where tweak b = cons (discardHistory0 (head b)) empty
159
discardHistory0 = over children (fmap tweak) where tweak b = cons (discardHistory0 (head b)) empty
100
true
true
0
9
35
66
32
34
null
null
keithodulaigh/Hets
THF/ParseTHF.hs
gpl-2.0
fileInfo :: CharParser st (Maybe Name) fileInfo = fmap Just (comma >> name) <|> (notFollowedBy (char ',') >> return Nothing)
126
fileInfo :: CharParser st (Maybe Name) fileInfo = fmap Just (comma >> name) <|> (notFollowedBy (char ',') >> return Nothing)
126
fileInfo = fmap Just (comma >> name) <|> (notFollowedBy (char ',') >> return Nothing)
87
false
true
5
10
21
69
30
39
null
null
sdiehl/ghc
compiler/typecheck/TcType.hs
bsd-3-clause
metaTyVarTcLevel :: TcTyVar -> TcLevel metaTyVarTcLevel tv = case tcTyVarDetails tv of MetaTv { mtv_tclvl = tclvl } -> tclvl _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
180
metaTyVarTcLevel :: TcTyVar -> TcLevel metaTyVarTcLevel tv = case tcTyVarDetails tv of MetaTv { mtv_tclvl = tclvl } -> tclvl _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
180
metaTyVarTcLevel tv = case tcTyVarDetails tv of MetaTv { mtv_tclvl = tclvl } -> tclvl _ -> pprPanic "metaTyVarTcLevel" (ppr tv)
141
false
true
2
7
39
58
28
30
null
null
misgeatgit/opencog
opencog/nlp/lojban/HaskellLib/src/OpenCog/Lojban/Syntax/Util.hs
agpl-3.0
withEmptyState :: SynIso a b -> SynIso a b withEmptyState iso = Iso f g where f a = do atoms <- gets sAtoms setAtoms [] b <- apply iso a pushAtoms atoms pure b g = unapply iso
220
withEmptyState :: SynIso a b -> SynIso a b withEmptyState iso = Iso f g where f a = do atoms <- gets sAtoms setAtoms [] b <- apply iso a pushAtoms atoms pure b g = unapply iso
220
withEmptyState iso = Iso f g where f a = do atoms <- gets sAtoms setAtoms [] b <- apply iso a pushAtoms atoms pure b g = unapply iso
177
false
true
2
8
83
105
41
64
null
null
hdevtools/hdevtools
src/CommandArgs.hs
mit
pathArg' a@Type {} = path a
28
pathArg' a@Type {} = path a
28
pathArg' a@Type {} = path a
28
false
false
0
7
6
19
9
10
null
null
mathhun/stack
src/System/Process/PagerEditor.hs
bsd-3-clause
-- | Run pager to display a string. pageString :: String -> IO () pageString = pageBuilder . stringUtf8
103
pageString :: String -> IO () pageString = pageBuilder . stringUtf8
67
pageString = pageBuilder . stringUtf8
37
true
true
0
7
18
25
13
12
null
null
benkolera/phb
hs/Site/Customer.hs
mit
customerRowSplice :: PhbRuntimeSplice [Entity Customer] -> PhbSplice customerRowSplice = rowSplice (ts <> ss) where ts = mapV (C.pureSplice . C.textSplice) $ do "name" ## (^.eVal.customerName) "id" ## (^.eKey.to spliceKey) ss = mempty
276
customerRowSplice :: PhbRuntimeSplice [Entity Customer] -> PhbSplice customerRowSplice = rowSplice (ts <> ss) where ts = mapV (C.pureSplice . C.textSplice) $ do "name" ## (^.eVal.customerName) "id" ## (^.eKey.to spliceKey) ss = mempty
276
customerRowSplice = rowSplice (ts <> ss) where ts = mapV (C.pureSplice . C.textSplice) $ do "name" ## (^.eVal.customerName) "id" ## (^.eKey.to spliceKey) ss = mempty
207
false
true
0
11
73
94
48
46
null
null
jrraymond/ray-tracer
src/BoundingVolumeHierarchy.hs
gpl-3.0
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
41
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
41
midPt YAxis (Sphere (Vec3 _ y _) _ _) = y
41
false
false
0
9
10
31
15
16
null
null
christiaanb/clash-tryout
src/CLaSH/Builtin.hs
bsd-3-clause
_ `andB` _ = L
14
_ `andB` _ = L
14
_ `andB` _ = L
14
false
false
0
5
4
14
7
7
null
null
alexander-at-github/eta
compiler/ETA/TypeCheck/TcArrows.hs
bsd-3-clause
------------------------------------------- -- Lambda -- -- D;G,x:t |-a cmd : stk --> res -- ------------------------------ -- D;G |-a (\x.cmd) : (t,stk) --> res tc_cmd env (HsCmdLam (MG { mg_alts = [L mtch_loc (match@(Match _ pats _maybe_rhs_sig grhss))], ...
1,787
tc_cmd env (HsCmdLam (MG { mg_alts = [L mtch_loc (match@(Match _ pats _maybe_rhs_sig grhss))], mg_origin = origin })) (cmd_stk, res_ty) = addErrCtxt (pprMatchInCtxt match_ctxt match) $ do { (co, arg_tys, cmd_stk') <- matchExpectedCmdA...
1,611
tc_cmd env (HsCmdLam (MG { mg_alts = [L mtch_loc (match@(Match _ pats _maybe_rhs_sig grhss))], mg_origin = origin })) (cmd_stk, res_ty) = addErrCtxt (pprMatchInCtxt match_ctxt match) $ do { (co, arg_tys, cmd_stk') <- matchExpectedCmdA...
1,611
true
false
2
16
642
449
234
215
null
null
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Haskell/basic_haskell/take_1.hs
mit
primCmpInt :: MyInt -> MyInt -> Ordering; primCmpInt (Pos Zero) (Pos Zero) = EQ
83
primCmpInt :: MyInt -> MyInt -> Ordering primCmpInt (Pos Zero) (Pos Zero) = EQ
82
primCmpInt (Pos Zero) (Pos Zero) = EQ
37
false
true
0
7
17
37
19
18
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxSTC_ERLANG_CHARACTER :: Int wxSTC_ERLANG_CHARACTER = 9
56
wxSTC_ERLANG_CHARACTER :: Int wxSTC_ERLANG_CHARACTER = 9
56
wxSTC_ERLANG_CHARACTER = 9
26
false
true
0
4
5
11
6
5
null
null
Proclivis/wxHaskell
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
lgpl-2.1
wxBRUSHSTYLE_LAST_HATCH :: Int wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
74
wxBRUSHSTYLE_LAST_HATCH :: Int wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
74
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
43
false
true
0
4
5
11
6
5
null
null
jeroennoels/exact-real
test/Ternary/Examples.hs
mit
z = Exact (cycle allT2) 0
25
z = Exact (cycle allT2) 0
25
z = Exact (cycle allT2) 0
25
false
false
1
7
5
20
8
12
null
null
oldmanmike/ghc
compiler/simplStg/UnariseStg.hs
bsd-3-clause
unariseBinding :: UniqSupply -> UnariseEnv -> StgBinding -> StgBinding unariseBinding us rho bind = case bind of StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs) StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs)) (listSplitUniqSupply us) xrhs...
321
unariseBinding :: UniqSupply -> UnariseEnv -> StgBinding -> StgBinding unariseBinding us rho bind = case bind of StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs) StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs)) (listSplitUniqSupply us) xrhs...
321
unariseBinding us rho bind = case bind of StgNonRec x rhs -> StgNonRec x (unariseRhs us rho rhs) StgRec xrhss -> StgRec $ zipWith (\us (x, rhs) -> (x, unariseRhs us rho rhs)) (listSplitUniqSupply us) xrhss
250
false
true
6
9
89
115
58
57
null
null
bravit/Idris-dev
src/Idris/Core/TT.hs
bsd-3-clause
showEnvDbg env t = showEnv' env t True
38
showEnvDbg env t = showEnv' env t True
38
showEnvDbg env t = showEnv' env t True
38
false
false
0
5
7
19
8
11
null
null
FranklinChen/ghc-vis
src/GHC/Vis.hs
bsd-3-clause
mVisMainThread :: IO () mVisMainThread = do initGUI window <- windowNew canvas <- drawingAreaNew widgetModifyBg canvas StateNormal backgroundColor set window [ windowTitle := title , containerChild := canvas ] (uncurry $ windowSetDefaultSize window) defaultSize on canvas draw...
487
mVisMainThread :: IO () mVisMainThread = do initGUI window <- windowNew canvas <- drawingAreaNew widgetModifyBg canvas StateNormal backgroundColor set window [ windowTitle := title , containerChild := canvas ] (uncurry $ windowSetDefaultSize window) defaultSize on canvas draw...
487
mVisMainThread = do initGUI window <- windowNew canvas <- drawingAreaNew widgetModifyBg canvas StateNormal backgroundColor set window [ windowTitle := title , containerChild := canvas ] (uncurry $ windowSetDefaultSize window) defaultSize on canvas draw $ do runCorrect red...
463
false
true
0
13
122
151
68
83
null
null
klarh/temper
src/Text/Temper.hs
mit
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
69
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
69
encodeElement (SpecialTag conts) = "<!" `T.append` conts `T.snoc` '>'
69
false
false
0
7
8
31
17
14
null
null
jtdaugherty/vty
test/Rogue.hs
bsd-3-clause
pieceA, dumpA :: Attr pieceA = defAttr `withForeColor` blue `withBackColor` green
81
pieceA, dumpA :: Attr pieceA = defAttr `withForeColor` blue `withBackColor` green
81
pieceA = defAttr `withForeColor` blue `withBackColor` green
59
false
true
2
6
10
33
16
17
null
null
gcampax/ghc
compiler/hsSyn/HsExpr.hs
bsd-3-clause
----------------- pprAStmtContext, pprStmtContext :: Outputable id => HsStmtContext id -> SDoc pprAStmtContext ctxt = article <+> pprStmtContext ctxt where pp_an = ptext (sLit "an") pp_a = ptext (sLit "a") article = case ctxt of MDoExpr -> pp_an PArrComp -> ...
426
pprAStmtContext, pprStmtContext :: Outputable id => HsStmtContext id -> SDoc pprAStmtContext ctxt = article <+> pprStmtContext ctxt where pp_an = ptext (sLit "an") pp_a = ptext (sLit "a") article = case ctxt of MDoExpr -> pp_an PArrComp -> pp_an ...
408
pprAStmtContext ctxt = article <+> pprStmtContext ctxt where pp_an = ptext (sLit "an") pp_a = ptext (sLit "a") article = case ctxt of MDoExpr -> pp_an PArrComp -> pp_an GhciStmtCtxt -> pp_an _ -> pp_a ------...
331
true
true
2
9
159
105
52
53
null
null
tbarnetlamb/hyphen
hyphen/lowlevel_src/Hyphen.hs
gpl-2.0
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
61
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
61
from_haskell_Int_impl = withHsObjRawSimp pythonateInt
61
false
false
0
5
11
9
4
5
null
null
aartamonau/repo-bisect
src/Snapshot.hs
gpl-3.0
options :: [OptDescr (Options -> Options)] options = [ forceDateOpt , overwriteSnapshot , resolveRefNames ] where forceDateOpt = Option "d" ["--force-date"] (NoArg $ \opts -> opts { forceDate = True }) "interpret command argumen...
771
options :: [OptDescr (Options -> Options)] options = [ forceDateOpt , overwriteSnapshot , resolveRefNames ] where forceDateOpt = Option "d" ["--force-date"] (NoArg $ \opts -> opts { forceDate = True }) "interpret command argumen...
771
options = [ forceDateOpt , overwriteSnapshot , resolveRefNames ] where forceDateOpt = Option "d" ["--force-date"] (NoArg $ \opts -> opts { forceDate = True }) "interpret command argument as a date" overwriteSnapshot = Op...
728
false
true
0
10
306
153
84
69
null
null
Peaker/lamdu
src/Lamdu/GUI/Expr/LiteralEdit.hs
gpl-3.0
textEdit :: _ => Property o Text -> Sugar.Payload v o -> m (M.TextWidget o) textEdit prop pl = do text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl) label Texts.textOpener M./|/ pure text M./|/ ((M.tValue %~) ...
481
textEdit :: _ => Property o Text -> Sugar.Payload v o -> m (M.TextWidget o) textEdit prop pl = do text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl) label Texts.textOpener M./|/ pure text M./|/ ((M.tValue %~) ...
481
textEdit prop pl = do text <- TextEdits.make ?? emptyTexts ?? prop ?? WidgetIds.literalEditOf (WidgetIds.fromExprPayload pl) label Texts.textOpener M./|/ pure text M./|/ ((M.tValue %~) <$> (Element.padToSize ?? (text ^. Element.size & _1 .~ 0) ?? 1) ...
405
false
true
0
19
161
170
82
88
null
null
keithodulaigh/Hets
QVTR/StatAna.hs
gpl-2.0
getSomething :: [Maybe a] -> [a] getSomething list = case list of [] -> [] el : rest -> case el of Nothing -> getSomething rest Just typ -> typ : getSomething rest -- Creates a non-top version of a top rule in order to generate a parametrized version of itself
310
getSomething :: [Maybe a] -> [a] getSomething list = case list of [] -> [] el : rest -> case el of Nothing -> getSomething rest Just typ -> typ : getSomething rest -- Creates a non-top version of a top rule in order to generate a parametrized version of itself
310
getSomething list = case list of [] -> [] el : rest -> case el of Nothing -> getSomething rest Just typ -> typ : getSomething rest -- Creates a non-top version of a top rule in order to generate a parametrized version of itself
277
false
true
0
12
100
86
41
45
null
null
calebgregory/fp101x
wk3/lab2.hs
mit
n = 1234
8
n = 1234
8
n = 1234
8
false
false
1
5
2
10
3
7
null
null
rueshyna/gogol
gogol-genomics/gen/Network/Google/Resource/Genomics/Variants/Search.hs
mpl-2.0
-- | OAuth access token. vsAccessToken :: Lens' VariantsSearch (Maybe Text) vsAccessToken = lens _vsAccessToken (\ s a -> s{_vsAccessToken = a})
152
vsAccessToken :: Lens' VariantsSearch (Maybe Text) vsAccessToken = lens _vsAccessToken (\ s a -> s{_vsAccessToken = a})
127
vsAccessToken = lens _vsAccessToken (\ s a -> s{_vsAccessToken = a})
76
true
true
0
9
29
48
25
23
null
null
typedvar/hLand
hcore/GMachine.hs
mit
gmDispatch Eq = comparison (==)
31
gmDispatch Eq = comparison (==)
31
gmDispatch Eq = comparison (==)
31
false
false
0
5
4
14
7
7
null
null
gust/feature-creature
feature-creature/backend/app/Routing.hs
mit
eitherToMaybe (Right r) = Just r
32
eitherToMaybe (Right r) = Just r
32
eitherToMaybe (Right r) = Just r
32
false
false
0
7
5
18
8
10
null
null
DavidAlphaFox/ghc
libraries/bytestring/Data/ByteString/Char8.hs
bsd-3-clause
readInteger :: ByteString -> Maybe (Integer, ByteString) readInteger as | null as = Nothing | otherwise = case unsafeHead as of '-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs) '+' -> first (B.unsafeTail as) _ -> first as where first ps | null p...
2,059
readInteger :: ByteString -> Maybe (Integer, ByteString) readInteger as | null as = Nothing | otherwise = case unsafeHead as of '-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs) '+' -> first (B.unsafeTail as) _ -> first as where first ps | null p...
2,059
readInteger as | null as = Nothing | otherwise = case unsafeHead as of '-' -> first (B.unsafeTail as) >>= \(n, bs) -> return (-n, bs) '+' -> first (B.unsafeTail as) _ -> first as where first ps | null ps = Nothing | otherwise = ...
2,002
false
true
8
18
909
631
313
318
null
null
Ericson2314/clash-prelude
src/CLaSH/Prelude/BlockRam.hs
bsd-2-clause
blockRam# :: KnownNat n => SClock clk -- ^ 'Clock' to synchronize to -> Vec n a -- ^ Initial content of the BRAM, also -- determines the size, @n@, of the BRAM. -- -- __NB__: __MUST__ be a consta...
1,062
blockRam# :: KnownNat n => SClock clk -- ^ 'Clock' to synchronize to -> Vec n a -- ^ Initial content of the BRAM, also -- determines the size, @n@, of the BRAM. -- -- __NB__: __MUST__ be a consta...
965
blockRam# clk content wr rd en din = register' clk undefined dout where szI = maxIndex content dout = runST $ do arr <- newListArray (0,szI) (toList content) traverse (ramT arr) (bundle' clk (wr,rd,en,din)) ramT :: STArray s Int e -> (Int,Int,Bool,e) -> ST s e ramT ram (w,r,e,d) = do ...
394
true
true
4
12
410
274
142
132
null
null
Lainepress/hledger
hledger-lib/Hledger/Utils.hs
gpl-3.0
isLeft _ = False
23
isLeft _ = False
23
isLeft _ = False
23
false
false
0
4
10
10
4
6
null
null
ghcjs/jsaddle-dom
src/JSDOM/Generated/SVGFECompositeElement.hs
mit
-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGFECompositeElement.k2 Mozilla SVGFECompositeElement.k2 documentation> getK2 :: (MonadDOM m) => SVGFECompositeElement -> m SVGAnimatedNumber getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
268
getK2 :: (MonadDOM m) => SVGFECompositeElement -> m SVGAnimatedNumber getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
139
getK2 self = liftDOM ((self ^. js "k2") >>= fromJSValUnchecked)
63
true
true
0
10
31
56
27
29
null
null
prashant007/AMPL
myAMPL/src/Semantics/AMPL_am.hs
mit
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s) where ci = get_from_list "Case!" cs (i-1) ------------------------------------------------------------------------------
223
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s) where ci = get_from_list "Case!" cs (i-1) ------------------------------------------------------------------------------
223
seq_step ((AMC_CASE cs):c,e,V_CONS(i,sl):s) defs = (ci,sl ++ e,V_CLO(c,e):s) where ci = get_from_list "Case!" cs (i-1) ------------------------------------------------------------------------------
223
false
false
1
9
41
95
50
45
null
null
prasmussen/glot-www
Glot/Language.hs
mit
idToText :: Id -> Text.Text idToText (Id id) = id
53
idToText :: Id -> Text.Text idToText (Id id) = id
53
idToText (Id id) = id
25
false
true
0
9
13
32
14
18
null
null
tjunier/mlgsc
src/TaxoParser.hs
mit
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
59
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
59
taxolines = map (ST.splitOn (ST.pack "; ")) $ ST.lines taxo
59
false
false
1
10
9
37
16
21
null
null
haroldcarr/learn-haskell-coq-ml-etc
haskell/book/2011-Learn_You_a_Haskell/Learn_You_a_Haskell.hs
unlicense
-- patterns p 37 -- a handy way of breaking something via pattern and binding to names -- while keeping a reference to the whole thing capital :: String -> String capital "" = "Empty string , whoops!"
201
capital :: String -> String capital "" = "Empty string , whoops!"
65
capital "" = "Empty string , whoops!"
37
true
true
0
7
38
27
13
14
null
null
gridaphobe/ghc
compiler/typecheck/TcRnTypes.hs
bsd-3-clause
pprEvVarWithType :: EvVar -> SDoc pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
97
pprEvVarWithType :: EvVar -> SDoc pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
97
pprEvVarWithType v = ppr v <+> dcolon <+> pprType (evVarPred v)
63
false
true
0
8
15
43
19
24
null
null
mikeizbicki/homoiconic
src/Homoiconic/Common/TH.hs
bsd-3-clause
isList _ = False
16
isList _ = False
16
isList _ = False
16
false
false
0
5
3
9
4
5
null
null
ollef/Grempa
examples/Ex1SimpleExprParser.hs
bsd-3-clause
parseExprStatic :: Parser Char E -- For making static parsers, Grempa needs both the "representation" of the -- grammar, which in this case is achieved by [|expr|], and the grammar itself, -- which is the reason for the repetition of arguments to the function. parseExprStatic = $(mkStaticParser expr [|expr|])
310
parseExprStatic :: Parser Char E parseExprStatic = $(mkStaticParser expr [|expr|])
82
parseExprStatic = $(mkStaticParser expr [|expr|])
49
true
true
1
8
48
35
18
17
null
null
ideas-edu/ideas
src/Ideas/Common/Predicate.hs
apache-2.0
predicateView :: View a b -> Predicate a predicateView = PView
63
predicateView :: View a b -> Predicate a predicateView = PView
62
predicateView = PView
21
false
true
0
6
11
23
11
12
null
null
beni55/haste-compiler
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
bsd-3-clause
-- | Reads vector; offset in scalar elements. readInt8OffAddrAsInt8X64# :: Addr# -> Int# -> State# s -> (# State# s,Int8X64# #) readInt8OffAddrAsInt8X64# = let x = x in x
172
readInt8OffAddrAsInt8X64# :: Addr# -> Int# -> State# s -> (# State# s,Int8X64# #) readInt8OffAddrAsInt8X64# = let x = x in x
124
readInt8OffAddrAsInt8X64# = let x = x in x
42
true
true
0
11
30
53
24
29
null
null
romanb/amazonka
amazonka-autoscaling/gen/Network/AWS/AutoScaling/CreateAutoScalingGroup.hs
mpl-2.0
-- | The tag to be created or updated. Each tag should be defined by its resource -- type, resource ID, key, value, and a propagate flag. Valid values: key=/value/, -- value=/value/, propagate=/true/ or /false/. Value and propagate are optional -- parameters. -- -- For more information, see <http://docs.aws.amazon.com/...
569
casgTags :: Lens' CreateAutoScalingGroup [Tag] casgTags = lens _casgTags (\s a -> s { _casgTags = a }) . _List
110
casgTags = lens _casgTags (\s a -> s { _casgTags = a }) . _List
63
true
true
0
10
83
53
32
21
null
null
ocharles/hs-quake-3
Quake3/Shader/TypeCheck.hs
bsd-3-clause
-------------------------------------------------------------------------------- tcInt :: String -> Validation [String] Int tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
203
tcInt :: String -> Validation [String] Int tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
121
tcInt s = maybe (Failure ["\"" ++ s ++ "\" is not an Int"]) pure (readMaybe s)
78
true
true
0
10
25
62
30
32
null
null
brendanhay/gogol
gogol-drive/gen/Network/Google/Drive/Types/Product.hs
mpl-2.0
-- | Whether the current user can change the securityUpdateEnabled field on -- link share metadata. fcCanChangeSecurityUpdateEnabled :: Lens' FileCapabilities (Maybe Bool) fcCanChangeSecurityUpdateEnabled = lens _fcCanChangeSecurityUpdateEnabled (\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
305
fcCanChangeSecurityUpdateEnabled :: Lens' FileCapabilities (Maybe Bool) fcCanChangeSecurityUpdateEnabled = lens _fcCanChangeSecurityUpdateEnabled (\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
205
fcCanChangeSecurityUpdateEnabled = lens _fcCanChangeSecurityUpdateEnabled (\ s a -> s{_fcCanChangeSecurityUpdateEnabled = a})
133
true
true
0
9
40
49
26
23
null
null
mightymoose/liquidhaskell
src/Language/Haskell/Liquid/RefType.hs
bsd-3-clause
strengthenRefType_ f (RAllP p t1) t2 = RAllP p $ strengthenRefType_ f t1 t2
77
strengthenRefType_ f (RAllP p t1) t2 = RAllP p $ strengthenRefType_ f t1 t2
77
strengthenRefType_ f (RAllP p t1) t2 = RAllP p $ strengthenRefType_ f t1 t2
77
false
false
0
7
15
35
16
19
null
null
oldmanmike/ghc
compiler/nativeGen/X86/Ppr.hs
bsd-3-clause
{- Gruesome swamp follows. If you're unfortunate enough to have ventured this far into the jungle AND you give a Rat's Ass (tm) what's going on, here's the deal. Generate code to do a floating point comparison of src1 and src2, of kind cond, and set the Zero flag if true. The complications are to do with...
3,075
pprInstr g@(GCMP cond src1 src2) | case cond of { NE -> True; _ -> False } = pprG g (vcat [ hcat [gtab, text "pushl %eax ; ",gpush src1 0], hcat [gtab, text "fcomp ", greg src2 1, text "; fstsw %ax ; sahf ; setpe %ah"], hcat [gtab, text "setne %al ; ", t...
1,184
pprInstr g@(GCMP cond src1 src2) | case cond of { NE -> True; _ -> False } = pprG g (vcat [ hcat [gtab, text "pushl %eax ; ",gpush src1 0], hcat [gtab, text "fcomp ", greg src2 1, text "; fstsw %ax ; sahf ; setpe %ah"], hcat [gtab, text "setne %al ; ", t...
1,184
true
false
0
14
1,052
317
162
155
null
null
bgamari/text
src/Data/Text/Lazy.hs
bsd-2-clause
-- ---------------------------------------------------------------------------- -- ** Case conversions (folds) -- $case -- -- With Unicode text, it is incorrect to use combinators like @map -- toUpper@ to case convert each character of a string individually. -- Instead, use the whole-string case conversion functions f...
1,188
toCaseFold :: Text -> Text toCaseFold t = unstream (S.toCaseFold (stream t))
76
toCaseFold t = unstream (S.toCaseFold (stream t))
49
true
true
0
9
199
60
42
18
null
null
junjihashimoto/hsverilog
src/HsVerilog/Simulation.hs
bsd-3-clause
readReg :: Monad m => T.Text -> StateT Circuit m Integer readReg name = do cir <- get let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg] return $ sval $ m M.! name
218
readReg :: Monad m => T.Text -> StateT Circuit m Integer readReg name = do cir <- get let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg] return $ sval $ m M.! name
218
readReg name = do cir <- get let m = M.fromList $ map (\sig -> (sname sig,sig)) $ concat $ map (\f -> f cir) [(map alsig).creg] return $ sval $ m M.! name
160
false
true
0
17
51
133
64
69
null
null
spechub/Hets
Comorphisms/THFP2THF0.hs
gpl-2.0
isProdT m (ParType t) = isProdT m t
35
isProdT m (ParType t) = isProdT m t
35
isProdT m (ParType t) = isProdT m t
35
false
false
0
7
7
22
10
12
null
null
atomb/dalvik
Dalvik/Instruction.hs
bsd-3-clause
iparser :: Word8 -> IFormatParser iparser = (!) iparseTable
59
iparser :: Word8 -> IFormatParser iparser = (!) iparseTable
59
iparser = (!) iparseTable
25
false
true
0
5
8
20
11
9
null
null
luebbers/reconos
tools/fsmLanguage/kurm/assembler/Parser.hs
gpl-3.0
r0 = dreg "r0" 0
17
r0 = dreg "r0" 0
17
r0 = dreg "r0" 0
17
false
false
1
5
5
14
5
9
null
null
feuerbach/stackage
stackage-upload.hs
mit
mkIndex :: String -> [String] -> String mkIndex snapid dirs = concat [ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>" , "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>" , "<link rel='stylesheet' href='style.css'>" , "<link rel...
897
mkIndex :: String -> [String] -> String mkIndex snapid dirs = concat [ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>" , "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>" , "<link rel='stylesheet' href='style.css'>" , "<link rel...
897
mkIndex snapid dirs = concat [ "<!DOCTYPE html>\n<html lang='en'><head><title>Haddocks index</title>" , "<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css'>" , "<link rel='stylesheet' href='style.css'>" , "<link rel='shortcut icon' href='http://www.stacka...
857
false
true
1
8
188
111
60
51
null
null
skeskinen/neflEFortress
Creature.hs
mit
nameGenerator :: String nameGenerator = "Uther"
47
nameGenerator :: String nameGenerator = "Uther"
47
nameGenerator = "Uther"
23
false
true
0
4
5
11
6
5
null
null
bitemyapp/hoq
src/Semantics.hs
gpl-2.0
isInj Universe{} = True
23
isInj Universe{} = True
23
isInj Universe{} = True
23
false
false
1
5
3
16
6
10
null
null
dmpots/fibon
FindConfig.hs
bsd-3-clause
modulesList :: [String] -> String modulesList mods = typ ++ lst where typ = "localConfigs :: [RunConfig]\n" lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]" cfgs = map (++".config") mods join s = concat . intersperse s
232
modulesList :: [String] -> String modulesList mods = typ ++ lst where typ = "localConfigs :: [RunConfig]\n" lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]" cfgs = map (++".config") mods join s = concat . intersperse s
232
modulesList mods = typ ++ lst where typ = "localConfigs :: [RunConfig]\n" lst = "localConfigs = [" ++ (join ", " cfgs) ++ "]" cfgs = map (++".config") mods join s = concat . intersperse s
198
false
true
0
8
51
83
43
40
null
null
codingiam/sandbox-hs
src/Hw04.hs
bsd-3-clause
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
79
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
79
fun2 n | even n = n + fun2 (n `div` 2) | otherwise = fun2 (3 * n + 1)
79
false
false
2
8
30
64
29
35
null
null
dbp/snaplet-wordpress
src/Web/Offset/Cache.hs
bsd-3-clause
cacheSet :: CacheBehavior -> Text -> Text -> Redis Bool cacheSet b k v = case b of (CacheSeconds n) -> rsetex k n v CacheForever -> rset k v NoCache -> return True
174
cacheSet :: CacheBehavior -> Text -> Text -> Redis Bool cacheSet b k v = case b of (CacheSeconds n) -> rsetex k n v CacheForever -> rset k v NoCache -> return True
174
cacheSet b k v = case b of (CacheSeconds n) -> rsetex k n v CacheForever -> rset k v NoCache -> return True
118
false
true
0
9
44
76
36
40
null
null
urbanslug/ghc
compiler/simplCore/CoreMonad.hs
bsd-3-clause
getAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (UniqFM [a]) getAnnotations deserialize guts = do hsc_env <- getHscEnv ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts) return (deserializeAnns deserialize ann_env) -- | Get at most one annotation of a given type per Unique.
317
getAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (UniqFM [a]) getAnnotations deserialize guts = do hsc_env <- getHscEnv ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts) return (deserializeAnns deserialize ann_env) -- | Get at most one annotation of a given type per Unique.
317
getAnnotations deserialize guts = do hsc_env <- getHscEnv ann_env <- liftIO $ prepareAnnotations hsc_env (Just guts) return (deserializeAnns deserialize ann_env) -- | Get at most one annotation of a given type per Unique.
237
false
true
0
12
62
102
48
54
null
null
tolysz/prepare-ghcjs
spec-lts8/base/GHC/Foreign.hs
bsd-3-clause
withEncodedCString :: TextEncoding -- ^ Encoding of CString to create -> Bool -- ^ Null-terminate? -> String -- ^ String to encode -> (CStringLen -> IO a) -- ^ Worker that can safely use the allocated memory ...
1,083
withEncodedCString :: TextEncoding -- ^ Encoding of CString to create -> Bool -- ^ Null-terminate? -> String -- ^ String to encode -> (CStringLen -> IO a) -- ^ Worker that can safely use the allocated memory ...
1,083
withEncodedCString (TextEncoding { mkTextEncoder = mk_encoder }) null_terminate s act = bracket mk_encoder close $ \encoder -> withArrayLen s $ \sz p -> do from <- fmap (\fp -> bufferAdd sz (emptyBuffer fp sz ReadBuffer)) $ newForeignPtr_ p let go iteration to_sz_bytes = do putDebugMsg ("withE...
753
false
true
0
25
364
271
134
137
null
null
lally/org-issue-sync
src/TestParse.hs
apache-2.0
main :: IO () main = do argv <- getArgs case getOpt Permute options argv of (_, _, errs@(e:es)) -> ioError ( userError (concat errs ++ usageInfo "Org Test Parse" options)) (o, files, []) -> do let opts = foldl (flip id) dfltOptions o mapM_ (processFile opts) files
294
main :: IO () main = do argv <- getArgs case getOpt Permute options argv of (_, _, errs@(e:es)) -> ioError ( userError (concat errs ++ usageInfo "Org Test Parse" options)) (o, files, []) -> do let opts = foldl (flip id) dfltOptions o mapM_ (processFile opts) files
294
main = do argv <- getArgs case getOpt Permute options argv of (_, _, errs@(e:es)) -> ioError ( userError (concat errs ++ usageInfo "Org Test Parse" options)) (o, files, []) -> do let opts = foldl (flip id) dfltOptions o mapM_ (processFile opts) files
280
false
true
1
10
77
126
68
58
null
null
forked-upstream-packages-for-ghcjs/ghcjs
ghcjs/src/Gen2/Archive.hs
mit
withEntry :: String -> String -> (Entry -> Bool) -> (Handle -> Int64 -> IO a) -> Sections -> Index -> Handle -> IO a withEntry name entryName p f sections index h = case filter (p . ieEntry) index of [] -> error (name ++ ": cannot find " ++ entryName) [IndexEntry _ o l] -> do ...
476
withEntry :: String -> String -> (Entry -> Bool) -> (Handle -> Int64 -> IO a) -> Sections -> Index -> Handle -> IO a withEntry name entryName p f sections index h = case filter (p . ieEntry) index of [] -> error (name ++ ": cannot find " ++ entryName) [IndexEntry _ o l] -> do ...
476
withEntry name entryName p f sections index h = case filter (p . ieEntry) index of [] -> error (name ++ ": cannot find " ++ entryName) [IndexEntry _ o l] -> do hSeek h AbsoluteSeek (dataSectionStart sections + toInteger o) f h (fromIntegral l) _ -> error (name ++ ": multiple matches for " ++ e...
329
false
true
0
13
137
193
93
100
null
null
tonyday567/lucid-page
src/Web/Rep/SharedReps.hs
mit
-- | turns a SharedRep into a fiddle viaFiddle :: (Monad m) => SharedRep m a -> SharedRep m (Bool, Concerns Text, a) viaFiddle sr = SharedRep $ do sr'@(Rep h _) <- unshare sr hrep <- unshare $ textarea 10 (Just "html") (toText h) crep <- unshare $ textarea 10 (Just "css") mempty jrep <- unshare $ textarea...
606
viaFiddle :: (Monad m) => SharedRep m a -> SharedRep m (Bool, Concerns Text, a) viaFiddle sr = SharedRep $ do sr'@(Rep h _) <- unshare sr hrep <- unshare $ textarea 10 (Just "html") (toText h) crep <- unshare $ textarea 10 (Just "css") mempty jrep <- unshare $ textarea 10 (Just "js") mempty u <- unshare...
569
viaFiddle sr = SharedRep $ do sr'@(Rep h _) <- unshare sr hrep <- unshare $ textarea 10 (Just "html") (toText h) crep <- unshare $ textarea 10 (Just "css") mempty jrep <- unshare $ textarea 10 (Just "js") mempty u <- unshare $ button (Just "update") pure $ bimap (\up a b c _ -> Lucid.with div_ [cl...
483
true
true
2
18
174
289
142
147
null
null
c0deaddict/project-euler
src/Part1/Problem17.hs
bsd-3-clause
numberLetters 14 = "fourteen"
29
numberLetters 14 = "fourteen"
29
numberLetters 14 = "fourteen"
29
false
false
0
5
3
9
4
5
null
null
phi16/Lambia
src/Lambia/Parse.hs
gpl-3.0
lf :: Parser () lf = eof <|> do let l = let a = try $ do none string "//" <|> string ":" manyTill anyChar $ try $ void endOfLine <|> eof return () b = try $ do none void endOfLine c = do spaces1 eof in ch...
393
lf :: Parser () lf = eof <|> do let l = let a = try $ do none string "//" <|> string ":" manyTill anyChar $ try $ void endOfLine <|> eof return () b = try $ do none void endOfLine c = do spaces1 eof in ch...
393
lf = eof <|> do let l = let a = try $ do none string "//" <|> string ":" manyTill anyChar $ try $ void endOfLine <|> eof return () b = try $ do none void endOfLine c = do spaces1 eof in choice [a,b,c] l...
377
false
true
9
16
184
158
74
84
null
null
adamgundry/units-parser
Tests/Parser.hs
bsd-3-clause
leftOnly :: Either a b -> Maybe a leftOnly (Left a) = Just a
60
leftOnly :: Either a b -> Maybe a leftOnly (Left a) = Just a
60
leftOnly (Left a) = Just a
26
false
true
0
7
13
35
16
19
null
null
gbaz/cabal
cabal-install/tests/UnitTests/Distribution/Client/ProjectConfig.hs
bsd-3-clause
prop_roundtrip_legacytypes_all :: ProjectConfig -> Bool prop_roundtrip_legacytypes_all = roundtrip_legacytypes
114
prop_roundtrip_legacytypes_all :: ProjectConfig -> Bool prop_roundtrip_legacytypes_all = roundtrip_legacytypes
114
prop_roundtrip_legacytypes_all = roundtrip_legacytypes
58
false
true
0
5
11
15
8
7
null
null
edsko/cabal
Cabal/src/Distribution/PackageDescription.hs
bsd-3-clause
emptyLibrary :: Library emptyLibrary = mempty
45
emptyLibrary :: Library emptyLibrary = mempty
45
emptyLibrary = mempty
21
false
true
0
4
5
11
6
5
null
null
ryota-ka/yo-slack-adapter
src/Web/Slack/IncomingWebhook/Message.hs
bsd-3-clause
withChannel :: Message -> String -> Message withChannel m channel = m { messageChannel = Just channel }
103
withChannel :: Message -> String -> Message withChannel m channel = m { messageChannel = Just channel }
103
withChannel m channel = m { messageChannel = Just channel }
59
false
true
0
7
17
35
18
17
null
null
CloudI/CloudI
src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Short/Internal.hs
mit
copyAddrToByteArray :: Ptr a -> MBA RealWorld -> Int -> Int -> ST RealWorld () copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) = ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of s -> (# s, () #)
251
copyAddrToByteArray :: Ptr a -> MBA RealWorld -> Int -> Int -> ST RealWorld () copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) = ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of s -> (# s, () #)
251
copyAddrToByteArray (Ptr src#) (MBA# dst#) (I# dst_off#) (I# len#) = ST $ \s -> case copyAddrToByteArray# src# dst# dst_off# len# s of s -> (# s, () #)
172
false
true
2
12
63
116
55
61
null
null
ihc/futhark
src/Futhark/Optimise/Simplifier/Engine.hs
isc
putEngineState :: State (SimpleM lore) -> SimpleM lore () putEngineState x = modify $ \(_, y) -> (x,y)
102
putEngineState :: State (SimpleM lore) -> SimpleM lore () putEngineState x = modify $ \(_, y) -> (x,y)
102
putEngineState x = modify $ \(_, y) -> (x,y)
44
false
true
0
8
17
55
29
26
null
null
orchid-hybrid/WHILE
EllaBased/Assembly.hs
gpl-2.0
s' (ADec x) = sp "dec" ++ op x
30
s' (ADec x) = sp "dec" ++ op x
30
s' (ADec x) = sp "dec" ++ op x
30
false
false
0
7
8
25
11
14
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/supermonad/CodeGenMonad.hs
bsd-3-clause
cgTest :: CG String Int () cgTest = do l1 <- newName l2 <- newName emitAux 0 emit ("LABEL " ++ l1) emit ("PUSH 0") divert cgTest1 emit ("JUMPIFZ " ++ l2) emit ("JUMP " ++ l1) emitAux 10 l3 <- newName emit ("LABEL " ++ l2) emit ("LABEL " ++ l3)
291
cgTest :: CG String Int () cgTest = do l1 <- newName l2 <- newName emitAux 0 emit ("LABEL " ++ l1) emit ("PUSH 0") divert cgTest1 emit ("JUMPIFZ " ++ l2) emit ("JUMP " ++ l1) emitAux 10 l3 <- newName emit ("LABEL " ++ l2) emit ("LABEL " ++ l3)
291
cgTest = do l1 <- newName l2 <- newName emitAux 0 emit ("LABEL " ++ l1) emit ("PUSH 0") divert cgTest1 emit ("JUMPIFZ " ++ l2) emit ("JUMP " ++ l1) emitAux 10 l3 <- newName emit ("LABEL " ++ l2) emit ("LABEL " ++ l3)
264
false
true
1
10
99
139
59
80
null
null
svaiter/fay-canvas
src/HtmlCanvas.hs
bsd-3-clause
newImage :: Fay Image newImage = ffi "new Image()"
50
newImage :: Fay Image newImage = ffi "new Image()"
50
newImage = ffi "new Image()"
28
false
true
0
5
8
17
8
9
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsDecls.hs
bsd-3-clause
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a appendGroups HsGroup { hs_valds = val_groups1, hs_splcds = spliceds1, hs_tyclds = tyclds1, hs_instds = instds1, hs_derivds = derivds1, hs_fixds = fixds1, hs_defds = defds1, hs_annds = annds...
1,465
appendGroups :: HsGroup a -> HsGroup a -> HsGroup a appendGroups HsGroup { hs_valds = val_groups1, hs_splcds = spliceds1, hs_tyclds = tyclds1, hs_instds = instds1, hs_derivds = derivds1, hs_fixds = fixds1, hs_defds = defds1, hs_annds = annds...
1,465
appendGroups HsGroup { hs_valds = val_groups1, hs_splcds = spliceds1, hs_tyclds = tyclds1, hs_instds = instds1, hs_derivds = derivds1, hs_fixds = fixds1, hs_defds = defds1, hs_annds = annds1, hs_fords = fords1, hs_warnds =...
1,413
false
true
0
7
578
330
202
128
null
null
sdiehl/ghc
compiler/nativeGen/PPC/Instr.hs
bsd-3-clause
interesting _ (RegReal (RealRegPair{})) = panic "PPC.Instr.interesting: no reg pairs on this arch"
109
interesting _ (RegReal (RealRegPair{})) = panic "PPC.Instr.interesting: no reg pairs on this arch"
109
interesting _ (RegReal (RealRegPair{})) = panic "PPC.Instr.interesting: no reg pairs on this arch"
109
false
false
0
9
23
27
13
14
null
null
noteed/rescoyl
Rescoyl/Handlers.hs
bsd-3-clause
catch500 :: Handler App App a -> Handler App App () catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do putResponse $ setContentType "text/html" $ setResponseStatus 500 "Internal Server Error" emptyResponse writeText "The Rescoyl Docker registry exploded. Exception:\n\n" writeText $ T.pack $ show ...
386
catch500 :: Handler App App a -> Handler App App () catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do putResponse $ setContentType "text/html" $ setResponseStatus 500 "Internal Server Error" emptyResponse writeText "The Rescoyl Docker registry exploded. Exception:\n\n" writeText $ T.pack $ show ...
386
catch500 m = (m >> return ()) `catch` \(e::SomeException) -> do putResponse $ setContentType "text/html" $ setResponseStatus 500 "Internal Server Error" emptyResponse writeText "The Rescoyl Docker registry exploded. Exception:\n\n" writeText $ T.pack $ show e logError $ B.concat [ "caught exception: ", B.p...
334
false
true
0
14
70
139
65
74
null
null
phadej/base-orphans
test/System/Posix/Types/OrphansSpec.hs
mit
pred1HDevHDev :: (CDev -> CDev) -> (HDev -> HDev) -> HDev -> Bool pred1HDevHDev = pred1HDev eqCDevHDev
102
pred1HDevHDev :: (CDev -> CDev) -> (HDev -> HDev) -> HDev -> Bool pred1HDevHDev = pred1HDev eqCDevHDev
102
pred1HDevHDev = pred1HDev eqCDevHDev
36
false
true
0
8
16
40
21
19
null
null
mastensg/monitor
monitor.hs
mit
parse :: [String] -> IO () parse (command:paths) = do _ <- addWatches (eventHandler command paths) $ uniqDirs paths wait command
136
parse :: [String] -> IO () parse (command:paths) = do _ <- addWatches (eventHandler command paths) $ uniqDirs paths wait command
136
parse (command:paths) = do _ <- addWatches (eventHandler command paths) $ uniqDirs paths wait command
109
false
true
0
11
28
64
30
34
null
null
stevana/yeast
src/Yeast/Fetch.hs
isc
------------------------------------------------------------------------ -- $fetching -- We can fetch feeds in various ways. -- | Fetch a single feed. fetch :: String -- ^ URL. -> IO (Either FetchError Feed) fetch url = head <$> fetchMany [url]
271
fetch :: String -- ^ URL. -> IO (Either FetchError Feed) fetch url = head <$> fetchMany [url]
119
fetch url = head <$> fetchMany [url]
36
true
true
2
9
61
49
25
24
null
null
tittoassini/typed
src/ZM/To/Encoder.hs
bsd-3-clause
flds :: TypeEncoderMap -> [AbsType] -> Parser OBJ flds env ps = mconcat (map (typeEncoder_ env) ps)
99
flds :: TypeEncoderMap -> [AbsType] -> Parser OBJ flds env ps = mconcat (map (typeEncoder_ env) ps)
99
flds env ps = mconcat (map (typeEncoder_ env) ps)
49
false
true
0
9
16
52
24
28
null
null
TorosFanny/kaleidoscope
preprocessor.hs
mit
doSlice :: Block -> IO Block doSlice cb@(CodeBlock (id, classes, namevals) contents) = do res <- return $ do upper <- readMaybe =<< lookup "upper" namevals lower <- readMaybe =<< lookup "lower" namevals file <- lookup "slice" namevals return (upper, lower, file) case res of Nothing -> return c...
497
doSlice :: Block -> IO Block doSlice cb@(CodeBlock (id, classes, namevals) contents) = do res <- return $ do upper <- readMaybe =<< lookup "upper" namevals lower <- readMaybe =<< lookup "lower" namevals file <- lookup "slice" namevals return (upper, lower, file) case res of Nothing -> return c...
497
doSlice cb@(CodeBlock (id, classes, namevals) contents) = do res <- return $ do upper <- readMaybe =<< lookup "upper" namevals lower <- readMaybe =<< lookup "lower" namevals file <- lookup "slice" namevals return (upper, lower, file) case res of Nothing -> return cb Just (upper, lower, f) ...
468
false
true
0
18
122
204
99
105
null
null
kurnevsky/missile
src/Game.hs
agpl-3.0
playFieldMoves :: [Field] -> [(Pos, Player)] -> [Field] playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
148
playFieldMoves :: [Field] -> [(Pos, Player)] -> [Field] playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
148
playFieldMoves = foldl $ \fields (pos, player) -> putPoint pos player (head fields) : fields
92
false
true
0
10
22
68
38
30
null
null
penguinland/nlp
RuleGenerators.hs
gpl-3.0
-- The Rules for the new Node are the rules for the last Node merged. makeRule2AdoptingRules :: (Grammar -> Bool) -> (Grammar -> Bool) -> (Grammar -> Grammar -> Bool) -> (Grammar -> Grammar -> Grammar) -> Rule makeRule2AdoptingRules = makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
319
makeRule2AdoptingRules :: (Grammar -> Bool) -> (Grammar -> Bool) -> (Grammar -> Grammar -> Bool) -> (Grammar -> Grammar -> Grammar) -> Rule makeRule2AdoptingRules = makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
249
makeRule2AdoptingRules = makeRule2ArbitraryRules (\_ (Node _ rules _) -> rules)
83
true
true
0
11
77
87
47
40
null
null
beni55/text
Data/Text/Lazy.hs
bsd-2-clause
-- | /O(n)/, where @n@ is the length of the result. The 'unfoldr' -- function is analogous to the List 'L.unfoldr'. 'unfoldr' builds a -- 'Text' from a seed value. The function takes the element and -- returns 'Nothing' if it is done producing the 'Text', otherwise -- 'Just' @(a,b)@. In this case, @a@ is the next 'Cha...
542
unfoldr :: (a -> Maybe (Char,a)) -> a -> Text unfoldr f s = unstream (S.unfoldr (firstf safe . f) s)
100
unfoldr f s = unstream (S.unfoldr (firstf safe . f) s)
54
true
true
0
10
100
70
39
31
null
null
lindenbaum/mediabus
specs/Data/MediaBus/Conduit/ReorderSpec.hs
bsd-3-clause
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest) | snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest | otherwise = False
190
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest) | snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest | otherwise = False
190
isMonoIncreasingAndHigherThanStartSeqNumN sn (MkStream (Next (MkFrame () snFrame ())) : rest) | snFrame >= sn = isMonoIncreasingAndHigherThanStartSeqNumN snFrame rest | otherwise = False
190
false
false
1
13
25
64
30
34
null
null
ice1000/OI-codes
codewars/1-100/is-number-prime.hs
agpl-3.0
isPrime (-1) = False
20
isPrime (-1) = False
20
isPrime (-1) = False
20
false
false
0
7
3
14
7
7
null
null
carliros/dbjava
src/Jvm/PrettyClass.hs
bsd-3-clause
instruction2pp (inst:xs) counter = case inst of 0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1) 1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1) 2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1) 3 -> (pp counter >...
20,798
instruction2pp (inst:xs) counter = case inst of 0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1) 1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1) 2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1) 3 -> (pp counter >...
20,798
instruction2pp (inst:xs) counter = case inst of 0 -> (pp counter >#< text "nop"):instruction2pp xs (counter + 1) 1 -> (pp counter >#< text "aconst_null"):instruction2pp xs (counter + 1) 2 -> (pp counter >#< text "iconst_m1"):instruction2pp xs (counter + 1) 3 -> (pp counter >...
20,798
false
false
30
49
5,354
10,009
4,859
5,150
null
null
foreverbell/project-euler-solutions
src/185.hs
bsd-3-clause
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
66
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
66
main = (print . solve . parse) =<< readFile "input/p185_input.txt"
66
false
false
0
8
9
24
12
12
null
null
5outh/Bang
src/Bang.hs
mit
runComposition :: StateT (Connection, [Primitive PercussionSound]) IO () runComposition = do (conn, evs) <- get t <- lift $ currentTime conn case evs of [] -> return () (Rest _ : xs) -> do put (conn, xs) lift $ threadDelay 250 runComposition (e@(Note _ _) : xs) ...
497
runComposition :: StateT (Connection, [Primitive PercussionSound]) IO () runComposition = do (conn, evs) <- get t <- lift $ currentTime conn case evs of [] -> return () (Rest _ : xs) -> do put (conn, xs) lift $ threadDelay 250 runComposition (e@(Note _ _) : xs) ...
497
runComposition = do (conn, evs) <- get t <- lift $ currentTime conn case evs of [] -> return () (Rest _ : xs) -> do put (conn, xs) lift $ threadDelay 250 runComposition (e@(Note _ _) : xs) -> do let (MidiEvent s ev) = drumToMidiEvent e when (s < t) $...
424
false
true
3
16
172
226
104
122
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/Sites/List.hs
mpl-2.0
-- | Value of the nextPageToken from the previous result page. sitPageToken :: Lens' SitesList (Maybe Text) sitPageToken = lens _sitPageToken (\ s a -> s{_sitPageToken = a})
175
sitPageToken :: Lens' SitesList (Maybe Text) sitPageToken = lens _sitPageToken (\ s a -> s{_sitPageToken = a})
112
sitPageToken = lens _sitPageToken (\ s a -> s{_sitPageToken = a})
67
true
true
0
9
29
48
25
23
null
null
siddhanathan/ghc
compiler/deSugar/Coverage.hs
bsd-3-clause
getFreeVars :: TM a -> TM (FreeVars, a) getFreeVars (TM m) = TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
130
getFreeVars :: TM a -> TM (FreeVars, a) getFreeVars (TM m) = TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
130
getFreeVars (TM m) = TM $ \ env st -> case m env st of (a, fv, st') -> ((fv,a), fv, st')
90
false
true
0
11
31
86
47
39
null
null
MichaelBaker/proof-club
src/Schedule.hs
mit
extractExercises :: Lister Note b -> [Note] extractExercises = fst . partition isExercise . extract
99
extractExercises :: Lister Note b -> [Note] extractExercises = fst . partition isExercise . extract
99
extractExercises = fst . partition isExercise . extract
55
false
true
0
7
14
34
17
17
null
null