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
sherwoodwang/wxHaskell
wx/src/Graphics/UI/WX/Menu.hs
lgpl-2.1
menuHelp :: [Prop (Menu ())] -> IO (Menu ()) menuHelp props = menuPane ([text := "&Help"] ++ props)
101
menuHelp :: [Prop (Menu ())] -> IO (Menu ()) menuHelp props = menuPane ([text := "&Help"] ++ props)
101
menuHelp props = menuPane ([text := "&Help"] ++ props)
56
false
true
0
10
19
60
30
30
null
null
5outh/Haskell-Graphics-Projects
Project3/main.hs
mit
displayLine viewport line = do let clippedLine = cohenSutherland viewport line case clippedLine of Just ln -> bresenham Nothing ln _ -> return () --show outline of viewport
195
displayLine viewport line = do let clippedLine = cohenSutherland viewport line case clippedLine of Just ln -> bresenham Nothing ln _ -> return () --show outline of viewport
195
displayLine viewport line = do let clippedLine = cohenSutherland viewport line case clippedLine of Just ln -> bresenham Nothing ln _ -> return () --show outline of viewport
195
false
false
1
12
50
63
26
37
null
null
neobrain/aeson
Data/Aeson/Encode/Builder.hs
bsd-3-clause
-- | Encode a JSON string. string :: String -> Builder string t = B.char8 '"' <> BP.primMapListBounded go t <> B.char8 '"' where go = BP.condB (> '\x7f') BP.charUtf8 (c2w >$< escapeAscii)
189
string :: String -> Builder string t = B.char8 '"' <> BP.primMapListBounded go t <> B.char8 '"' where go = BP.condB (> '\x7f') BP.charUtf8 (c2w >$< escapeAscii)
162
string t = B.char8 '"' <> BP.primMapListBounded go t <> B.char8 '"' where go = BP.condB (> '\x7f') BP.charUtf8 (c2w >$< escapeAscii)
134
true
true
0
8
34
74
37
37
null
null
josephDunne/variants
dist/build/autogen/Paths_variants.hs
bsd-3-clause
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch
84
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch
84
catchIO = Exception.catch
25
false
true
0
10
14
45
20
25
null
null
beni55/LambdaHack
Game/LambdaHack/Common/Tile.hs
bsd-3-clause
isPassable Kind.Ops{ospeedup = Just TileSpeedup{isPassableTab}} = accessTab isPassableTab
91
isPassable Kind.Ops{ospeedup = Just TileSpeedup{isPassableTab}} = accessTab isPassableTab
91
isPassable Kind.Ops{ospeedup = Just TileSpeedup{isPassableTab}} = accessTab isPassableTab
91
false
false
0
11
9
32
15
17
null
null
phischu/fragnix
tests/packages/scotty/Data.Map.Internal.hs
bsd-3-clause
splitAt :: Int -> Map k a -> (Map k a, Map k a) splitAt i0 m0 | i0 >= size m0 = (m0, Tip) | otherwise = toPair $ go i0 m0 where go i m | i <= 0 = Tip :*: m go !_ Tip = Tip :*: Tip go i (Bin _ kx x l r) = case compare i sizeL of LT -> case go i l of ll :*: lr -> ll :*:...
1,497
splitAt :: Int -> Map k a -> (Map k a, Map k a) splitAt i0 m0 | i0 >= size m0 = (m0, Tip) | otherwise = toPair $ go i0 m0 where go i m | i <= 0 = Tip :*: m go !_ Tip = Tip :*: Tip go i (Bin _ kx x l r) = case compare i sizeL of LT -> case go i l of ll :*: lr -> ll :*:...
1,497
splitAt i0 m0 | i0 >= size m0 = (m0, Tip) | otherwise = toPair $ go i0 m0 where go i m | i <= 0 = Tip :*: m go !_ Tip = Tip :*: Tip go i (Bin _ kx x l r) = case compare i sizeL of LT -> case go i l of ll :*: lr -> ll :*: link kx x lr r GT -> case go (i - siz...
1,449
false
true
1
12
433
281
141
140
null
null
li-zhirui/EoplLangs
src/CallByReference/Evaluator.hs
bsd-3-clause
evalProgram :: Program -> EvaluateResult evalProgram (Prog expr) = eval expr
76
evalProgram :: Program -> EvaluateResult evalProgram (Prog expr) = eval expr
76
evalProgram (Prog expr) = eval expr
35
false
true
0
9
10
32
14
18
null
null
nushio3/ghc
compiler/stranal/DmdAnal.hs
bsd-3-clause
extendSigsWithLam :: AnalEnv -> Id -> AnalEnv -- Extend the AnalEnv when we meet a lambda binder extendSigsWithLam env id | isId id , isStrictDmd (idDemandInfo id) || ae_virgin env -- See Note [Optimistic CPR in the "virgin" case] -- See Note [Initial CPR for strict binders] , Just (dc,_,_,_) <- dee...
467
extendSigsWithLam :: AnalEnv -> Id -> AnalEnv extendSigsWithLam env id | isId id , isStrictDmd (idDemandInfo id) || ae_virgin env -- See Note [Optimistic CPR in the "virgin" case] -- See Note [Initial CPR for strict binders] , Just (dc,_,_,_) <- deepSplitProductType_maybe (ae_fam_envs env) $ idType ...
416
extendSigsWithLam env id | isId id , isStrictDmd (idDemandInfo id) || ae_virgin env -- See Note [Optimistic CPR in the "virgin" case] -- See Note [Initial CPR for strict binders] , Just (dc,_,_,_) <- deepSplitProductType_maybe (ae_fam_envs env) $ idType id = extendAnalEnv NotTopLevel env id (cprPr...
370
true
true
0
12
95
133
63
70
null
null
Chatanga/codingame-hs
src/Codingame/SourcePackager.hs
mit
toExtension (Ident _ "DeriveFoldable") = EnableExtension DeriveFoldable
71
toExtension (Ident _ "DeriveFoldable") = EnableExtension DeriveFoldable
71
toExtension (Ident _ "DeriveFoldable") = EnableExtension DeriveFoldable
71
false
false
0
7
6
20
9
11
null
null
kmate/HaRe
src/Language/Haskell/Refact/Utils/MonadFunctions.hs
bsd-3-clause
putRefactRenamed :: GHC.RenamedSource -> RefactGhc () putRefactRenamed renamed = do st <- get mrm <- gets rsModule let rm = gfromJust "putRefactRenamed" mrm let tm = rsTypecheckedMod rm let tm' = tm { GHC.tm_renamed_source = Just renamed } let rm' = rm { rsTypecheckedMod = tm' } put $ st {rsModule = Just ...
324
putRefactRenamed :: GHC.RenamedSource -> RefactGhc () putRefactRenamed renamed = do st <- get mrm <- gets rsModule let rm = gfromJust "putRefactRenamed" mrm let tm = rsTypecheckedMod rm let tm' = tm { GHC.tm_renamed_source = Just renamed } let rm' = rm { rsTypecheckedMod = tm' } put $ st {rsModule = Just ...
324
putRefactRenamed renamed = do st <- get mrm <- gets rsModule let rm = gfromJust "putRefactRenamed" mrm let tm = rsTypecheckedMod rm let tm' = tm { GHC.tm_renamed_source = Just renamed } let rm' = rm { rsTypecheckedMod = tm' } put $ st {rsModule = Just rm'}
270
false
true
0
12
67
125
59
66
null
null
yjwen/hada
src/SVerilog.hs
lgpl-3.0
getCaseExpr ce cv ct ((altcon, vs, e):moreAlts) = (jc : (jt ++ jf), condExpr cond true false) where cond = matchKey cv ++ " == " ++ matchValue altcon jc = BindJob [cv] ce (jt, true) = getExpr e (jf, false) = getCaseExpr ce cv ct moreAlts -- Derive the pattern matching key from a variable
317
getCaseExpr ce cv ct ((altcon, vs, e):moreAlts) = (jc : (jt ++ jf), condExpr cond true false) where cond = matchKey cv ++ " == " ++ matchValue altcon jc = BindJob [cv] ce (jt, true) = getExpr e (jf, false) = getCaseExpr ce cv ct moreAlts -- Derive the pattern matching key from a variable
317
getCaseExpr ce cv ct ((altcon, vs, e):moreAlts) = (jc : (jt ++ jf), condExpr cond true false) where cond = matchKey cv ++ " == " ++ matchValue altcon jc = BindJob [cv] ce (jt, true) = getExpr e (jf, false) = getCaseExpr ce cv ct moreAlts -- Derive the pattern matching key from a variable
317
false
false
0
8
84
127
67
60
null
null
TomHammersley/HaskellRenderer
app/src/SparseVoxelOctree.hs
gpl-2.0
earestIntersection Nothing x@(Just _) = x
42
nearestIntersection Nothing x@(Just _) = x
42
nearestIntersection Nothing x@(Just _) = x
42
false
false
1
7
6
26
10
16
null
null
markus-git/co-feldspar
src/Feldspar/Software/Primitive.hs
bsd-3-clause
softwarePrimWitType ComplexFloatST = Dict
42
softwarePrimWitType ComplexFloatST = Dict
42
softwarePrimWitType ComplexFloatST = Dict
42
false
false
0
5
4
9
4
5
null
null
sol/pandoc
src/Text/Pandoc/Writers/HTML.hs
gpl-2.0
blockToHtml opts (Plain lst) = inlineListToHtml opts lst
56
blockToHtml opts (Plain lst) = inlineListToHtml opts lst
56
blockToHtml opts (Plain lst) = inlineListToHtml opts lst
56
false
false
0
7
7
23
10
13
null
null
ierton/yteratee
src/DVBparse.hs
bsd-3-clause
psize = 188 :: Word32
21
psize = 188 :: Word32
21
psize = 188 :: Word32
21
false
false
0
4
4
9
5
4
null
null
Tener/HaNS
src/Network/TCP/Aux/Misc.hs
bsd-3-clause
initial_cb_snd = TCBSending { sndq = bufferchain_empty , snd_una = SeqLocal 0 , snd_wnd = 0 , snd_wl1 = SeqForeign 0 , snd_wl2 = SeqLocal 0 , snd_cwnd = tcp_maxwin `shiftL` tcp_maxwinscale , snd_nxt = SeqLocal 0 , snd_max ...
883
initial_cb_snd = TCBSending { sndq = bufferchain_empty , snd_una = SeqLocal 0 , snd_wnd = 0 , snd_wl1 = SeqForeign 0 , snd_wl2 = SeqLocal 0 , snd_cwnd = tcp_maxwin `shiftL` tcp_maxwinscale , snd_nxt = SeqLocal 0 , snd_max ...
883
initial_cb_snd = TCBSending { sndq = bufferchain_empty , snd_una = SeqLocal 0 , snd_wnd = 0 , snd_wl1 = SeqForeign 0 , snd_wl2 = SeqLocal 0 , snd_cwnd = tcp_maxwin `shiftL` tcp_maxwinscale , snd_nxt = SeqLocal 0 , snd_max ...
883
false
false
1
9
484
158
95
63
null
null
nbrunt/JSHOP
src/Analyser.hs
mit
anShiftExpr (ShiftLeft shiftExpr addExpr) = anShiftExpr shiftExpr >> anAddExpr addExpr
88
anShiftExpr (ShiftLeft shiftExpr addExpr) = anShiftExpr shiftExpr >> anAddExpr addExpr
88
anShiftExpr (ShiftLeft shiftExpr addExpr) = anShiftExpr shiftExpr >> anAddExpr addExpr
88
false
false
0
7
11
27
12
15
null
null
alexbiehl/hoop
hadoop-protos/src/Hadoop/Protos/YarnServerResourceManagerRecoveryProtos/RMAppAttemptStateProto.hs
mit
toMaybe'Enum 13 = Prelude'.Just RMATTEMPT_RECOVERED
51
toMaybe'Enum 13 = Prelude'.Just RMATTEMPT_RECOVERED
51
toMaybe'Enum 13 = Prelude'.Just RMATTEMPT_RECOVERED
51
false
false
1
6
4
17
6
11
null
null
TOSPIO/yi
src/library/Yi/MiniBuffer.hs
gpl-2.0
-- | @withMinibufferGen proposal getHint prompt completer onTyping act@: -- open a minibuffer with @prompt@, and initial content @proposal@. Once -- a string @s@ is obtained, run @act s@. @completer@ can be used to -- complete inputs by returning an incrementally better match, and -- getHint can give an immediate feedb...
2,755
withMinibufferGen :: T.Text -> (T.Text -> YiM [T.Text]) -> T.Text -> (T.Text -> YiM T.Text) -> (T.Text -> YiM ()) -> (T.Text -> YiM ()) -> YiM () withMinibufferGen proposal getHint prompt completer onTyping act = do initialBuffer <- gets currentBuffer initialWindow <- use current...
2,212
withMinibufferGen proposal getHint prompt completer onTyping act = do initialBuffer <- gets currentBuffer initialWindow <- use currentWindowA let innerAction :: YiM () -- ^ Read contents of current buffer (which should be the minibuffer), and -- apply it to the desired action closeMinibuffer = c...
2,030
true
true
0
20
782
577
285
292
null
null
jyp/lp-diagrams
Graphics/Diagrams/Path.hs
agpl-3.0
noDraw :: Monad m => Diagram lab m a -> Diagram lab m a noDraw = using (set drawColor Nothing . set fillColor Nothing)
118
noDraw :: Monad m => Diagram lab m a -> Diagram lab m a noDraw = using (set drawColor Nothing . set fillColor Nothing)
118
noDraw = using (set drawColor Nothing . set fillColor Nothing)
62
false
true
0
8
23
56
26
30
null
null
mainland/dph
icebox/examples/barnesHut/BarnesHutList.hs
bsd-3-clause
calcAccel:: MassPoint -> BHTree -> (Double, Double) calcAccel mpt (BHT x y m subtrees) | isClose mpt x y = accel mpt x y m | otherwise = (sum xs, sum ys) where (xs, ys) = unzip [ calcAccel mpt st | st <- subtrees]
238
calcAccel:: MassPoint -> BHTree -> (Double, Double) calcAccel mpt (BHT x y m subtrees) | isClose mpt x y = accel mpt x y m | otherwise = (sum xs, sum ys) where (xs, ys) = unzip [ calcAccel mpt st | st <- subtrees]
238
calcAccel mpt (BHT x y m subtrees) | isClose mpt x y = accel mpt x y m | otherwise = (sum xs, sum ys) where (xs, ys) = unzip [ calcAccel mpt st | st <- subtrees]
186
false
true
1
8
69
117
58
59
null
null
djoyner/zigbee-znet25
src/Network/Protocol/ZigBee/ZNet25/Frame.hs
bsd-3-clause
getRemainingByteString :: Get B.ByteString getRemainingByteString = do len <- remaining getByteString $ fromIntegral len
124
getRemainingByteString :: Get B.ByteString getRemainingByteString = do len <- remaining getByteString $ fromIntegral len
124
getRemainingByteString = do len <- remaining getByteString $ fromIntegral len
81
false
true
0
8
17
33
15
18
null
null
beni55/attoparsec
Data/Attoparsec/Text/Buffer.hs
bsd-3-clause
append :: Buffer -> A.Array -> Int -> Int -> Buffer append (Buf arr0 off0 len0 cap0 gen0) !arr1 !off1 !len1 = runST $ do let woff = sizeOf (0::Int) `shiftR` 1 newlen = len0 + len1 !gen = if gen0 == 0 then 0 else readGen arr0 if gen == gen0 && newlen <= cap0 then do let newgen = gen + 1 ...
824
append :: Buffer -> A.Array -> Int -> Int -> Buffer append (Buf arr0 off0 len0 cap0 gen0) !arr1 !off1 !len1 = runST $ do let woff = sizeOf (0::Int) `shiftR` 1 newlen = len0 + len1 !gen = if gen0 == 0 then 0 else readGen arr0 if gen == gen0 && newlen <= cap0 then do let newgen = gen + 1 ...
824
append (Buf arr0 off0 len0 cap0 gen0) !arr1 !off1 !len1 = runST $ do let woff = sizeOf (0::Int) `shiftR` 1 newlen = len0 + len1 !gen = if gen0 == 0 then 0 else readGen arr0 if gen == gen0 && newlen <= cap0 then do let newgen = gen + 1 marr <- unsafeThaw arr0 writeGen marr ne...
772
false
true
0
15
249
369
176
193
null
null
allonsy/mailServer
src/mailClient.hs
mit
printMailThreads :: [MailThread] -> IO () printMailThreads db = mapM_ printOneThread db >> putStrLn "" where printOneThread th = do putStrLn $ subj (hdr (snd (head th))) mapM_ printOneEmail th printOneEmail (b, m) = do if(b) then do putStrLn $ "\t-" ++ "***" +...
805
printMailThreads :: [MailThread] -> IO () printMailThreads db = mapM_ printOneThread db >> putStrLn "" where printOneThread th = do putStrLn $ subj (hdr (snd (head th))) mapM_ printOneEmail th printOneEmail (b, m) = do if(b) then do putStrLn $ "\t-" ++ "***" +...
805
printMailThreads db = mapM_ printOneThread db >> putStrLn "" where printOneThread th = do putStrLn $ subj (hdr (snd (head th))) mapM_ printOneEmail th printOneEmail (b, m) = do if(b) then do putStrLn $ "\t-" ++ "***" ++ "["++ (show (idNum m)) ++ "] " ++ (show ...
763
false
true
0
21
228
344
171
173
null
null
sboosali/commands-frontend-DragonNaturallySpeaking
sources/Commands/Frontends/Dragon13/Serialize.hs
bsd-3-clause
{- | @Address (Host "localhost") (Port 8000)@ becomes @("'localhost'", "'8000'")@ @SerializedGrammar = ShimR - NatLinkConfig@ -} from_SerializedGrammar_to_ShimR :: NatLinkConfig -> SerializedGrammar -> ShimR Doc from_SerializedGrammar_to_ShimR NatLinkConfig{..} SerializedGrammar{..} = ShimR{..} where __rules__ = s...
721
from_SerializedGrammar_to_ShimR :: NatLinkConfig -> SerializedGrammar -> ShimR Doc from_SerializedGrammar_to_ShimR NatLinkConfig{..} SerializedGrammar{..} = ShimR{..} where __rules__ = serializedRules __lists__ = serializedLists __export__ = serializedExport __serverHost__ = str2doc h __serverPort__ = str2d...
591
from_SerializedGrammar_to_ShimR NatLinkConfig{..} SerializedGrammar{..} = ShimR{..} where __rules__ = serializedRules __lists__ = serializedLists __export__ = serializedExport __serverHost__ = str2doc h __serverPort__ = str2doc (show p) -- __logFile__ = str2doc nlLogFile -- __contextFile__ = str2doc n...
508
true
true
0
7
107
135
71
64
null
null
narurien/ganeti-ceph
src/Ganeti/OpParams.hs
gpl-2.0
-- | Requested fields. pQueryFields :: Field pQueryFields = simpleField "fields" [t| [NonEmptyString] |]
104
pQueryFields :: Field pQueryFields = simpleField "fields" [t| [NonEmptyString] |]
81
pQueryFields = simpleField "fields" [t| [NonEmptyString] |]
59
true
true
0
6
13
28
14
14
null
null
MasseR/xmonadcontrib
XMonad/Layout/Groups/Examples.hs
bsd-3-clause
-- | Decrease the number of master groups by one decreaseNMasterGroups :: X () decreaseNMasterGroups = sendMessage $ G.ToEnclosing $ SomeMessage $ IncMasterN (-1)
162
decreaseNMasterGroups :: X () decreaseNMasterGroups = sendMessage $ G.ToEnclosing $ SomeMessage $ IncMasterN (-1)
113
decreaseNMasterGroups = sendMessage $ G.ToEnclosing $ SomeMessage $ IncMasterN (-1)
83
true
true
0
8
23
39
20
19
null
null
olsner/ghc
compiler/cmm/CmmUtils.hs
bsd-3-clause
primRepForeignHint IntRep = SignedHint
44
primRepForeignHint IntRep = SignedHint
44
primRepForeignHint IntRep = SignedHint
44
false
false
0
5
9
9
4
5
null
null
google/codeworld
codeworld-api/src/CodeWorld/Sketches.hs
apache-2.0
sketchedAlien :: HasCallStack => Picture sketchedAlien = Sketch (getDebugSrcLoc callStack) "sketchedAlien" $(embedAsUrl "image/svg+xml" "data/AlienTransparency70.svg") 10 10
195
sketchedAlien :: HasCallStack => Picture sketchedAlien = Sketch (getDebugSrcLoc callStack) "sketchedAlien" $(embedAsUrl "image/svg+xml" "data/AlienTransparency70.svg") 10 10
195
sketchedAlien = Sketch (getDebugSrcLoc callStack) "sketchedAlien" $(embedAsUrl "image/svg+xml" "data/AlienTransparency70.svg") 10 10
154
false
true
0
7
37
46
20
26
null
null
headprogrammingczar/cabal
Cabal/Distribution/PackageDescription/Check.hs
bsd-3-clause
checkAlternatives :: String -> String -> [(String, String)] -> Maybe PackageCheck checkAlternatives badField goodField flags = check (not (null badFlags)) $ PackageBuildWarning $ "Instead of " ++ quote (badField ++ ": " ++ unwords badFlags) ++ " use " ++ quote (goodField ++ ": " ++ unwords goodFlag...
367
checkAlternatives :: String -> String -> [(String, String)] -> Maybe PackageCheck checkAlternatives badField goodField flags = check (not (null badFlags)) $ PackageBuildWarning $ "Instead of " ++ quote (badField ++ ": " ++ unwords badFlags) ++ " use " ++ quote (goodField ++ ": " ++ unwords goodFlag...
367
checkAlternatives badField goodField flags = check (not (null badFlags)) $ PackageBuildWarning $ "Instead of " ++ quote (badField ++ ": " ++ unwords badFlags) ++ " use " ++ quote (goodField ++ ": " ++ unwords goodFlags) where (badFlags, goodFlags) = unzip flags
285
false
true
8
9
77
137
65
72
null
null
ecaustin/haskhol-core
src/HaskHOL/Core/Kernel/Terms.hs
bsd-2-clause
{-| Constructs a type abstraction term given a bound type and a body term. Fails with 'Left' in the following cases: * The bound type is not a small type variable. -} mkTyAbs :: MonadThrow m => HOLType -> HOLTerm -> m HOLTerm mkTyAbs tv@(TyVarIn True _) bod = return $! TyAbsIn tv bod
292
mkTyAbs :: MonadThrow m => HOLType -> HOLTerm -> m HOLTerm mkTyAbs tv@(TyVarIn True _) bod = return $! TyAbsIn tv bod
117
mkTyAbs tv@(TyVarIn True _) bod = return $! TyAbsIn tv bod
58
true
true
1
9
61
63
28
35
null
null
zhiyuanshi/fcore
backend/archive/ClosureFNew.hs
bsd-2-clause
joinType (JClass c) = JClass c
30
joinType (JClass c) = JClass c
30
joinType (JClass c) = JClass c
30
false
false
0
6
5
19
8
11
null
null
gchrupala/morfette
src/GramLab/Morfette/Lang/Conf.hs
bsd-2-clause
makeConf = Conf
15
makeConf = Conf
15
makeConf = Conf
15
false
false
0
4
2
6
3
3
null
null
CGenie/platform
shared/src/Unison/Type.hs
mit
unArrows :: Type v -> Maybe [Type v] unArrows t = case go t of [] -> Nothing; l -> Just l where go (Arrow' i o) = i : go o go _ = []
144
unArrows :: Type v -> Maybe [Type v] unArrows t = case go t of [] -> Nothing; l -> Just l where go (Arrow' i o) = i : go o go _ = []
144
unArrows t = case go t of [] -> Nothing; l -> Just l where go (Arrow' i o) = i : go o go _ = []
107
false
true
2
9
47
99
44
55
null
null
olsner/ghc
compiler/typecheck/TcPatSyn.hs
bsd-3-clause
tcPatSynBuilderBind :: PatSynBind Name Name -> TcM (LHsBinds Id) -- See Note [Matchers and builders for pattern synonyms] in PatSyn tcPatSynBuilderBind (PSB { psb_id = L loc name, psb_def = lpat , psb_dir = dir, psb_args = details }) | isUnidirectional dir = return empty...
2,866
tcPatSynBuilderBind :: PatSynBind Name Name -> TcM (LHsBinds Id) tcPatSynBuilderBind (PSB { psb_id = L loc name, psb_def = lpat , psb_dir = dir, psb_args = details }) | isUnidirectional dir = return emptyBag | Left why <- mb_match_group -- Can't invert the patte...
2,799
tcPatSynBuilderBind (PSB { psb_id = L loc name, psb_def = lpat , psb_dir = dir, psb_args = details }) | isUnidirectional dir = return emptyBag | Left why <- mb_match_group -- Can't invert the pattern = setSrcSpan (getLoc lpat) $ failWithTc $ vcat [ hang (text "Invalid right-h...
2,714
true
true
4
18
1,011
750
370
380
null
null
frantisekfarka/ghc-dsi
compiler/codeGen/StgCmmCon.hs
bsd-3-clause
buildDynCon' :: DynFlags -> Platform -> Id -> Bool -> CostCentreStack -> DataCon -> [StgArg] -> FCode (CgIdInfo, FCode CmmAGraph) {- We used to pass a boolean indicating whether all the args were of size zero, so we could use a static constr...
1,289
buildDynCon' :: DynFlags -> Platform -> Id -> Bool -> CostCentreStack -> DataCon -> [StgArg] -> FCode (CgIdInfo, FCode CmmAGraph) buildDynCon' dflags _ binder _ _cc con [] = return (litIdInfo dflags binder (mkConLFInfo con) ...
411
buildDynCon' dflags _ binder _ _cc con [] = return (litIdInfo dflags binder (mkConLFInfo con) (CmmLabel (mkClosureLabel (dataConName con) (idCafInfo binder))), return mkNop)
203
true
true
0
15
311
138
72
66
null
null
rahulmutt/ghcvm
compiler/Eta/HsSyn/HsDecls.hs
bsd-3-clause
pprFlavour :: FamilyInfo name -> SDoc pprFlavour DataFamily = ptext (sLit "data family")
99
pprFlavour :: FamilyInfo name -> SDoc pprFlavour DataFamily = ptext (sLit "data family")
99
pprFlavour DataFamily = ptext (sLit "data family")
61
false
true
0
7
23
30
14
16
null
null
jarlah/blackjack
src/Main.hs
gpl-2.0
showStatus :: Hand -> String showStatus hand = show (map cValue hand) ++ " " ++ show (sumOfHand hand)
102
showStatus :: Hand -> String showStatus hand = show (map cValue hand) ++ " " ++ show (sumOfHand hand)
101
showStatus hand = show (map cValue hand) ++ " " ++ show (sumOfHand hand)
72
false
true
0
8
19
51
23
28
null
null
thalerjonathan/phd
coding/prototyping/haskell/declarativeABM/haskell/SpatialGameABS/src/SpacialGameMsg/RunSGMsg.hs
gpl-3.0
winSize = (1000, 1000)
22
winSize = (1000, 1000)
22
winSize = (1000, 1000)
22
false
false
0
5
3
12
7
5
null
null
ddssff/rdf4h
bench/MainCriterion.hs
bsd-3-clause
objSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False })
71
objSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False })
71
objSelect = Just (\case { (UNode n) -> T.length n > 12 ; _ -> False })
71
false
false
1
12
17
48
23
25
null
null
andbroby/Harlequin
src/Main.hs
gpl-2.0
symbolToString _ = String ""
28
symbolToString _ = String ""
28
symbolToString _ = String ""
28
false
false
0
5
4
13
5
8
null
null
mbakke/ganeti
test/hs/Test/Ganeti/TestCommon.hs
bsd-2-clause
-- | Generate an arbitrary element of and AndRestArguments field. genAndRestArguments :: Gen (M.Map String J.JSValue) genAndRestArguments = do n <- choose (0::Int, 10) let oneParam _ = do name <- choose (15 ::Int, 25) >>= flip vectorOf (elements tagChar) ...
692
genAndRestArguments :: Gen (M.Map String J.JSValue) genAndRestArguments = do n <- choose (0::Int, 10) let oneParam _ = do name <- choose (15 ::Int, 25) >>= flip vectorOf (elements tagChar) intvalue <- arbitrary value <...
626
genAndRestArguments = do n <- choose (0::Int, 10) let oneParam _ = do name <- choose (15 ::Int, 25) >>= flip vectorOf (elements tagChar) intvalue <- arbitrary value <- oneof [ J.JSString . J.toJSString <$> genName ...
574
true
true
0
17
278
176
89
87
null
null
Lainepress/hledger
hledger-lib/Hledger/Data/Matching.hs
gpl-3.0
-- | What start date does this matcher specify, if any ? -- If the matcher is an OR expression, returns the earliest of the alternatives. -- When the flag is true, look for a starting effective date instead. matcherStartDate :: Bool -> Matcher -> Maybe Day matcherStartDate effective (MatchOr ms) = earliestMaybeDate $ m...
354
matcherStartDate :: Bool -> Matcher -> Maybe Day matcherStartDate effective (MatchOr ms) = earliestMaybeDate $ map (matcherStartDate effective) ms
146
matcherStartDate effective (MatchOr ms) = earliestMaybeDate $ map (matcherStartDate effective) ms
97
true
true
0
10
57
55
27
28
null
null
kim/amazonka
gen/src/Gen/IO.hs
mpl-2.0
loadObject :: FromJSON a => FilePath -> Script (Either String a) loadObject = readFromFile eitherDecode'
104
loadObject :: FromJSON a => FilePath -> Script (Either String a) loadObject = readFromFile eitherDecode'
104
loadObject = readFromFile eitherDecode'
39
false
true
0
10
14
41
18
23
null
null
wavecorenautic/ecdis-client
app/JavaScript/ECDIS/GeneralWidgets.hs
bsd-3-clause
onBeforeUnload :: IO () -> IO () onBeforeUnload hdl = do wndM <- currentWindow case wndM of Just wnd -> void $ domWindowOnbeforeunload wnd $ liftIO hdl Nothing -> return ()
182
onBeforeUnload :: IO () -> IO () onBeforeUnload hdl = do wndM <- currentWindow case wndM of Just wnd -> void $ domWindowOnbeforeunload wnd $ liftIO hdl Nothing -> return ()
182
onBeforeUnload hdl = do wndM <- currentWindow case wndM of Just wnd -> void $ domWindowOnbeforeunload wnd $ liftIO hdl Nothing -> return ()
149
false
true
0
12
40
76
34
42
null
null
shlevy/ghc
compiler/coreSyn/CoreUnfold.hs
bsd-3-clause
smallEnoughToInline :: DynFlags -> Unfolding -> Bool smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}}) = size <= ufUseThreshold dflags
176
smallEnoughToInline :: DynFlags -> Unfolding -> Bool smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}}) = size <= ufUseThreshold dflags
176
smallEnoughToInline dflags (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}}) = size <= ufUseThreshold dflags
123
false
true
0
12
22
52
27
25
null
null
danr/hipspec
testsuite/examples/Rotate.hs
gpl-3.0
-- T32 from productive use of failure prop_T32 :: List -> Prop List prop_T32 xs = rotate (length xs) xs =:= xs
110
prop_T32 :: List -> Prop List prop_T32 xs = rotate (length xs) xs =:= xs
72
prop_T32 xs = rotate (length xs) xs =:= xs
42
true
true
0
8
21
43
19
24
null
null
wxwxwwxxx/ghc
testsuite/tests/gadt/T3651.hs
bsd-3-clause
unsafe1 :: Z a -> Z a -> a unsafe1 B U = ()
43
unsafe1 :: Z a -> Z a -> a unsafe1 B U = ()
43
unsafe1 B U = ()
16
false
true
0
8
13
38
16
22
null
null
ihc/futhark
src/Language/Futhark/Attributes.hs
isc
patternNoShapeAnnotations (RecordPattern ps loc) = RecordPattern (map (fmap patternNoShapeAnnotations) ps) loc
112
patternNoShapeAnnotations (RecordPattern ps loc) = RecordPattern (map (fmap patternNoShapeAnnotations) ps) loc
112
patternNoShapeAnnotations (RecordPattern ps loc) = RecordPattern (map (fmap patternNoShapeAnnotations) ps) loc
112
false
false
0
9
12
36
17
19
null
null
ghorn/dynobud
dynobud/src/Dyno/DirectCollocation/Formulate.hs
lgpl-3.0
interpolateXDots :: forall b deg x a . (Real b, KnownNat deg, View x, CMatrix a) => Vec (deg + 1) (Vec (deg + 1) b) -> Vec (deg + 1) (J x a) -> Vec deg (J x a) interpolateXDots cjks xs = withKnownNat (SNat @deg %+ SNat @1) $ TV.tvtail $ interpolateXDots' cjks xs
276
interpolateXDots :: forall b deg x a . (Real b, KnownNat deg, View x, CMatrix a) => Vec (deg + 1) (Vec (deg + 1) b) -> Vec (deg + 1) (J x a) -> Vec deg (J x a) interpolateXDots cjks xs = withKnownNat (SNat @deg %+ SNat @1) $ TV.tvtail $ interpolateXDots' cjks xs
276
interpolateXDots cjks xs = withKnownNat (SNat @deg %+ SNat @1) $ TV.tvtail $ interpolateXDots' cjks xs
106
false
true
0
13
69
155
78
77
null
null
kongra/kask-base
app/Test007.hs
bsd-3-clause
intShow1 :: N -> T.Text intShow1 (N i) = T.pack $ show i
56
intShow1 :: N -> T.Text intShow1 (N i) = T.pack $ show i
56
intShow1 (N i) = T.pack $ show i
32
false
true
2
9
12
41
18
23
null
null
michalkonecny/aern
aern-real/src/Numeric/AERN/RealArithmetic/NumericOrderRounding/FieldOps.hs
bsd-3-clause
powerToNonnegIntDnEffFromMult :: (RoundedMultiply t, HasOne t, NumOrd.PartialComparison t, HasZero t, Neg t, NumOrd.RoundedLattice t) => PowerToNonnegIntEffortIndicatorFromMult t -> t -> Int -> t powerToNonnegIntDnEffFromMult (effMult, effComp, effMinmax) e n = powerToNonnegIntDir ...
417
powerToNonnegIntDnEffFromMult :: (RoundedMultiply t, HasOne t, NumOrd.PartialComparison t, HasZero t, Neg t, NumOrd.RoundedLattice t) => PowerToNonnegIntEffortIndicatorFromMult t -> t -> Int -> t powerToNonnegIntDnEffFromMult (effMult, effComp, effMinmax) e n = powerToNonnegIntDir ...
417
powerToNonnegIntDnEffFromMult (effMult, effComp, effMinmax) e n = powerToNonnegIntDir (multDnEff effMult) (multUpEff effMult) (NumOrd.minDnEff effMinmax) effComp e n
195
false
true
0
8
95
118
60
58
null
null
woodsjc/hackerrank-challenges
hackerrank_max_subway.hs
gpl-3.0
parse_int_array :: String -> [Int] parse_int_array tmp_array = map read $ words tmp_array
89
parse_int_array :: String -> [Int] parse_int_array tmp_array = map read $ words tmp_array
89
parse_int_array tmp_array = map read $ words tmp_array
54
false
true
0
6
12
31
15
16
null
null
iu-parfunc/tslogger
src/System/Log/TSLogger.hs
bsd-3-clause
-- | Non-blocking read. tryReadSmplChan :: SmplChan a -> IO (Maybe a) tryReadSmplChan ch = do x <- atomicModifyIORef' ch $ \ sq -> case Seq.viewl sq of Seq.EmptyL -> (Seq.empty, Nothing) h Seq.:< t -> (t, Just h) return x {- -- | A synchronous read that must block or busy-wait until a valu...
634
tryReadSmplChan :: SmplChan a -> IO (Maybe a) tryReadSmplChan ch = do x <- atomicModifyIORef' ch $ \ sq -> case Seq.viewl sq of Seq.EmptyL -> (Seq.empty, Nothing) h Seq.:< t -> (t, Just h) return x {- -- | A synchronous read that must block or busy-wait until a value is available. readSmpl...
610
tryReadSmplChan ch = do x <- atomicModifyIORef' ch $ \ sq -> case Seq.viewl sq of Seq.EmptyL -> (Seq.empty, Nothing) h Seq.:< t -> (t, Just h) return x {- -- | A synchronous read that must block or busy-wait until a value is available. readSmplChan :: SmplChan a -> IO a readSmplChan ch = l...
564
true
true
0
14
186
104
52
52
null
null
karamellpelle/grid
source/OpenAL/Values.hs
gpl-3.0
al_NO_ERROR :: ALenum al_NO_ERROR = 0x0000
70
al_NO_ERROR :: ALenum al_NO_ERROR = 0x0000
70
al_NO_ERROR = 0x0000
48
false
true
0
4
33
11
6
5
null
null
apyrgio/snf-ganeti
src/Ganeti/BasicTypes.hs
bsd-2-clause
annotateResult _ v = v
22
annotateResult _ v = v
22
annotateResult _ v = v
22
false
false
0
5
4
11
5
6
null
null
ahmadsalim/p3-tool
p3-tool/FPromela/Parser.hs
gpl-3.0
pRange :: Parser ParserState Range pRange = do var <- pVarRef (reserved "in" *> pVarRef >>= return . RnMember var) <|> do symbol ":" e1 <- pExpr symbol ".." e2 <- pExpr return $ RnInterval var e1 e2
308
pRange :: Parser ParserState Range pRange = do var <- pVarRef (reserved "in" *> pVarRef >>= return . RnMember var) <|> do symbol ":" e1 <- pExpr symbol ".." e2 <- pExpr return $ RnInterval var e1 e2
308
pRange = do var <- pVarRef (reserved "in" *> pVarRef >>= return . RnMember var) <|> do symbol ":" e1 <- pExpr symbol ".." e2 <- pExpr return $ RnInterval var e1 e2
273
false
true
0
12
147
91
40
51
null
null
AJChapman/rspp
RSPP.hs
mit
evalClause total (RationalPledge above perUnit unit) = max 0 $ ((total - above) * unit) / perUnit
97
evalClause total (RationalPledge above perUnit unit) = max 0 $ ((total - above) * unit) / perUnit
97
evalClause total (RationalPledge above perUnit unit) = max 0 $ ((total - above) * unit) / perUnit
97
false
false
0
10
16
48
23
25
null
null
farnoy/torrent
src/Network/BitTorrent/Client.hs
bsd-3-clause
-- | Ask the tracker for peers and return the result addresses. queryTracker :: GlobalState -> TorrentState -> IO [SockAddr] queryTracker globalState state = do let meta = torrentStateMetaInfo state url = fromByteString (announce meta) >>= parseUrl req = setQueryString [ ("peer_id", Just (globalStatePeerI...
1,077
queryTracker :: GlobalState -> TorrentState -> IO [SockAddr] queryTracker globalState state = do let meta = torrentStateMetaInfo state url = fromByteString (announce meta) >>= parseUrl req = setQueryString [ ("peer_id", Just (globalStatePeerId globalState)) , ("info_hash", Just ...
1,013
queryTracker globalState state = do let meta = torrentStateMetaInfo state url = fromByteString (announce meta) >>= parseUrl req = setQueryString [ ("peer_id", Just (globalStatePeerId globalState)) , ("info_hash", Just (infoHash meta)) , ("compact", Jus...
952
true
true
0
22
352
332
166
166
null
null
pgj/bead
snaplets/fay/src/Bead/View/Fay/HookIds.hs
bsd-3-clause
assignmentForm = HookId "assignment-form"
41
assignmentForm = HookId "assignment-form"
41
assignmentForm = HookId "assignment-form"
41
false
false
1
5
3
12
4
8
null
null
jdreaver/eventful
eventful-core/src/Eventful/EventBus.hs
mit
-- | This function wraps an event store by sending events to event handlers -- after running 'storeEvents'. This is useful to quickly wire up event -- handlers in your application (like read models or process managers), and it -- is also useful for integration testing along with an in-memory event store. synchronousEve...
922
synchronousEventBusWrapper :: (Monad m) => VersionedEventStoreWriter m event -> [VersionedEventStoreWriter m event -> UUID -> event -> m ()] -> VersionedEventStoreWriter m event synchronousEventBusWrapper writer handlers = wrappedStore where -- NB: We need to use recursive let bindings so we can put wrapp...
616
synchronousEventBusWrapper writer handlers = wrappedStore where -- NB: We need to use recursive let bindings so we can put wrappedStore -- inside the event handlers handlers' = map ($ wrappedStore) handlers wrappedStore = EventStoreWriter $ storeAndPublishEvents writer handlers' -- | Stores events in...
430
true
true
4
14
161
119
58
61
null
null
tidalcycles/tidal-midi
Sound/Tidal/MIDI/Tetra.hs
gpl-3.0
(osc2shape, osc2shape_p) = pI "osc2shape" (Just 1)
50
(osc2shape, osc2shape_p) = pI "osc2shape" (Just 1)
50
(osc2shape, osc2shape_p) = pI "osc2shape" (Just 1)
50
false
false
0
7
6
24
12
12
null
null
buckie/juno
src/Juno/Runtime/Timer.hs
bsd-3-clause
setTimedEvent :: Monad m => Event -> Int -> Raft m () setTimedEvent e t = do cancelTimer tmr <- enqueueEventLater t e -- forks, no state timerThread .= Just tmr
166
setTimedEvent :: Monad m => Event -> Int -> Raft m () setTimedEvent e t = do cancelTimer tmr <- enqueueEventLater t e -- forks, no state timerThread .= Just tmr
166
setTimedEvent e t = do cancelTimer tmr <- enqueueEventLater t e -- forks, no state timerThread .= Just tmr
112
false
true
0
9
36
64
29
35
null
null
spechub/Hets
CSL/AS_BASIC_CSL.hs
gpl-2.0
-- | opInfoNameMap for the predefined 'operatorInfo' operatorInfoNameMap :: OpInfoNameMap operatorInfoNameMap = getOpInfoNameMap operatorInfo
141
operatorInfoNameMap :: OpInfoNameMap operatorInfoNameMap = getOpInfoNameMap operatorInfo
88
operatorInfoNameMap = getOpInfoNameMap operatorInfo
51
true
true
0
5
13
15
8
7
null
null
MichaeGon/java
Descriptors.hs
mit
getMethodTypePtr :: Maybe (Ptr LLVMType) -> BString -> IO (Ptr LLVMType) getMethodTypePtr p = ret2MethodPtr p . br . parseOnlyMethodType where br (Right x) = x br (Left x) = error x
201
getMethodTypePtr :: Maybe (Ptr LLVMType) -> BString -> IO (Ptr LLVMType) getMethodTypePtr p = ret2MethodPtr p . br . parseOnlyMethodType where br (Right x) = x br (Left x) = error x
201
getMethodTypePtr p = ret2MethodPtr p . br . parseOnlyMethodType where br (Right x) = x br (Left x) = error x
128
false
true
3
7
51
78
37
41
null
null
ku-fpg/kansas-amber
System/Hardware/Haskino/Compiler.hs
bsd-3-clause
compileExpr (RemW16 e1 e2) = compileMod e1 e2
45
compileExpr (RemW16 e1 e2) = compileMod e1 e2
45
compileExpr (RemW16 e1 e2) = compileMod e1 e2
45
false
false
0
7
7
22
10
12
null
null
iblumenfeld/cryptol
src/Cryptol/TypeCheck/AST.hs
bsd-3-clause
tRec :: [(Name,Type)] -> Type tRec = TRec
50
tRec :: [(Name,Type)] -> Type tRec = TRec
50
tRec = TRec
16
false
true
0
8
16
31
15
16
null
null
drhodes/jade2hdl
src/Jade/Module.hs
bsd-3-clause
terminals :: Module -> Coord3 -> J [Terminal] terminals mod p@(Coord3 mx my mr) = do --"Module.terminals" <? do icon <- getIcon mod let rotateTerm (Terminal (Coord3 tx ty tr) sig) = let (Coord3 dx dy _) = Coord.rotate (Coord3 tx ty Rot0) mr 0 0 in Terminal (Coord3 (mx + dx) (my + dy) (Coord.composeR...
391
terminals :: Module -> Coord3 -> J [Terminal] terminals mod p@(Coord3 mx my mr) = do --"Module.terminals" <? do icon <- getIcon mod let rotateTerm (Terminal (Coord3 tx ty tr) sig) = let (Coord3 dx dy _) = Coord.rotate (Coord3 tx ty Rot0) mr 0 0 in Terminal (Coord3 (mx + dx) (my + dy) (Coord.composeR...
391
terminals mod p@(Coord3 mx my mr) = do --"Module.terminals" <? do icon <- getIcon mod let rotateTerm (Terminal (Coord3 tx ty tr) sig) = let (Coord3 dx dy _) = Coord.rotate (Coord3 tx ty Rot0) mr 0 0 in Terminal (Coord3 (mx + dx) (my + dy) (Coord.composeRot mr tr)) sig return $ [rotateTerm t | Icon...
345
false
true
2
17
90
199
94
105
null
null
openbrainsrc/makeci
Views.hs
mit
statusToClass "TestFailure" = "error"
37
statusToClass "TestFailure" = "error"
37
statusToClass "TestFailure" = "error"
37
false
false
0
5
3
9
4
5
null
null
sapek/pandoc
src/Text/Pandoc/Writers/Textile.hs
gpl-2.0
isSimpleListItem [x] = case x of Plain _ -> True Para _ -> True BulletList _ -> isSimpleList x OrderedList _ _ -> isSimpleList x _ -> False
220
isSimpleListItem [x] = case x of Plain _ -> True Para _ -> True BulletList _ -> isSimpleList x OrderedList _ _ -> isSimpleList x _ -> False
220
isSimpleListItem [x] = case x of Plain _ -> True Para _ -> True BulletList _ -> isSimpleList x OrderedList _ _ -> isSimpleList x _ -> False
220
false
false
6
6
108
59
30
29
null
null
paulkoerbitz/hsbci
src/Data/HBCI/Messages.hs
agpl-3.0
fillMsg :: MSGEntry -> MSG -> FillRes (MSGValue, [(T.Text, Int)]) fillMsg entries (MSG _reqSig _reqEnc items) = unzip . catMaybes <$> traverse (fillSeg entries') items where entries' = M.insertWith M.union "MsgHead" (M.fromList [("msgsize", DEentry $ DEStr "000000000000")]) entries
290
fillMsg :: MSGEntry -> MSG -> FillRes (MSGValue, [(T.Text, Int)]) fillMsg entries (MSG _reqSig _reqEnc items) = unzip . catMaybes <$> traverse (fillSeg entries') items where entries' = M.insertWith M.union "MsgHead" (M.fromList [("msgsize", DEentry $ DEStr "000000000000")]) entries
290
fillMsg entries (MSG _reqSig _reqEnc items) = unzip . catMaybes <$> traverse (fillSeg entries') items where entries' = M.insertWith M.union "MsgHead" (M.fromList [("msgsize", DEentry $ DEStr "000000000000")]) entries
224
false
true
0
11
45
118
61
57
null
null
Alexander-Ignatyev/linalg-benchmarks
hmatrix/app/Main.hs
bsd-3-clause
sigmoid :: Floating a => a -> a sigmoid z = 1 / (1+exp(-z))
59
sigmoid :: Floating a => a -> a sigmoid z = 1 / (1+exp(-z))
59
sigmoid z = 1 / (1+exp(-z))
27
false
true
0
10
13
44
22
22
null
null
barrucadu/spec
Test/CoCo/Eval.hs
mit
varassigns :: forall s x. T.Typeable s => [(T.TypeRep, TypeInfo)] -- ^ Information about types. There MUST be an entry for every hole -- type! -> [x] -- ^ The seed values to use. -> Term s -- ^ The term to evaluate. This must have a result in the monad. -> [(VarAssignment x, s -> Maybe (Concurrency ()...
1,173
varassigns :: forall s x. T.Typeable s => [(T.TypeRep, TypeInfo)] -- ^ Information about types. There MUST be an entry for every hole -- type! -> [x] -- ^ The seed values to use. -> Term s -- ^ The term to evaluate. This must have a result in the monad. -> [(VarAssignment x, s -> Maybe (Concurrency ()...
1,173
varassigns typeInfos seeds term = [ (VA seed (M.fromList vidmap), eval_term) | seed <- take numVariants seeds , (vidmap, eval_term) <- assign [] vars term ] where assign env ((var, dyns):free) e = [ ((var, vid):vidlist, eval_term) | (vid, dyn) <- take numVariants $ zip [0..] dyns ...
849
false
true
9
18
293
476
252
224
null
null
yihuang/cabal-install
Distribution/Client/Targets.hs
bsd-3-clause
fetchPackageTarget :: Verbosity -> PackageTarget (PackageLocation ()) -> IO (PackageTarget (PackageLocation FilePath)) fetchPackageTarget verbosity target = case target of PackageTargetNamed n cs ut -> return (PackageTargetNamed n cs ut) PackageTargetNamedFuzzy n ...
691
fetchPackageTarget :: Verbosity -> PackageTarget (PackageLocation ()) -> IO (PackageTarget (PackageLocation FilePath)) fetchPackageTarget verbosity target = case target of PackageTargetNamed n cs ut -> return (PackageTargetNamed n cs ut) PackageTargetNamedFuzzy n ...
691
fetchPackageTarget verbosity target = case target of PackageTargetNamed n cs ut -> return (PackageTargetNamed n cs ut) PackageTargetNamedFuzzy n cs ut -> return (PackageTargetNamedFuzzy n cs ut) PackageTargetLocation location -> do location' <- fetchPackage verbosity (fmap (const Nothing) l...
534
false
true
0
15
156
157
75
82
null
null
rrnewton/stack
src/Stack/Init.hs
bsd-3-clause
ignoredDirs :: Set FilePath ignoredDirs = Set.fromList [ ".git" , "dist" , ".stack-work" ]
106
ignoredDirs :: Set FilePath ignoredDirs = Set.fromList [ ".git" , "dist" , ".stack-work" ]
106
ignoredDirs = Set.fromList [ ".git" , "dist" , ".stack-work" ]
78
false
true
0
6
29
33
16
17
null
null
markus1189/emperor-escape
Parse.hs
bsd-3-clause
testCase :: Parser Types.Cave testCase = do (numRooms,exitNum) <- caveHeader numToRoom <- buildMap <$> rooms numRooms cs <- corridors (numRooms - 1) let corridorMap = reifyCorridors cs numToRoom exitRoom = numToRoom ^? ix exitNum case exitRoom of Just er -> return $ Types.Cave er corridorMap Not...
348
testCase :: Parser Types.Cave testCase = do (numRooms,exitNum) <- caveHeader numToRoom <- buildMap <$> rooms numRooms cs <- corridors (numRooms - 1) let corridorMap = reifyCorridors cs numToRoom exitRoom = numToRoom ^? ix exitNum case exitRoom of Just er -> return $ Types.Cave er corridorMap Not...
348
testCase = do (numRooms,exitNum) <- caveHeader numToRoom <- buildMap <$> rooms numRooms cs <- corridors (numRooms - 1) let corridorMap = reifyCorridors cs numToRoom exitRoom = numToRoom ^? ix exitNum case exitRoom of Just er -> return $ Types.Cave er corridorMap Nothing -> fail "No exit room."
318
false
true
0
12
74
122
57
65
null
null
edsko/cabal
Cabal/src/Distribution/PackageDescription.hs
bsd-3-clause
-- | Perform an action on each buildable 'Benchmark' in a package. withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO () withBenchmark pkg_descr f = mapM_ f $ filter (buildable . benchmarkBuildInfo) $ enabledBenchmarks pkg_descr
247
withBenchmark :: PackageDescription -> (Benchmark -> IO ()) -> IO () withBenchmark pkg_descr f = mapM_ f $ filter (buildable . benchmarkBuildInfo) $ enabledBenchmarks pkg_descr
180
withBenchmark pkg_descr f = mapM_ f $ filter (buildable . benchmarkBuildInfo) $ enabledBenchmarks pkg_descr
111
true
true
0
10
40
66
32
34
null
null
GaloisInc/halvm-ghc
compiler/simplCore/SimplUtils.hs
bsd-3-clause
mkLazyArgStop :: OutType -> CallCtxt -> SimplCont mkLazyArgStop ty cci = Stop ty cci
84
mkLazyArgStop :: OutType -> CallCtxt -> SimplCont mkLazyArgStop ty cci = Stop ty cci
84
mkLazyArgStop ty cci = Stop ty cci
34
false
true
0
6
13
29
14
15
null
null
Bodigrim/arithmoi
test-suite/Math/NumberTheory/Primes/LinearAlgebraTests.hs
mit
getRandomMatrix :: KnownNat k => Int -> StdGen -> Double -> SBMatrix k getRandomMatrix dim seedMat density = SBMatrix $ fromJust . SV.fromList $ listOfColumns where -- Choosing @(dim - 5)@ implies that the number of rows is five less than -- the number of columns. This ensures the matrix is singular. ...
480
getRandomMatrix :: KnownNat k => Int -> StdGen -> Double -> SBMatrix k getRandomMatrix dim seedMat density = SBMatrix $ fromJust . SV.fromList $ listOfColumns where -- Choosing @(dim - 5)@ implies that the number of rows is five less than -- the number of columns. This ensures the matrix is singular. ...
480
getRandomMatrix dim seedMat density = SBMatrix $ fromJust . SV.fromList $ listOfColumns where -- Choosing @(dim - 5)@ implies that the number of rows is five less than -- the number of columns. This ensures the matrix is singular. listOfColumns = L.take dim $ getRandomSBVectors (dim - 5) density s...
409
false
true
0
9
100
88
44
44
null
null
CloudI/CloudI
src/api/haskell/src/Foreign/Erlang.hs
mit
-- tag values here http://www.erlang.org/doc/apps/erts/erl_ext_dist.html tagVersion :: Word8 tagVersion = 131
109
tagVersion :: Word8 tagVersion = 131
36
tagVersion = 131
16
true
true
0
6
10
19
8
11
null
null
houshuang/frame
src/Data/Frame/Types.hs
mit
subsume (MT Any) v = NA
23
subsume (MT Any) v = NA
23
subsume (MT Any) v = NA
23
false
false
0
7
5
17
8
9
null
null
Tarrasch/stackage
Stackage/InstallInfo.hs
mit
showHackageMap :: (PackageName, BuildInfo) -> String showHackageMap (PackageName name, BuildInfo {..}) = show (name, showVersion biVersion, Nothing :: Maybe String)
168
showHackageMap :: (PackageName, BuildInfo) -> String showHackageMap (PackageName name, BuildInfo {..}) = show (name, showVersion biVersion, Nothing :: Maybe String)
168
showHackageMap (PackageName name, BuildInfo {..}) = show (name, showVersion biVersion, Nothing :: Maybe String)
115
false
true
0
8
23
60
32
28
null
null
cdepillabout/recursion-schemes-test
src/Lib.hs
bsd-3-clause
reduce' a = embed a
19
reduce' a = embed a
19
reduce' a = embed a
19
false
false
0
5
4
12
5
7
null
null
ntindall/KVStore
master/Master.hs
bsd-3-clause
- | Simple implementation of consistent hashing. Uses Farmhash to hash the -- KVRequest associated with the KVMessage. Takes the mod of the hash by the -- size of the ring to determine the first node that the data should be -- wrtten to (or searched at). The second node is just the current node + 1 (mod -- the size of...
845
consistentHashing_ :: KVKey -> MState MasterState IO [KVWorker] consistentHashing_ request = get >>= \s -> do let ring = (workerConfig $ cfg s) current = getHash request `mod` (L.length ring) successor = (current + 1) `mod` (L.length ring) shard = [uncurry (\h p -> KVWork...
514
consistentHashing_ request = get >>= \s -> do let ring = (workerConfig $ cfg s) current = getHash request `mod` (L.length ring) successor = (current + 1) `mod` (L.length ring) shard = [uncurry (\h p -> KVWorker current h p) (ring !! current), uncurry (\h p -> KVWorker succes...
430
true
true
1
17
211
230
122
108
null
null
jwiegley/lambdabot-1
lambdabot-utils/Lambdabot/AltTime.hs
mit
-- | @'addToClockTime' d t@ adds a time difference @d@ and a -- clock -- time @t@ to yield a new clock time. addToClockTime :: TimeDiff -> ClockTime -> ClockTime addToClockTime td (ClockTime ct) = ClockTime $ T.addToClockTime td ct
231
addToClockTime :: TimeDiff -> ClockTime -> ClockTime addToClockTime td (ClockTime ct) = ClockTime $ T.addToClockTime td ct
122
addToClockTime td (ClockTime ct) = ClockTime $ T.addToClockTime td ct
69
true
true
0
7
39
43
22
21
null
null
raventid/coursera_learning
haskell/chapter9/exers.hs
mit
myMinimumBy :: (a -> a -> Ordering) -> [a] -> a myMinimumBy _ (x:[]) = x
72
myMinimumBy :: (a -> a -> Ordering) -> [a] -> a myMinimumBy _ (x:[]) = x
72
myMinimumBy _ (x:[]) = x
24
false
true
0
8
15
47
25
22
null
null
Daniel-Diaz/wavy
Data/Sound/Analysis.hs
bsd-3-clause
norm :: Vector -> Complex norm f = sqrt $ hermitian f f
55
norm :: Vector -> Complex norm f = sqrt $ hermitian f f
55
norm f = sqrt $ hermitian f f
29
false
true
2
7
12
34
14
20
null
null
mumuki/mulang
src/Language/Mulang/Inspector/Generic.hs
gpl-3.0
raises :: BoundInspection raises predicate = containsExpression f where f (Raise (New (Reference n) _)) = predicate n f (Raise (Application (Reference n) _)) = predicate n f (Raise (Reference n)) = predicate n f _ = False
307
raises :: BoundInspection raises predicate = containsExpression f where f (Raise (New (Reference n) _)) = predicate n f (Raise (Application (Reference n) _)) = predicate n f (Raise (Reference n)) = predicate n f _ = False
307
raises predicate = containsExpression f where f (Raise (New (Reference n) _)) = predicate n f (Raise (Application (Reference n) _)) = predicate n f (Raise (Reference n)) = predicate n f _ = False
281
false
true
3
11
123
110
54
56
null
null
mydaum/cabal
Cabal/Distribution/Simple/Command.hs
bsd-3-clause
liftSet :: (b -> a) -> (a -> (b -> b)) -> (a -> a) -> b -> b liftSet get' set' set x = set' (set $ get' x) x
108
liftSet :: (b -> a) -> (a -> (b -> b)) -> (a -> a) -> b -> b liftSet get' set' set x = set' (set $ get' x) x
108
liftSet get' set' set x = set' (set $ get' x) x
47
false
true
0
10
30
79
41
38
null
null
jwaldmann/streams
Main.hs
gpl-3.0
unfold s = concat $ zipWith replicate s $ concat $ repeat [1,2]
63
unfold s = concat $ zipWith replicate s $ concat $ repeat [1,2]
63
unfold s = concat $ zipWith replicate s $ concat $ repeat [1,2]
63
false
false
0
8
12
35
17
18
null
null
DaMSL/K3
src/Language/K3/Parser/SQL.hs
apache-2.0
taliascolM :: TableAlias -> K3 Type -> SQLParseM (K3 Type) taliascolM alias t@(tnc -> (TCollection, [et@(tag -> TRecord _)])) = taliaselemM alias et >>= \net -> return $ (TC.collection net) @<- (annotations t)
211
taliascolM :: TableAlias -> K3 Type -> SQLParseM (K3 Type) taliascolM alias t@(tnc -> (TCollection, [et@(tag -> TRecord _)])) = taliaselemM alias et >>= \net -> return $ (TC.collection net) @<- (annotations t)
211
taliascolM alias t@(tnc -> (TCollection, [et@(tag -> TRecord _)])) = taliaselemM alias et >>= \net -> return $ (TC.collection net) @<- (annotations t)
152
false
true
0
14
34
104
54
50
null
null
yxm4109/pandoc
src/Text/Pandoc/Readers/LaTeX.hs
gpl-2.0
spacer :: GenParser Char st Inline spacer = try (string "\\,") >> return (Str "")
81
spacer :: GenParser Char st Inline spacer = try (string "\\,") >> return (Str "")
81
spacer = try (string "\\,") >> return (Str "")
46
false
true
1
8
14
44
19
25
null
null
dyokomizo/servant-JuicyPixels
examples/image-conversion.hs
gpl-3.0
conversionApi :: Proxy ConversionApi conversionApi = Proxy
58
conversionApi :: Proxy ConversionApi conversionApi = Proxy
58
conversionApi = Proxy
21
false
true
0
5
6
14
7
7
null
null
kawamuray/ganeti
src/Ganeti/Config.hs
gpl-2.0
-- | Retrieves all nodes hosting a DRBD disk getDrbdDiskNodes :: ConfigData -> Disk -> [Node] getDrbdDiskNodes cfg disk = let retrieved = case diskLogicalId disk of LIDDrbd8 nodeA nodeB _ _ _ _ -> justOk [getNode cfg nodeA, getNode cfg nodeB] _ ...
412
getDrbdDiskNodes :: ConfigData -> Disk -> [Node] getDrbdDiskNodes cfg disk = let retrieved = case diskLogicalId disk of LIDDrbd8 nodeA nodeB _ _ _ _ -> justOk [getNode cfg nodeA, getNode cfg nodeB] _ -> [] in retrieved ++ conca...
367
getDrbdDiskNodes cfg disk = let retrieved = case diskLogicalId disk of LIDDrbd8 nodeA nodeB _ _ _ _ -> justOk [getNode cfg nodeA, getNode cfg nodeB] _ -> [] in retrieved ++ concatMap (getDrbdDiskNodes cfg) (diskChildren disk)
318
true
true
0
14
145
113
55
58
null
null
ratsam/hs-carbon-aggregator
src/library/Carbon/Aggregator/Processor.hs
apache-2.0
processAggregateRule :: Rule -> BuffersManager -> AggregatedMetricName -> DataPoint -> IO () processAggregateRule rule bm metric dp = do buf <- getBufferRef bm (metric, rule) appendDataPoint buf dp
205
processAggregateRule :: Rule -> BuffersManager -> AggregatedMetricName -> DataPoint -> IO () processAggregateRule rule bm metric dp = do buf <- getBufferRef bm (metric, rule) appendDataPoint buf dp
205
processAggregateRule rule bm metric dp = do buf <- getBufferRef bm (metric, rule) appendDataPoint buf dp
112
false
true
0
10
35
67
32
35
null
null
vTurbine/ghc
compiler/typecheck/TcBinds.hs
bsd-3-clause
checkOverloadedSig :: Bool -> TcIdSigInst -> TcM () -- Example: -- f :: Eq a => a -> a -- K f = e -- The MR applies, but the signature is overloaded, and it's -- best to complain about this directly -- c.f Trac #11339 checkOverloadedSig monomorphism_restriction_applies sig | not (null (sig_inst_theta sig)) , mo...
568
checkOverloadedSig :: Bool -> TcIdSigInst -> TcM () checkOverloadedSig monomorphism_restriction_applies sig | not (null (sig_inst_theta sig)) , monomorphism_restriction_applies , let orig_sig = sig_inst_sig sig = setSrcSpan (sig_loc orig_sig) $ failWith $ hang (text "Overloaded signature conflicts with ...
398
checkOverloadedSig monomorphism_restriction_applies sig | not (null (sig_inst_theta sig)) , monomorphism_restriction_applies , let orig_sig = sig_inst_sig sig = setSrcSpan (sig_loc orig_sig) $ failWith $ hang (text "Overloaded signature conflicts with monomorphism restriction") 2 (ppr orig_sig) ...
346
true
true
2
12
115
133
62
71
null
null
PierreR/basic-prelude
test-is-a-prelude.hs
mit
pi = P.pi
9
pi = P.pi
9
pi = P.pi
9
false
false
1
6
2
12
4
8
null
null
arnizamani/occam
Haskell.hs
mit
replacePatExp rhs p (HsParen e) = replacePatExp rhs p e
66
replacePatExp rhs p (HsParen e) = replacePatExp rhs p e
66
replacePatExp rhs p (HsParen e) = replacePatExp rhs p e
66
false
false
0
6
20
29
12
17
null
null
jbracker/supermonad-plugin
examples/monad/hmtc/monad-param/TypeChecker.hs
bsd-3-clause
-- Check that an initialiser (expression defining a constant or initialising -- a variable) is well-initialised; i.e. does not call a function defined -- at the present scope level as this means it could refer to constants -- or variables that have not yet been initialised or even allocated. -- This is defined on MTIR ...
1,585
wellinit :: ScopeLvl -> Expression -> D () wellinit _ (ExpLitBool {}) = returnM ()
89
wellinit _ (ExpLitBool {}) = returnM ()
46
true
true
1
9
268
69
46
23
null
null
michalkonecny/aern
aern-ivp/src/Numeric/AERN/IVP/Examples/ODE/Simple.hs
bsd-3-clause
ivpSpringMass_ev :: (Var f ~ String, HasConstFns f, HasProjections f, Neg f, ArithInOut.RoundedRing f, ArithInOut.RoundedReal (Domain f), Show f, Show (Domain f) ) => f -> ODEIVP f ivpSpringMass_ev sampleFn = ivp where ivp = ODEIVP { ...
1,348
ivpSpringMass_ev :: (Var f ~ String, HasConstFns f, HasProjections f, Neg f, ArithInOut.RoundedRing f, ArithInOut.RoundedReal (Domain f), Show f, Show (Domain f) ) => f -> ODEIVP f ivpSpringMass_ev sampleFn = ivp where ivp = ODEIVP { ...
1,348
ivpSpringMass_ev sampleFn = ivp where ivp = ODEIVP { odeivp_description = "x'' = -x; (x,x')(" ++ show tStart ++ ") = " ++ show initialValues, odeivp_componentNames = ["x", "x'"], odeivp_intersectDomain = Just, odeivp_field = \ [x,x'] -> [x',neg...
1,119
false
true
0
12
424
383
208
175
null
null