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
LeoMingo/RPNMathParser
Functions/FunctionMaps.hs
gpl-3.0
isFMKeys :: String -> [(a,b)] -> Bool isFMKeys str fm = elem str $ getFMKeys fm
79
isFMKeys :: String -> [(a,b)] -> Bool isFMKeys str fm = elem str $ getFMKeys fm
79
isFMKeys str fm = elem str $ getFMKeys fm
41
false
true
2
9
15
50
23
27
null
null
ambiata/highlighting-kate
Text/Highlighting/Kate/Syntax/Email.hs
gpl-2.0
regex_'5bXx'5d'2d'5bMm'5dailing'2d'5bLl'5dist'3a = compileRegex False "[Xx]-[Mm]ailing-[Ll]ist:"
96
regex_'5bXx'5d'2d'5bMm'5dailing'2d'5bLl'5dist'3a = compileRegex False "[Xx]-[Mm]ailing-[Ll]ist:"
96
regex_'5bXx'5d'2d'5bMm'5dailing'2d'5bLl'5dist'3a = compileRegex False "[Xx]-[Mm]ailing-[Ll]ist:"
96
false
false
0
5
4
11
5
6
null
null
ditto-lang/ditto
src/Ditto/Test.hs
gpl-3.0
captureType = unlines [ "def Foo : Type where" , "Type" , "end" , "def foo (Foo : Foo) : Type where" , "(Foo : Foo) -> Foo" , "end" ]
148
captureType = unlines [ "def Foo : Type where" , "Type" , "end" , "def foo (Foo : Foo) : Type where" , "(Foo : Foo) -> Foo" , "end" ]
148
captureType = unlines [ "def Foo : Type where" , "Type" , "end" , "def foo (Foo : Foo) : Type where" , "(Foo : Foo) -> Foo" , "end" ]
148
false
false
0
5
45
27
16
11
null
null
siddhanathan/ghc
compiler/basicTypes/SrcLoc.hs
bsd-3-clause
combineSrcSpans (RealSrcSpan span1) (RealSrcSpan span2) = RealSrcSpan (combineRealSrcSpans span1 span2)
107
combineSrcSpans (RealSrcSpan span1) (RealSrcSpan span2) = RealSrcSpan (combineRealSrcSpans span1 span2)
107
combineSrcSpans (RealSrcSpan span1) (RealSrcSpan span2) = RealSrcSpan (combineRealSrcSpans span1 span2)
107
false
false
0
7
13
34
16
18
null
null
kim/amazonka
amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs
mpl-2.0
-- | The stack's attributes. sAttributes :: Lens' Stack (HashMap StackAttributesKeys Text) sAttributes = lens _sAttributes (\s a -> s { _sAttributes = a }) . _Map
162
sAttributes :: Lens' Stack (HashMap StackAttributesKeys Text) sAttributes = lens _sAttributes (\s a -> s { _sAttributes = a }) . _Map
133
sAttributes = lens _sAttributes (\s a -> s { _sAttributes = a }) . _Map
71
true
true
0
10
26
52
28
24
null
null
annenkov/contracts
Coq/Extraction/contracts-haskell/src/Examples/TranslationExample.hs
mit
transC c = fromMaybe (error "No translation") (fromContr c tZero)
65
transC c = fromMaybe (error "No translation") (fromContr c tZero)
65
transC c = fromMaybe (error "No translation") (fromContr c tZero)
65
false
false
0
7
9
28
13
15
null
null
lukexi/ghc-7.8-arm64
compiler/main/CmdLineParser.hs
bsd-3-clause
dropEq :: String -> String dropEq ('=' : s) = s
47
dropEq :: String -> String dropEq ('=' : s) = s
47
dropEq ('=' : s) = s
20
false
true
0
9
10
31
14
17
null
null
ekmett/ermine
src/Ermine/Inference/Type.hs
bsd-2-clause
unfurlConstraints c = pure $ partConstraints c
46
unfurlConstraints c = pure $ partConstraints c
46
unfurlConstraints c = pure $ partConstraints c
46
false
false
1
6
6
19
7
12
null
null
silkapp/xmlhtml
test/suite/Text/XmlHtml/Tests.hs
bsd-3-clause
badDoctype5 :: Bool badDoctype5 = isLeft $ parseXML "" ("<!DOCTYPE html SYSTEM \"foo\" " `B.append` "PUBLIC \"bar\" \"baz\">")
168
badDoctype5 :: Bool badDoctype5 = isLeft $ parseXML "" ("<!DOCTYPE html SYSTEM \"foo\" " `B.append` "PUBLIC \"bar\" \"baz\">")
168
badDoctype5 = isLeft $ parseXML "" ("<!DOCTYPE html SYSTEM \"foo\" " `B.append` "PUBLIC \"bar\" \"baz\">")
148
false
true
2
7
59
38
18
20
null
null
plow-technologies/persistent
persistent-test/src/Init.hs
mit
setup :: Action IO () setup = setupZookeeper
44
setup :: Action IO () setup = setupZookeeper
44
setup = setupZookeeper
22
false
true
1
6
7
22
9
13
null
null
Airtnp/Freshman_Simple_Haskell_Lib
Idioms/Prelude-extensions.hs
mit
trigger f g (Right x) = Left (g x)
34
trigger f g (Right x) = Left (g x)
34
trigger f g (Right x) = Left (g x)
34
false
false
0
7
8
28
13
15
null
null
dicomgrid/dicom-haskell-library
src/Data/DICOM/Dictionary.hs
gpl-3.0
tabletraverse :: B.ByteString -> Element tabletraverse = ds $ tag (TagGroup 0x0018) (TagElement 0x1131)
103
tabletraverse :: B.ByteString -> Element tabletraverse = ds $ tag (TagGroup 0x0018) (TagElement 0x1131)
103
tabletraverse = ds $ tag (TagGroup 0x0018) (TagElement 0x1131)
62
false
true
2
7
13
46
20
26
null
null
osa1/sequent-core
src/Language/SequentCore/Syntax.hs
bsd-3-clause
rhsIsCheapBy :: HasId b => CheapAppMeasure -> Rhs b -> Bool termIsCheapBy = termCheap
97
rhsIsCheapBy :: HasId b => CheapAppMeasure -> Rhs b -> Bool termIsCheapBy = termCheap
96
termIsCheapBy = termCheap
28
false
true
0
9
25
36
15
21
null
null
ribag/ganeti-experiments
src/Ganeti/Constants.hs
gpl-2.0
-- | Default fill target measured in sectors defaultFillTarget :: Int defaultFillTarget = 0
91
defaultFillTarget :: Int defaultFillTarget = 0
46
defaultFillTarget = 0
21
true
true
0
4
13
12
7
5
null
null
sebastiaanvisser/islay
src/TreeDelete.hs
bsd-3-clause
unshared = let m = minAlg in (repAlg <*> m) <+> (repAlg <*> m)
62
unshared = let m = minAlg in (repAlg <*> m) <+> (repAlg <*> m)
62
unshared = let m = minAlg in (repAlg <*> m) <+> (repAlg <*> m)
62
false
false
0
9
13
35
18
17
null
null
brendanhay/gogol
gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs
mpl-2.0
tvdptdpEndHour :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32) tvdptdpEndHour = lens _tvdptdpEndHour (\ s a -> s{_tvdptdpEndHour = a}) . mapping _Coerce
179
tvdptdpEndHour :: Lens' TargetingValueDayPartTargetingDayPart (Maybe Int32) tvdptdpEndHour = lens _tvdptdpEndHour (\ s a -> s{_tvdptdpEndHour = a}) . mapping _Coerce
179
tvdptdpEndHour = lens _tvdptdpEndHour (\ s a -> s{_tvdptdpEndHour = a}) . mapping _Coerce
103
false
true
2
8
33
59
27
32
null
null
tobynet/java-poker
src/Game/Poker/Simple.hs
mit
showPlayerName :: Player -> String showPlayerName Player = "You"
64
showPlayerName :: Player -> String showPlayerName Player = "You"
64
showPlayerName Player = "You"
29
false
true
0
7
8
24
10
14
null
null
vTurbine/ghc
utils/ghctags/Main.hs
bsd-3-clause
writectagsfile :: Handle -> FileData -> IO () writectagsfile ctagsfile filedata = do let things = getfoundthings filedata mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing False x) things mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing True x) things
267
writectagsfile :: Handle -> FileData -> IO () writectagsfile ctagsfile filedata = do let things = getfoundthings filedata mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing False x) things mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing True x) things
267
writectagsfile ctagsfile filedata = do let things = getfoundthings filedata mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing False x) things mapM_ (\x -> hPutStrLn ctagsfile $ dumpthing True x) things
221
false
true
0
12
62
102
46
56
null
null
georgeee/haskell-google-calendar-api
Network/Google/Calendar/Constraints.hs
mit
fullScope = ""
14
fullScope = ""
14
fullScope = ""
14
false
false
0
4
2
6
3
3
null
null
chrisdone/ircbrowse
src/Ircbrowse/View/Overview.hs
bsd-3-clause
statsOverview :: Channel -> Range -> Stats -> Html statsOverview channel range stats = do template "overview" ("IRC Browse: #" <> pack (showChan channel)) cloudScripts $ do channelNav channel container $ do row $ do span12 $ do summarize channel range stats row $ do span6 $ mostActiveTimes stats span6 $ dailyActivity range stats row $ do span6 $ activeNicks channel stats span6 $ nickCloud channel (stActiveNicks stats) row $ do span6 $ activityByYear stats span6 $ conversationByYear stats footer
603
statsOverview :: Channel -> Range -> Stats -> Html statsOverview channel range stats = do template "overview" ("IRC Browse: #" <> pack (showChan channel)) cloudScripts $ do channelNav channel container $ do row $ do span12 $ do summarize channel range stats row $ do span6 $ mostActiveTimes stats span6 $ dailyActivity range stats row $ do span6 $ activeNicks channel stats span6 $ nickCloud channel (stActiveNicks stats) row $ do span6 $ activityByYear stats span6 $ conversationByYear stats footer
603
statsOverview channel range stats = do template "overview" ("IRC Browse: #" <> pack (showChan channel)) cloudScripts $ do channelNav channel container $ do row $ do span12 $ do summarize channel range stats row $ do span6 $ mostActiveTimes stats span6 $ dailyActivity range stats row $ do span6 $ activeNicks channel stats span6 $ nickCloud channel (stActiveNicks stats) row $ do span6 $ activityByYear stats span6 $ conversationByYear stats footer
552
false
true
0
23
183
199
85
114
null
null
bgamari/pandoc
src/Text/Pandoc/Writers/Docx.hs
gpl-2.0
inlineToOpenXML opts (Link txt ('#':xs,_)) = do contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt return [ mknode "w:hyperlink" [("w:anchor",xs)] contents ] -- external link:
197
inlineToOpenXML opts (Link txt ('#':xs,_)) = do contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt return [ mknode "w:hyperlink" [("w:anchor",xs)] contents ] -- external link:
197
inlineToOpenXML opts (Link txt ('#':xs,_)) = do contents <- withTextProp (rStyle "Link") $ inlinesToOpenXML opts txt return [ mknode "w:hyperlink" [("w:anchor",xs)] contents ] -- external link:
197
false
false
0
11
29
80
40
40
null
null
siddhanathan/ghc
compiler/basicTypes/RdrName.hs
bsd-3-clause
greQualModName :: GlobalRdrElt -> ModuleName -- Get a suitable module qualifier for the GRE -- (used in mkPrintUnqualified) -- Prerecondition: the gre_name is always External greQualModName gre@(GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | lcl, Just mod <- nameModule_maybe name = moduleName mod | (is:_) <- iss = is_as (is_decl is) | otherwise = pprPanic "greQualModName" (ppr gre)
451
greQualModName :: GlobalRdrElt -> ModuleName greQualModName gre@(GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | lcl, Just mod <- nameModule_maybe name = moduleName mod | (is:_) <- iss = is_as (is_decl is) | otherwise = pprPanic "greQualModName" (ppr gre)
321
greQualModName gre@(GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | lcl, Just mod <- nameModule_maybe name = moduleName mod | (is:_) <- iss = is_as (is_decl is) | otherwise = pprPanic "greQualModName" (ppr gre)
276
true
true
1
10
119
120
62
58
null
null
fmthoma/ghc
compiler/nativeGen/AsmCodeGen.hs
bsd-3-clause
cmmStmtConFold :: CmmNode e x -> CmmOptM (CmmNode e x) cmmStmtConFold stmt = case stmt of CmmAssign reg src -> do src' <- cmmExprConFold DataReference src return $ case src' of CmmReg reg' | reg == reg' -> CmmComment (fsLit "nop") new_src -> CmmAssign reg new_src CmmStore addr src -> do addr' <- cmmExprConFold DataReference addr src' <- cmmExprConFold DataReference src return $ CmmStore addr' src' CmmCall { cml_target = addr } -> do addr' <- cmmExprConFold JumpReference addr return $ stmt { cml_target = addr' } CmmUnsafeForeignCall target regs args -> do target' <- case target of ForeignTarget e conv -> do e' <- cmmExprConFold CallReference e return $ ForeignTarget e' conv PrimTarget _ -> return target args' <- mapM (cmmExprConFold DataReference) args return $ CmmUnsafeForeignCall target' regs args' CmmCondBranch test true false -> do test' <- cmmExprConFold DataReference test return $ case test' of CmmLit (CmmInt 0 _) -> CmmBranch false CmmLit (CmmInt _ _) -> CmmBranch true _other -> CmmCondBranch test' true false CmmSwitch expr ids -> do expr' <- cmmExprConFold DataReference expr return $ CmmSwitch expr' ids other -> return other
1,679
cmmStmtConFold :: CmmNode e x -> CmmOptM (CmmNode e x) cmmStmtConFold stmt = case stmt of CmmAssign reg src -> do src' <- cmmExprConFold DataReference src return $ case src' of CmmReg reg' | reg == reg' -> CmmComment (fsLit "nop") new_src -> CmmAssign reg new_src CmmStore addr src -> do addr' <- cmmExprConFold DataReference addr src' <- cmmExprConFold DataReference src return $ CmmStore addr' src' CmmCall { cml_target = addr } -> do addr' <- cmmExprConFold JumpReference addr return $ stmt { cml_target = addr' } CmmUnsafeForeignCall target regs args -> do target' <- case target of ForeignTarget e conv -> do e' <- cmmExprConFold CallReference e return $ ForeignTarget e' conv PrimTarget _ -> return target args' <- mapM (cmmExprConFold DataReference) args return $ CmmUnsafeForeignCall target' regs args' CmmCondBranch test true false -> do test' <- cmmExprConFold DataReference test return $ case test' of CmmLit (CmmInt 0 _) -> CmmBranch false CmmLit (CmmInt _ _) -> CmmBranch true _other -> CmmCondBranch test' true false CmmSwitch expr ids -> do expr' <- cmmExprConFold DataReference expr return $ CmmSwitch expr' ids other -> return other
1,679
cmmStmtConFold stmt = case stmt of CmmAssign reg src -> do src' <- cmmExprConFold DataReference src return $ case src' of CmmReg reg' | reg == reg' -> CmmComment (fsLit "nop") new_src -> CmmAssign reg new_src CmmStore addr src -> do addr' <- cmmExprConFold DataReference addr src' <- cmmExprConFold DataReference src return $ CmmStore addr' src' CmmCall { cml_target = addr } -> do addr' <- cmmExprConFold JumpReference addr return $ stmt { cml_target = addr' } CmmUnsafeForeignCall target regs args -> do target' <- case target of ForeignTarget e conv -> do e' <- cmmExprConFold CallReference e return $ ForeignTarget e' conv PrimTarget _ -> return target args' <- mapM (cmmExprConFold DataReference) args return $ CmmUnsafeForeignCall target' regs args' CmmCondBranch test true false -> do test' <- cmmExprConFold DataReference test return $ case test' of CmmLit (CmmInt 0 _) -> CmmBranch false CmmLit (CmmInt _ _) -> CmmBranch true _other -> CmmCondBranch test' true false CmmSwitch expr ids -> do expr' <- cmmExprConFold DataReference expr return $ CmmSwitch expr' ids other -> return other
1,624
false
true
0
17
714
436
195
241
null
null
diekmann/useless_playground_shame
grumpybot/Main.hs
apache-2.0
server = "irc.freenode.org"
27
server = "irc.freenode.org"
27
server = "irc.freenode.org"
27
false
false
0
4
2
6
3
3
null
null
tpsinnem/Idris-dev
src/Idris/Reflection.hs
bsd-3-clause
-- FIXME: Uniqueness! reflectNameType (TCon x y) = reflCall "TCon" [RConstant (I x), RConstant (I y)]
103
reflectNameType (TCon x y) = reflCall "TCon" [RConstant (I x), RConstant (I y)]
81
reflectNameType (TCon x y) = reflCall "TCon" [RConstant (I x), RConstant (I y)]
81
true
false
0
9
17
47
23
24
null
null
jwiegley/ghc-release
utils/haddock/src/Haddock/Convert.hs
gpl-3.0
synifyAxiom :: CoAxiom br -> HsDecl Name synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | isOpenSynFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNames })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = TyClD (synifyTyCon (Just ax) tc) | otherwise = error "synifyAxiom: closed/open family confusion"
542
synifyAxiom :: CoAxiom br -> HsDecl Name synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | isOpenSynFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNames })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = TyClD (synifyTyCon (Just ax) tc) | otherwise = error "synifyAxiom: closed/open family confusion"
542
synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | isOpenSynFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNames })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = TyClD (synifyTyCon (Just ax) tc) | otherwise = error "synifyAxiom: closed/open family confusion"
501
false
true
18
10
128
146
75
71
null
null
thalerjonathan/phd
public/towards/SugarScape/experimental/chapter2_environment/src/SugarScape/Discrete.hs
gpl-3.0
neighbourhoodOf :: Discrete2dCoord -> Bool -> Discrete2dNeighbourhood -> Discrete2dNeighbourhood neighbourhoodOf coord@(x,y) includeCoord ns | includeCoord = coord : ns' | otherwise = ns' where ns' = map (\(x', y') -> (x + x', y + y')) ns
304
neighbourhoodOf :: Discrete2dCoord -> Bool -> Discrete2dNeighbourhood -> Discrete2dNeighbourhood neighbourhoodOf coord@(x,y) includeCoord ns | includeCoord = coord : ns' | otherwise = ns' where ns' = map (\(x', y') -> (x + x', y + y')) ns
304
neighbourhoodOf coord@(x,y) includeCoord ns | includeCoord = coord : ns' | otherwise = ns' where ns' = map (\(x', y') -> (x + x', y + y')) ns
156
false
true
10
9
102
99
53
46
null
null
dysinger/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | The fixed price charged for this offering. rdbioFixedPrice :: Lens' ReservedDBInstancesOffering (Maybe Double) rdbioFixedPrice = lens _rdbioFixedPrice (\s a -> s { _rdbioFixedPrice = a })
192
rdbioFixedPrice :: Lens' ReservedDBInstancesOffering (Maybe Double) rdbioFixedPrice = lens _rdbioFixedPrice (\s a -> s { _rdbioFixedPrice = a })
144
rdbioFixedPrice = lens _rdbioFixedPrice (\s a -> s { _rdbioFixedPrice = a })
76
true
true
0
9
27
46
25
21
null
null
rolph-recto/liquid-fixpoint
src/Language/Fixpoint/Types/Constraints.hs
bsd-3-clause
blowOutVV :: FInfo a -> Integer -> SubC a -> FInfo a blowOutVV fi i subc = fi { bs = be', cm = cm' } where sr = slhs subc x = reftBind $ sr_reft sr (bindId, be') = insertBindEnv x sr $ bs fi subc' = subc { _senv = insertsIBindEnv [bindId] $ senv subc } cm' = M.insert i subc' $ cm fi
346
blowOutVV :: FInfo a -> Integer -> SubC a -> FInfo a blowOutVV fi i subc = fi { bs = be', cm = cm' } where sr = slhs subc x = reftBind $ sr_reft sr (bindId, be') = insertBindEnv x sr $ bs fi subc' = subc { _senv = insertsIBindEnv [bindId] $ senv subc } cm' = M.insert i subc' $ cm fi
346
blowOutVV fi i subc = fi { bs = be', cm = cm' } where sr = slhs subc x = reftBind $ sr_reft sr (bindId, be') = insertBindEnv x sr $ bs fi subc' = subc { _senv = insertsIBindEnv [bindId] $ senv subc } cm' = M.insert i subc' $ cm fi
293
false
true
4
12
128
146
73
73
null
null
jkozlowski/better-bot
src/Network/Better/Session.hs
mit
loginInteractive :: MonadIO m => S.Session -> T.Text -> m () loginInteractive s email = getPassword >>= login s email
117
loginInteractive :: MonadIO m => S.Session -> T.Text -> m () loginInteractive s email = getPassword >>= login s email
117
loginInteractive s email = getPassword >>= login s email
56
false
true
0
9
19
49
23
26
null
null
co-dan/NPNTool
src/NPNTool/NPNConstr.hs
bsd-3-clause
-- | Lift a 'PTC.PTConstrM' constructions to 'NPNConstrM' monad liftPTC :: Ord v => PTC.PTConstrM l a -> NPNConstrM l v a liftPTC ptc = do st <- get let c = PTC.new { PTC.p = M.map (const 0) $ p st , PTC.key = key st, PTC.keyT = keyT st , PTC.tlab = tlab st } (res,c') = runState ptc c st' = st { p = M.unionWith (++) (p st) (M.map (intToList) $ PTC.p c') , key = PTC.key c', keyT = PTC.keyT c' , tlab = PTC.tlab c' , tin = M.unionWith mappend (tin st) (M.map toSArc (PTC.tin c')) , tout = M.unionWith mappend (tout st) (M.map toSArc (PTC.tout c')) } put st' return res -- | Adds an existing element net to the system
769
liftPTC :: Ord v => PTC.PTConstrM l a -> NPNConstrM l v a liftPTC ptc = do st <- get let c = PTC.new { PTC.p = M.map (const 0) $ p st , PTC.key = key st, PTC.keyT = keyT st , PTC.tlab = tlab st } (res,c') = runState ptc c st' = st { p = M.unionWith (++) (p st) (M.map (intToList) $ PTC.p c') , key = PTC.key c', keyT = PTC.keyT c' , tlab = PTC.tlab c' , tin = M.unionWith mappend (tin st) (M.map toSArc (PTC.tin c')) , tout = M.unionWith mappend (tout st) (M.map toSArc (PTC.tout c')) } put st' return res -- | Adds an existing element net to the system
703
liftPTC ptc = do st <- get let c = PTC.new { PTC.p = M.map (const 0) $ p st , PTC.key = key st, PTC.keyT = keyT st , PTC.tlab = tlab st } (res,c') = runState ptc c st' = st { p = M.unionWith (++) (p st) (M.map (intToList) $ PTC.p c') , key = PTC.key c', keyT = PTC.keyT c' , tlab = PTC.tlab c' , tin = M.unionWith mappend (tin st) (M.map toSArc (PTC.tin c')) , tout = M.unionWith mappend (tout st) (M.map toSArc (PTC.tout c')) } put st' return res -- | Adds an existing element net to the system
645
true
true
0
18
279
315
159
156
null
null
oden-lang/oden
src/Oden/Lexer.hs
mit
lexer :: Tok.GenTokenParser L.Text () Identity lexer = Tok.makeTokenParser Tok.LanguageDef { Tok.commentStart = "/*" , Tok.commentEnd = "*/" , Tok.commentLine = "//" , Tok.nestedComments = True , Tok.identStart = nameFirst , Tok.identLetter = nameLetter , Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.reservedNames = reservedNames , Tok.reservedOpNames = reservedOps , Tok.caseSensitive = True }
512
lexer :: Tok.GenTokenParser L.Text () Identity lexer = Tok.makeTokenParser Tok.LanguageDef { Tok.commentStart = "/*" , Tok.commentEnd = "*/" , Tok.commentLine = "//" , Tok.nestedComments = True , Tok.identStart = nameFirst , Tok.identLetter = nameLetter , Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.reservedNames = reservedNames , Tok.reservedOpNames = reservedOps , Tok.caseSensitive = True }
512
lexer = Tok.makeTokenParser Tok.LanguageDef { Tok.commentStart = "/*" , Tok.commentEnd = "*/" , Tok.commentLine = "//" , Tok.nestedComments = True , Tok.identStart = nameFirst , Tok.identLetter = nameLetter , Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~" , Tok.reservedNames = reservedNames , Tok.reservedOpNames = reservedOps , Tok.caseSensitive = True }
465
false
true
1
8
121
134
74
60
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/ExtensionPredicates.hs
bsd-3-clause
-- | Is the <https://www.opengl.org/registry/specs/OVR/multiview.txt OVR_multiview> extension supported? -- Note that in the presence of multiple contexts with different capabilities, -- this might be wrong. Use 'glGetOVRMultiview' in those cases instead. gl_OVR_multiview :: Bool gl_OVR_multiview = member "GL_OVR_multiview" extensions
336
gl_OVR_multiview :: Bool gl_OVR_multiview = member "GL_OVR_multiview" extensions
80
gl_OVR_multiview = member "GL_OVR_multiview" extensions
55
true
true
0
5
38
19
11
8
null
null
ihc/futhark
src/Futhark/Optimise/MemoryBlockMerging/PrimExps.hs
isc
lookInBody :: LoreConstraints lore => Body lore -> FindM lore () lookInBody (Body _ bnds _res) = mapM_ lookInStm bnds
133
lookInBody :: LoreConstraints lore => Body lore -> FindM lore () lookInBody (Body _ bnds _res) = mapM_ lookInStm bnds
133
lookInBody (Body _ bnds _res) = mapM_ lookInStm bnds
54
false
true
0
8
35
50
23
27
null
null
jtojnar/haste-compiler
libraries/ghc-7.10/base/GHC/List.hs
bsd-3-clause
lookup key ((x,y):xys) | key == x = Just y | otherwise = lookup key xys
99
lookup key ((x,y):xys) | key == x = Just y | otherwise = lookup key xys
99
lookup key ((x,y):xys) | key == x = Just y | otherwise = lookup key xys
99
false
false
0
8
43
55
25
30
null
null
rudyl313/factual-haskell-driver
Data/Factual/Response.hs
bsd-3-clause
formValidResponse :: Value -> Response formValidResponse value = Response { status = "ok" , version = lookupNumber "version" value , response = lookupValue "response" value , errorMessage = Nothing , errorType = Nothing }
361
formValidResponse :: Value -> Response formValidResponse value = Response { status = "ok" , version = lookupNumber "version" value , response = lookupValue "response" value , errorMessage = Nothing , errorType = Nothing }
361
formValidResponse value = Response { status = "ok" , version = lookupNumber "version" value , response = lookupValue "response" value , errorMessage = Nothing , errorType = Nothing }
322
false
true
0
8
173
64
35
29
null
null
aaronc/Idris-dev
src/IRTS/CodegenC.hs
bsd-3-clause
doOp v LFSin [x] = v ++ flUnOp "sin" (creg x)
45
doOp v LFSin [x] = v ++ flUnOp "sin" (creg x)
45
doOp v LFSin [x] = v ++ flUnOp "sin" (creg x)
45
false
false
2
7
10
35
15
20
null
null
kRITZCREEK/dickminer
src/Dickmine/Query.hs
bsd-3-clause
pluckWorldPoints :: (Monad m) => Pipe Pagehit (Double, Double) m () pluckWorldPoints = P.map (latitude &&& longitude)
117
pluckWorldPoints :: (Monad m) => Pipe Pagehit (Double, Double) m () pluckWorldPoints = P.map (latitude &&& longitude)
117
pluckWorldPoints = P.map (latitude &&& longitude)
49
false
true
0
8
16
54
27
27
null
null
lhoghu/intranet
Web/YahooPortfolioManager/Handlers.hs
mit
ypmLayout :: Yesod master => Html -> HtmlUrl (Route master) -> HandlerT YPMS (HandlerT master IO) Html ypmLayout title widget = do -- Need to lift the child site url to the parent site in order -- to create links within the subsite: see use of toParent in -- sidebar.hamlet (http://www.yesodweb.com/blog/2013/03/big-subsite-rewrite) toParent <- getRouteToParent let content = widget lift $ defaultLayout $ do setTitle title toWidget $(hamletFile "Web/YahooPortfolioManager/templates/sidebar.hamlet")
593
ypmLayout :: Yesod master => Html -> HtmlUrl (Route master) -> HandlerT YPMS (HandlerT master IO) Html ypmLayout title widget = do -- Need to lift the child site url to the parent site in order -- to create links within the subsite: see use of toParent in -- sidebar.hamlet (http://www.yesodweb.com/blog/2013/03/big-subsite-rewrite) toParent <- getRouteToParent let content = widget lift $ defaultLayout $ do setTitle title toWidget $(hamletFile "Web/YahooPortfolioManager/templates/sidebar.hamlet")
593
ypmLayout title widget = do -- Need to lift the child site url to the parent site in order -- to create links within the subsite: see use of toParent in -- sidebar.hamlet (http://www.yesodweb.com/blog/2013/03/big-subsite-rewrite) toParent <- getRouteToParent let content = widget lift $ defaultLayout $ do setTitle title toWidget $(hamletFile "Web/YahooPortfolioManager/templates/sidebar.hamlet")
438
false
true
0
14
161
109
49
60
null
null
Marcus-Rosti/numerical-methods
test/Test_Ch_02.hs
gpl-2.0
fRoot = (-0.56714329040978387299996866221035554975381578718651250813513)
72
fRoot = (-0.56714329040978387299996866221035554975381578718651250813513)
72
fRoot = (-0.56714329040978387299996866221035554975381578718651250813513)
72
false
false
1
6
2
14
6
8
null
null
paldepind/reflex-examples
counters/Counters.hs
mit
createCounter = Counter 0
25
createCounter = Counter 0
25
createCounter = Counter 0
25
false
false
0
5
3
9
4
5
null
null
minib00m/jpp
src/Parser.hs
mit
lexeme :: ParsecT String u Identity a -> ParsecT String u Identity a lexeme = T.lexeme lexer
104
lexeme :: ParsecT String u Identity a -> ParsecT String u Identity a lexeme = T.lexeme lexer
104
lexeme = T.lexeme lexer
29
false
true
0
6
28
38
18
20
null
null
jstolarek/sandbox
haskell/99.problems/Problem07.hs
unlicense
flatten :: [a] -> [b] flatten [] = []
40
flatten :: [a] -> [b] flatten [] = []
38
flatten [] = []
16
false
true
0
6
11
28
15
13
null
null
iteloo/tsuru-sample
iteratee-0.8.9.6/tests/testIteratee.hs
bsd-3-clause
mk_prop_pt_id etee p_etee i xs n = n > 0 ==> runner1 (enumSpecial xs n $ joinI (p_etee i)) == runner1 (enumSpecial xs n $ joinI (etee i)) where types = (etee, p_etee, i, xs) :: (Etee, Etee, Itee, [Int])
207
mk_prop_pt_id etee p_etee i xs n = n > 0 ==> runner1 (enumSpecial xs n $ joinI (p_etee i)) == runner1 (enumSpecial xs n $ joinI (etee i)) where types = (etee, p_etee, i, xs) :: (Etee, Etee, Itee, [Int])
207
mk_prop_pt_id etee p_etee i xs n = n > 0 ==> runner1 (enumSpecial xs n $ joinI (p_etee i)) == runner1 (enumSpecial xs n $ joinI (etee i)) where types = (etee, p_etee, i, xs) :: (Etee, Etee, Itee, [Int])
207
false
false
3
11
44
113
59
54
null
null
warreee/Algorithm-Implementations
Fibonacci_series/Haskell/NorfairKing/fib.hs
mit
{- All fibonacci numbers. The list is made by prepending '1', twice, to the zipped sum of itself and itself, shifted one index. 1, 1, 2, 3, 5, 8, 13 ... 1, 1, 2, 3, 5 ... 1, 2, 3, 5, 8 ... -} fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
278
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
43
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)
43
true
false
5
7
97
35
16
19
null
null
rueshyna/gogol
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
mpl-2.0
-- | DART ID of the country to which this metro region belongs. metCountryDartId :: Lens' Metro (Maybe Int64) metCountryDartId = lens _metCountryDartId (\ s a -> s{_metCountryDartId = a}) . mapping _Coerce
219
metCountryDartId :: Lens' Metro (Maybe Int64) metCountryDartId = lens _metCountryDartId (\ s a -> s{_metCountryDartId = a}) . mapping _Coerce
155
metCountryDartId = lens _metCountryDartId (\ s a -> s{_metCountryDartId = a}) . mapping _Coerce
109
true
true
2
8
46
59
28
31
null
null
JacquesCarette/literate-scientific-software
code/drasil-gool/GOOL/Drasil/State.hs
bsd-2-clause
-- FS - CS -- getCSfromFS :: (GOOLState, FileState) -> ((GOOLState, FileState), ClassState) getCSfromFS fs = (fs, initialCS)
125
getCSfromFS :: (GOOLState, FileState) -> ((GOOLState, FileState), ClassState) getCSfromFS fs = (fs, initialCS)
110
getCSfromFS fs = (fs, initialCS)
32
true
true
0
9
18
49
27
22
null
null
dysinger/amazonka
amazonka-rds/gen/Network/AWS/RDS/Types.hs
mpl-2.0
-- | The storage type for this orderable DB instance. odbioStorageType :: Lens' OrderableDBInstanceOption (Maybe Text) odbioStorageType = lens _odbioStorageType (\s a -> s { _odbioStorageType = a })
198
odbioStorageType :: Lens' OrderableDBInstanceOption (Maybe Text) odbioStorageType = lens _odbioStorageType (\s a -> s { _odbioStorageType = a })
144
odbioStorageType = lens _odbioStorageType (\s a -> s { _odbioStorageType = a })
79
true
true
0
9
28
46
25
21
null
null
mbg/system-f-with-kind-polymorphism
Main.hs
mit
addDef (Def n mt e) = do env <- get case inlineExprs env e of (Left err) -> error err (Right e') -> case infer e' (initialTyEnv env) of (Left m) -> error m (Right t) -> do checkTypeSignature n t mt addGlobalValue n e' t mt {-lookupType :: String -> Env () lookupType n = do s <- get liftIO $ case lookup n (initialTyEnv s) of (Just t) -> putStrLn $ n ++ " : " ++ show t Nothing -> putStrLn $ n ++ " is undefined!"-}
541
addDef (Def n mt e) = do env <- get case inlineExprs env e of (Left err) -> error err (Right e') -> case infer e' (initialTyEnv env) of (Left m) -> error m (Right t) -> do checkTypeSignature n t mt addGlobalValue n e' t mt {-lookupType :: String -> Env () lookupType n = do s <- get liftIO $ case lookup n (initialTyEnv s) of (Just t) -> putStrLn $ n ++ " : " ++ show t Nothing -> putStrLn $ n ++ " is undefined!"-}
541
addDef (Def n mt e) = do env <- get case inlineExprs env e of (Left err) -> error err (Right e') -> case infer e' (initialTyEnv env) of (Left m) -> error m (Right t) -> do checkTypeSignature n t mt addGlobalValue n e' t mt {-lookupType :: String -> Env () lookupType n = do s <- get liftIO $ case lookup n (initialTyEnv s) of (Just t) -> putStrLn $ n ++ " : " ++ show t Nothing -> putStrLn $ n ++ " is undefined!"-}
541
false
false
0
15
215
130
60
70
null
null
josuf107/Adverb
Adverb/Common.hs
gpl-3.0
grudgingly = id
15
grudgingly = id
15
grudgingly = id
15
false
false
0
4
2
6
3
3
null
null
tibbe/cassava
tests/UnitTests.hs
bsd-3-clause
conversionTests :: [TF.Test] conversionTests = [ testGroup "roundTrip" [ testProperty "Char" (roundTrip :: Char -> Bool) , testProperty "ByteString" (roundTrip :: B.ByteString -> Bool) , testProperty "Int" (roundTrip :: Int -> Bool) , testProperty "Integer" (roundTrip :: Integer -> Bool) , testProperty "Int8" (roundTrip :: Int8 -> Bool) , testProperty "Int16" (roundTrip :: Int16 -> Bool) , testProperty "Int32" (roundTrip :: Int32 -> Bool) , testProperty "Int64" (roundTrip :: Int64 -> Bool) , testProperty "Word" (roundTrip :: Word -> Bool) , testProperty "Word8" (roundTrip :: Word8 -> Bool) , testProperty "Word16" (roundTrip :: Word16 -> Bool) , testProperty "Word32" (roundTrip :: Word32 -> Bool) , testProperty "Word64" (roundTrip :: Word64 -> Bool) , testProperty "lazy ByteString" (roundTrip :: BL.ByteString -> Bool) , testProperty "Text" (roundTrip :: T.Text -> Bool) , testProperty "lazy Text" (roundTrip :: LT.Text -> Bool) ] , testGroup "boundary" [ testProperty "Int" (boundary (undefined :: Int)) , testProperty "Int8" (boundary (undefined :: Int8)) , testProperty "Int16" (boundary (undefined :: Int16)) , testProperty "Int32" (boundary (undefined :: Int32)) , testProperty "Int64" (boundary (undefined :: Int64)) , testProperty "Word" (boundary (undefined :: Word)) , testProperty "Word8" (boundary (undefined :: Word8)) , testProperty "Word16" (boundary (undefined :: Word16)) , testProperty "Word32" (boundary (undefined :: Word32)) , testProperty "Word64" (boundary (undefined :: Word64)) ] , testGroup "Unicode" [ testCase "Chinese" (roundTripUnicode "我能吞下玻璃而不伤身体。") , testCase "Icelandic" (roundTripUnicode "Sævör grét áðan því úlpan var ónýt.") , testCase "Turkish" (roundTripUnicode "Cam yiyebilirim, bana zararı dokunmaz.") ] , testGroup "Partial Decodes" [ testCase "Int" (partialDecode (parseField "12.7" :: Parser Int)) , testCase "Word" (partialDecode (parseField "12.7" :: Parser Word)) , testCase "Double" (partialDecode (parseField "1.0+" :: Parser Double)) , testCase "Integer" (partialDecode (parseField "1e6" :: Parser Integer)) ] , testGroup "Space trimming" [ testCase "_Int" (expect (parseField " 12" :: Parser Int) 12) , testCase "Int_" (expect (parseField "12 " :: Parser Int) 12) , testCase "_Int_" (expect (parseField " 12 " :: Parser Int) 12) , testCase "_Word" (expect (parseField " 12" :: Parser Word) 12) , testCase "Word_" (expect (parseField "12 " :: Parser Word) 12) , testCase "_Word_" (expect (parseField " 12 " :: Parser Word) 12) , testCase "_Double" (expect (parseField " 1.2e1" :: Parser Double) 12) , testCase "Double_" (expect (parseField "1.2e1 " :: Parser Double) 12) , testCase "_Double_" (expect (parseField " 1.2e1 " :: Parser Double) 12) ] ]
3,260
conversionTests :: [TF.Test] conversionTests = [ testGroup "roundTrip" [ testProperty "Char" (roundTrip :: Char -> Bool) , testProperty "ByteString" (roundTrip :: B.ByteString -> Bool) , testProperty "Int" (roundTrip :: Int -> Bool) , testProperty "Integer" (roundTrip :: Integer -> Bool) , testProperty "Int8" (roundTrip :: Int8 -> Bool) , testProperty "Int16" (roundTrip :: Int16 -> Bool) , testProperty "Int32" (roundTrip :: Int32 -> Bool) , testProperty "Int64" (roundTrip :: Int64 -> Bool) , testProperty "Word" (roundTrip :: Word -> Bool) , testProperty "Word8" (roundTrip :: Word8 -> Bool) , testProperty "Word16" (roundTrip :: Word16 -> Bool) , testProperty "Word32" (roundTrip :: Word32 -> Bool) , testProperty "Word64" (roundTrip :: Word64 -> Bool) , testProperty "lazy ByteString" (roundTrip :: BL.ByteString -> Bool) , testProperty "Text" (roundTrip :: T.Text -> Bool) , testProperty "lazy Text" (roundTrip :: LT.Text -> Bool) ] , testGroup "boundary" [ testProperty "Int" (boundary (undefined :: Int)) , testProperty "Int8" (boundary (undefined :: Int8)) , testProperty "Int16" (boundary (undefined :: Int16)) , testProperty "Int32" (boundary (undefined :: Int32)) , testProperty "Int64" (boundary (undefined :: Int64)) , testProperty "Word" (boundary (undefined :: Word)) , testProperty "Word8" (boundary (undefined :: Word8)) , testProperty "Word16" (boundary (undefined :: Word16)) , testProperty "Word32" (boundary (undefined :: Word32)) , testProperty "Word64" (boundary (undefined :: Word64)) ] , testGroup "Unicode" [ testCase "Chinese" (roundTripUnicode "我能吞下玻璃而不伤身体。") , testCase "Icelandic" (roundTripUnicode "Sævör grét áðan því úlpan var ónýt.") , testCase "Turkish" (roundTripUnicode "Cam yiyebilirim, bana zararı dokunmaz.") ] , testGroup "Partial Decodes" [ testCase "Int" (partialDecode (parseField "12.7" :: Parser Int)) , testCase "Word" (partialDecode (parseField "12.7" :: Parser Word)) , testCase "Double" (partialDecode (parseField "1.0+" :: Parser Double)) , testCase "Integer" (partialDecode (parseField "1e6" :: Parser Integer)) ] , testGroup "Space trimming" [ testCase "_Int" (expect (parseField " 12" :: Parser Int) 12) , testCase "Int_" (expect (parseField "12 " :: Parser Int) 12) , testCase "_Int_" (expect (parseField " 12 " :: Parser Int) 12) , testCase "_Word" (expect (parseField " 12" :: Parser Word) 12) , testCase "Word_" (expect (parseField "12 " :: Parser Word) 12) , testCase "_Word_" (expect (parseField " 12 " :: Parser Word) 12) , testCase "_Double" (expect (parseField " 1.2e1" :: Parser Double) 12) , testCase "Double_" (expect (parseField "1.2e1 " :: Parser Double) 12) , testCase "_Double_" (expect (parseField " 1.2e1 " :: Parser Double) 12) ] ]
3,260
conversionTests = [ testGroup "roundTrip" [ testProperty "Char" (roundTrip :: Char -> Bool) , testProperty "ByteString" (roundTrip :: B.ByteString -> Bool) , testProperty "Int" (roundTrip :: Int -> Bool) , testProperty "Integer" (roundTrip :: Integer -> Bool) , testProperty "Int8" (roundTrip :: Int8 -> Bool) , testProperty "Int16" (roundTrip :: Int16 -> Bool) , testProperty "Int32" (roundTrip :: Int32 -> Bool) , testProperty "Int64" (roundTrip :: Int64 -> Bool) , testProperty "Word" (roundTrip :: Word -> Bool) , testProperty "Word8" (roundTrip :: Word8 -> Bool) , testProperty "Word16" (roundTrip :: Word16 -> Bool) , testProperty "Word32" (roundTrip :: Word32 -> Bool) , testProperty "Word64" (roundTrip :: Word64 -> Bool) , testProperty "lazy ByteString" (roundTrip :: BL.ByteString -> Bool) , testProperty "Text" (roundTrip :: T.Text -> Bool) , testProperty "lazy Text" (roundTrip :: LT.Text -> Bool) ] , testGroup "boundary" [ testProperty "Int" (boundary (undefined :: Int)) , testProperty "Int8" (boundary (undefined :: Int8)) , testProperty "Int16" (boundary (undefined :: Int16)) , testProperty "Int32" (boundary (undefined :: Int32)) , testProperty "Int64" (boundary (undefined :: Int64)) , testProperty "Word" (boundary (undefined :: Word)) , testProperty "Word8" (boundary (undefined :: Word8)) , testProperty "Word16" (boundary (undefined :: Word16)) , testProperty "Word32" (boundary (undefined :: Word32)) , testProperty "Word64" (boundary (undefined :: Word64)) ] , testGroup "Unicode" [ testCase "Chinese" (roundTripUnicode "我能吞下玻璃而不伤身体。") , testCase "Icelandic" (roundTripUnicode "Sævör grét áðan því úlpan var ónýt.") , testCase "Turkish" (roundTripUnicode "Cam yiyebilirim, bana zararı dokunmaz.") ] , testGroup "Partial Decodes" [ testCase "Int" (partialDecode (parseField "12.7" :: Parser Int)) , testCase "Word" (partialDecode (parseField "12.7" :: Parser Word)) , testCase "Double" (partialDecode (parseField "1.0+" :: Parser Double)) , testCase "Integer" (partialDecode (parseField "1e6" :: Parser Integer)) ] , testGroup "Space trimming" [ testCase "_Int" (expect (parseField " 12" :: Parser Int) 12) , testCase "Int_" (expect (parseField "12 " :: Parser Int) 12) , testCase "_Int_" (expect (parseField " 12 " :: Parser Int) 12) , testCase "_Word" (expect (parseField " 12" :: Parser Word) 12) , testCase "Word_" (expect (parseField "12 " :: Parser Word) 12) , testCase "_Word_" (expect (parseField " 12 " :: Parser Word) 12) , testCase "_Double" (expect (parseField " 1.2e1" :: Parser Double) 12) , testCase "Double_" (expect (parseField "1.2e1 " :: Parser Double) 12) , testCase "_Double_" (expect (parseField " 1.2e1 " :: Parser Double) 12) ] ]
3,231
false
true
0
13
943
957
503
454
null
null
DanielSchuessler/hstri
scratch-prns.hs
gpl-3.0
ba = mkBlenderable normalSurfaceStyle pr_ `disjointUnion` pr_tr
74
ba = mkBlenderable normalSurfaceStyle pr_ `disjointUnion` pr_tr
74
ba = mkBlenderable normalSurfaceStyle pr_ `disjointUnion` pr_tr
74
false
false
1
5
17
24
10
14
null
null
abailly/hs-word2vec
src/Crawl.hs
bsd-3-clause
nextPages :: ([ String ], (Maybe String,Maybe String)) -> IO [ String ] nextPages (uris, (_, Nothing)) = return uris
116
nextPages :: ([ String ], (Maybe String,Maybe String)) -> IO [ String ] nextPages (uris, (_, Nothing)) = return uris
116
nextPages (uris, (_, Nothing)) = return uris
44
false
true
2
7
19
62
33
29
null
null
siddhanathan/yi
yi-core/src/Yi/Buffer/Implementation.hs
gpl-2.0
-------------------------------------------------- -- Low-level primitives. -- | New FBuffer filled from string. newBI :: YiString -> BufferImpl () newBI s = FBufferData s M.empty M.empty dummyHlState Set.empty 0
213
newBI :: YiString -> BufferImpl () newBI s = FBufferData s M.empty M.empty dummyHlState Set.empty 0
99
newBI s = FBufferData s M.empty M.empty dummyHlState Set.empty 0
64
true
true
0
7
27
48
24
24
null
null
hackern/halfs
Halfs/Inode.hs
bsd-3-clause
-- | Size of a minimal inode structure when serialized, in bytes. This will -- vary based on the space required for type t when serialized. Note that -- minimal inode structure always contains minInodeBlocks InodeRefs in -- its blocks region. -- -- You can check this value interactively in ghci by doing, e.g. -- computeMinimalInodeSize =<< (getTime :: IO UTCTime) computeMinimalInodeSize :: (Monad m, Ord t, Serialize t, Show t) => t -> m Word64 computeMinimalInodeSize t = do return $ fromIntegral $ BS.length $ encode $ let e = emptyInode minInodeBlocks t RegularFile (FileMode [] [] []) nilIR nilIR rootUser rootGroup c = inoExt e in e{ inoExt = c{ blockAddrs = replicate (safeToInt minInodeBlocks) 0 } } -- | The size of a minimal Ext structure when serialized, in bytes.
848
computeMinimalInodeSize :: (Monad m, Ord t, Serialize t, Show t) => t -> m Word64 computeMinimalInodeSize t = do return $ fromIntegral $ BS.length $ encode $ let e = emptyInode minInodeBlocks t RegularFile (FileMode [] [] []) nilIR nilIR rootUser rootGroup c = inoExt e in e{ inoExt = c{ blockAddrs = replicate (safeToInt minInodeBlocks) 0 } } -- | The size of a minimal Ext structure when serialized, in bytes.
480
computeMinimalInodeSize t = do return $ fromIntegral $ BS.length $ encode $ let e = emptyInode minInodeBlocks t RegularFile (FileMode [] [] []) nilIR nilIR rootUser rootGroup c = inoExt e in e{ inoExt = c{ blockAddrs = replicate (safeToInt minInodeBlocks) 0 } } -- | The size of a minimal Ext structure when serialized, in bytes.
371
true
true
0
16
203
156
82
74
null
null
elieux/ghc
compiler/deSugar/DsBinds.hs
bsd-3-clause
dsHsWrapper (WpTyApp ty) e = return $ App e (Type ty)
58
dsHsWrapper (WpTyApp ty) e = return $ App e (Type ty)
58
dsHsWrapper (WpTyApp ty) e = return $ App e (Type ty)
58
false
false
1
8
15
35
15
20
null
null
tjakway/ghcjvm
compiler/basicTypes/RdrName.hs
bsd-3-clause
pprNameProvenance :: GlobalRdrElt -> SDoc -- ^ Print out one place where the name was define/imported -- (With -dppr-debug, print them all) pprNameProvenance (GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | opt_PprStyle_Debug = vcat pp_provs | otherwise = head pp_provs where pp_provs = pp_lcl ++ map pp_is iss pp_lcl = if lcl then [text "defined at" <+> ppr (nameSrcLoc name)] else [] pp_is is = sep [ppr is, ppr_defn_site is name] -- If we know the exact definition point (which we may do with GHCi) -- then show that too. But not if it's just "imported from X".
622
pprNameProvenance :: GlobalRdrElt -> SDoc pprNameProvenance (GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | opt_PprStyle_Debug = vcat pp_provs | otherwise = head pp_provs where pp_provs = pp_lcl ++ map pp_is iss pp_lcl = if lcl then [text "defined at" <+> ppr (nameSrcLoc name)] else [] pp_is is = sep [ppr is, ppr_defn_site is name] -- If we know the exact definition point (which we may do with GHCi) -- then show that too. But not if it's just "imported from X".
524
pprNameProvenance (GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss }) | opt_PprStyle_Debug = vcat pp_provs | otherwise = head pp_provs where pp_provs = pp_lcl ++ map pp_is iss pp_lcl = if lcl then [text "defined at" <+> ppr (nameSrcLoc name)] else [] pp_is is = sep [ppr is, ppr_defn_site is name] -- If we know the exact definition point (which we may do with GHCi) -- then show that too. But not if it's just "imported from X".
482
true
true
13
10
151
163
76
87
null
null
haskell-opengl/OpenGLRaw
src/Graphics/GL/ExtensionPredicates.hs
bsd-3-clause
-- | Is the <https://www.opengl.org/registry/specs/NV/path_rendering_shared_edge.txt NV_path_rendering_shared_edge> extension supported? -- Note that in the presence of multiple contexts with different capabilities, -- this might be wrong. Use 'glGetNVPathRenderingSharedEdge' in those cases instead. gl_NV_path_rendering_shared_edge :: Bool gl_NV_path_rendering_shared_edge = member "GL_NV_path_rendering_shared_edge" extensions
429
gl_NV_path_rendering_shared_edge :: Bool gl_NV_path_rendering_shared_edge = member "GL_NV_path_rendering_shared_edge" extensions
128
gl_NV_path_rendering_shared_edge = member "GL_NV_path_rendering_shared_edge" extensions
87
true
true
0
5
38
19
11
8
null
null
akhileshs/stack
src/test/Stack/BuildPlanSpec.hs
bsd-3-clause
teardown :: T -> IO () teardown _ = return ()
45
teardown :: T -> IO () teardown _ = return ()
45
teardown _ = return ()
22
false
true
0
7
10
28
13
15
null
null
hguenther/smtlib2
extras/composite/Language/SMTLib2/Composite/Array.hs
gpl-3.0
elementDescr :: Composite c => CompArray idx c Repr -> c Repr elementDescr (CompArray _ arr) = runIdentity $ mapExprs (\(Arrayed (ArrayRepr _ tp)) -> return tp) arr
164
elementDescr :: Composite c => CompArray idx c Repr -> c Repr elementDescr (CompArray _ arr) = runIdentity $ mapExprs (\(Arrayed (ArrayRepr _ tp)) -> return tp) arr
164
elementDescr (CompArray _ arr) = runIdentity $ mapExprs (\(Arrayed (ArrayRepr _ tp)) -> return tp) arr
102
false
true
0
12
27
77
37
40
null
null
michaeljklein/CPlug
bench/Bench/Parse/Templates.hs
bsd-3-clause
cTypeRep "signed" = typeOf (undefined :: CInt)
62
cTypeRep "signed" = typeOf (undefined :: CInt)
62
cTypeRep "signed" = typeOf (undefined :: CInt)
62
false
false
0
6
22
19
9
10
null
null
jprider63/aeson-ios-0.8.0.2
tests/Encoders.hs
bsd-3-clause
gNullaryParseJSON2ElemArray :: Value -> Parser Nullary gNullaryParseJSON2ElemArray = genericParseJSON opts2ElemArray
116
gNullaryParseJSON2ElemArray :: Value -> Parser Nullary gNullaryParseJSON2ElemArray = genericParseJSON opts2ElemArray
116
gNullaryParseJSON2ElemArray = genericParseJSON opts2ElemArray
61
false
true
0
6
9
21
10
11
null
null
SKA-ScienceDataProcessor/RC
MS4/dna-programs/Kernel/GPU/ScatterGrid.hs
apache-2.0
phaseRotate :: GridPar -> Vis -> IO Vis phaseRotate _ vis = do let visibilities = vectorSize (visData vis) visData' <- toDeviceVector (visData vis) visPos' <- toDeviceVector (visPositions vis) CUDA.launchKernel scatter_grid_phaseRotate_kern (1,1,1) (min 1024 visibilities,1,1) 0 Nothing $ mapArgs visData' visPos' visibilities CUDA.sync return vis{visData = visData', visPositions=visPos'} -- | Do pregridding. This involves all transformations that we can do -- prior to getting to actual gridding. We especially pre-select the -- GCF here, taking oversampling into account.
598
phaseRotate :: GridPar -> Vis -> IO Vis phaseRotate _ vis = do let visibilities = vectorSize (visData vis) visData' <- toDeviceVector (visData vis) visPos' <- toDeviceVector (visPositions vis) CUDA.launchKernel scatter_grid_phaseRotate_kern (1,1,1) (min 1024 visibilities,1,1) 0 Nothing $ mapArgs visData' visPos' visibilities CUDA.sync return vis{visData = visData', visPositions=visPos'} -- | Do pregridding. This involves all transformations that we can do -- prior to getting to actual gridding. We especially pre-select the -- GCF here, taking oversampling into account.
598
phaseRotate _ vis = do let visibilities = vectorSize (visData vis) visData' <- toDeviceVector (visData vis) visPos' <- toDeviceVector (visPositions vis) CUDA.launchKernel scatter_grid_phaseRotate_kern (1,1,1) (min 1024 visibilities,1,1) 0 Nothing $ mapArgs visData' visPos' visibilities CUDA.sync return vis{visData = visData', visPositions=visPos'} -- | Do pregridding. This involves all transformations that we can do -- prior to getting to actual gridding. We especially pre-select the -- GCF here, taking oversampling into account.
558
false
true
0
13
100
160
78
82
null
null
luisnavarrodelangel/InnerEar
src/InnerEar/Exercises/MultipleChoice.hs
gpl-3.0
multipleChoiceExercise :: forall t m c q a e s. (MonadWidget t m, Show a, Eq a, Ord a, Data a, Data c, Ord c,Buttonable a) => Int -- maximum number of tries to allow -> [a] -> m () -> ConfigWidgetBuilder m t c a -> AnswerRenderer c a -> ExerciseId -> c -> (Dynamic t (Map a Score) -> Dynamic t (MultipleChoiceStore c a) -> m ()) -> (c -> [ExerciseDatum] -> IO ([a],a)) -> (Map c (Map a Score) -> (Int,Int)) -- function to calculate Xp from a map of performance over all configurations -> Exercise t m c [a] a (Map a Score) (MultipleChoiceStore c a) multipleChoiceExercise maxTries answers iWidget cWidget render i c de g calculateXp = Exercise { exerciseId = i, instructionsWidget = iWidget, defaultConfig = c, defaultEvaluation = empty, displayEvaluation = de, generateQuestion = g, questionWidget = multipleChoiceQuestionWidget maxTries answers i iWidget cWidget render de calculateXp }
927
multipleChoiceExercise :: forall t m c q a e s. (MonadWidget t m, Show a, Eq a, Ord a, Data a, Data c, Ord c,Buttonable a) => Int -- maximum number of tries to allow -> [a] -> m () -> ConfigWidgetBuilder m t c a -> AnswerRenderer c a -> ExerciseId -> c -> (Dynamic t (Map a Score) -> Dynamic t (MultipleChoiceStore c a) -> m ()) -> (c -> [ExerciseDatum] -> IO ([a],a)) -> (Map c (Map a Score) -> (Int,Int)) -- function to calculate Xp from a map of performance over all configurations -> Exercise t m c [a] a (Map a Score) (MultipleChoiceStore c a) multipleChoiceExercise maxTries answers iWidget cWidget render i c de g calculateXp = Exercise { exerciseId = i, instructionsWidget = iWidget, defaultConfig = c, defaultEvaluation = empty, displayEvaluation = de, generateQuestion = g, questionWidget = multipleChoiceQuestionWidget maxTries answers i iWidget cWidget render de calculateXp }
926
multipleChoiceExercise maxTries answers iWidget cWidget render i c de g calculateXp = Exercise { exerciseId = i, instructionsWidget = iWidget, defaultConfig = c, defaultEvaluation = empty, displayEvaluation = de, generateQuestion = g, questionWidget = multipleChoiceQuestionWidget maxTries answers i iWidget cWidget render de calculateXp }
355
false
true
0
22
192
350
187
163
null
null
antitypical/language-parser-mixfix
src/Language/Parser/MixFix.hs
bsd-3-clause
between :: Parser a -> [String] -> Parser [a] _ `between` [] = Pure []
70
between :: Parser a -> [String] -> Parser [a] _ `between` [] = Pure []
70
_ `between` [] = Pure []
24
false
true
0
8
14
46
23
23
null
null
cojoj/Codewars
Haskell/Codewars.hsproj/IsOpposite.hs
mit
isOpposite :: String -> String -> Bool isOpposite "" "" = False
63
isOpposite :: String -> String -> Bool isOpposite "" "" = False
63
isOpposite "" "" = False
24
false
true
0
6
11
24
12
12
null
null
kawamuray/ganeti
src/Ganeti/Constants.hs
gpl-2.0
-- * Crypto Types -- Types of cryptographic tokens used in node communication cryptoTypeSslDigest :: String cryptoTypeSslDigest = "ssl"
136
cryptoTypeSslDigest :: String cryptoTypeSslDigest = "ssl"
57
cryptoTypeSslDigest = "ssl"
27
true
true
0
4
19
13
8
5
null
null
acowley/ghc
compiler/prelude/PrelNames.hs
bsd-3-clause
-- Data constructor for parallel arrays parrDataConKey :: Unique parrDataConKey = mkPreludeDataConUnique 24
132
parrDataConKey :: Unique parrDataConKey = mkPreludeDataConUnique 24
92
parrDataConKey = mkPreludeDataConUnique 24
67
true
true
0
5
37
15
8
7
null
null
green-haskell/ghc
includes/CodeGen.Platform.hs
bsd-3-clause
callerSaves CurrentTSO = True
36
callerSaves CurrentTSO = True
36
callerSaves CurrentTSO = True
36
false
false
0
5
10
9
4
5
null
null
sgillespie/ghc
compiler/typecheck/TcPatSyn.hs
bsd-3-clause
collectPatSynArgInfo :: HsPatSynDetails (Located Name) -> ([Name], [Name], Bool) collectPatSynArgInfo details = case details of PrefixPatSyn names -> (map unLoc names, [], False) InfixPatSyn name1 name2 -> (map unLoc [name1, name2], [], True) RecordPatSyn names -> let (vars, sels) = unzip (map splitRecordPatSyn names) in (vars, sels, False) where splitRecordPatSyn :: RecordPatSynField (Located Name) -> (Name, Name) splitRecordPatSyn (RecordPatSynField { recordPatSynPatVar = L _ patVar , recordPatSynSelectorId = L _ selId }) = (patVar, selId)
636
collectPatSynArgInfo :: HsPatSynDetails (Located Name) -> ([Name], [Name], Bool) collectPatSynArgInfo details = case details of PrefixPatSyn names -> (map unLoc names, [], False) InfixPatSyn name1 name2 -> (map unLoc [name1, name2], [], True) RecordPatSyn names -> let (vars, sels) = unzip (map splitRecordPatSyn names) in (vars, sels, False) where splitRecordPatSyn :: RecordPatSynField (Located Name) -> (Name, Name) splitRecordPatSyn (RecordPatSynField { recordPatSynPatVar = L _ patVar , recordPatSynSelectorId = L _ selId }) = (patVar, selId)
636
collectPatSynArgInfo details = case details of PrefixPatSyn names -> (map unLoc names, [], False) InfixPatSyn name1 name2 -> (map unLoc [name1, name2], [], True) RecordPatSyn names -> let (vars, sels) = unzip (map splitRecordPatSyn names) in (vars, sels, False) where splitRecordPatSyn :: RecordPatSynField (Located Name) -> (Name, Name) splitRecordPatSyn (RecordPatSynField { recordPatSynPatVar = L _ patVar , recordPatSynSelectorId = L _ selId }) = (patVar, selId)
555
false
true
13
10
163
223
117
106
null
null
yuvallanger/threepenny-gui
src/Graphics/UI/Threepenny/Core.hs
bsd-3-clause
{----------------------------------------------------------------------------- Browser window ------------------------------------------------------------------------------} -- | Title of the client window. title :: WriteAttr Window String title = mkWriteAttr $ \s _ -> runFunction $ ffi "document.title = %1;" s
320
title :: WriteAttr Window String title = mkWriteAttr $ \s _ -> runFunction $ ffi "document.title = %1;" s
109
title = mkWriteAttr $ \s _ -> runFunction $ ffi "document.title = %1;" s
76
true
true
0
8
37
38
20
18
null
null
brendanhay/gogol
gogol-compute/gen/Network/Google/Resource/Compute/ResourcePolicies/GetIAMPolicy.hs
mpl-2.0
-- | The name of the region for this request. rpgipRegion :: Lens' ResourcePoliciesGetIAMPolicy Text rpgipRegion = lens _rpgipRegion (\ s a -> s{_rpgipRegion = a})
165
rpgipRegion :: Lens' ResourcePoliciesGetIAMPolicy Text rpgipRegion = lens _rpgipRegion (\ s a -> s{_rpgipRegion = a})
119
rpgipRegion = lens _rpgipRegion (\ s a -> s{_rpgipRegion = a})
64
true
true
1
9
27
46
22
24
null
null
cdxr/haskell-interface
module-diff/Html.hs
bsd-3-clause
renderModuleDiffPage :: ModuleTarget -> ModuleTarget -> ModuleDiff -> HtmlT Program () renderModuleDiffPage t0 t1 mdiff = simplePage title $ do ol_ $ do li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t0 li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t1 renderModuleDiff mdiff where Change name0 name1 = moduleName <$> toChange mdiff title | name0 == name1 = name1 ++ " (version comparison)" | otherwise = name0 ++ " / " ++ name1 ++ " (module comparison)"
551
renderModuleDiffPage :: ModuleTarget -> ModuleTarget -> ModuleDiff -> HtmlT Program () renderModuleDiffPage t0 t1 mdiff = simplePage title $ do ol_ $ do li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t0 li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t1 renderModuleDiff mdiff where Change name0 name1 = moduleName <$> toChange mdiff title | name0 == name1 = name1 ++ " (version comparison)" | otherwise = name0 ++ " / " ++ name1 ++ " (module comparison)"
551
renderModuleDiffPage t0 t1 mdiff = simplePage title $ do ol_ $ do li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t0 li_ [ class_ "module-source" ] $ toHtml $ moduleTargetString t1 renderModuleDiff mdiff where Change name0 name1 = moduleName <$> toChange mdiff title | name0 == name1 = name1 ++ " (version comparison)" | otherwise = name0 ++ " / " ++ name1 ++ " (module comparison)"
460
false
true
5
14
147
179
77
102
null
null
dmcclean/HaTeX
Text/LaTeX/Base/Commands.hs
bsd-3-clause
-- | Right-justify the argument. flushright :: LaTeXC l => l -> l flushright = liftL $ TeXEnv "flushright" []
109
flushright :: LaTeXC l => l -> l flushright = liftL $ TeXEnv "flushright" []
76
flushright = liftL $ TeXEnv "flushright" []
43
true
true
0
7
19
34
17
17
null
null
YoshikuniJujo/funpaala
samples/14_list_as_arg/listAsArg.hs
bsd-3-clause
mySum :: [Integer] -> Integer mySum [] = 0
42
mySum :: [Integer] -> Integer mySum [] = 0
42
mySum [] = 0
12
false
true
0
8
8
29
13
16
null
null
brendanhay/gogol
gogol-serviceusage/gen/Network/Google/ServiceUsage/Types/Product.hs
mpl-2.0
-- | The path-qualified name of the .proto file that contained the associated -- protobuf element. For example: -- \`\"google\/protobuf\/source_context.proto\"\`. scFileName :: Lens' SourceContext (Maybe Text) scFileName = lens _scFileName (\ s a -> s{_scFileName = a})
271
scFileName :: Lens' SourceContext (Maybe Text) scFileName = lens _scFileName (\ s a -> s{_scFileName = a})
108
scFileName = lens _scFileName (\ s a -> s{_scFileName = a})
61
true
true
0
9
38
50
27
23
null
null
quivade/screwdriver
test/Test/Language/FIRRTL/Syntax/Expr.hs
gpl-3.0
ref :: TypedExpr ref = annotate Nothing (Ref "bundle")
54
ref :: TypedExpr ref = annotate Nothing (Ref "bundle")
54
ref = annotate Nothing (Ref "bundle")
37
false
true
0
7
8
29
12
17
null
null
JohnLato/jaek
src/Jaek/UI/Focus.hs
lgpl-3.0
goToFocus :: TreeZip -> Focus -> TreeZip goToFocus tz foc = fromMaybe (goToHead tz) $ foc >>= \fc -> goToRef (AbsPath fc) tz
145
goToFocus :: TreeZip -> Focus -> TreeZip goToFocus tz foc = fromMaybe (goToHead tz) $ foc >>= \fc -> goToRef (AbsPath fc) tz
145
goToFocus tz foc = fromMaybe (goToHead tz) $ foc >>= \fc -> goToRef (AbsPath fc) tz
104
false
true
0
9
43
57
28
29
null
null
yiannist/ganeti
src/Ganeti/HTools/Node.hs
bsd-2-clause
setSec :: Node -> Instance.Instance -> Node setSec t inst -- Real instance, update real fields and forthcoming fields. | not (Instance.forthcoming inst) = updateForthcomingFields $ t { sList = Instance.idx inst:sList t , utilLoad = old_load { T.dskWeight = T.dskWeight old_load + T.dskWeight (Instance.util inst) } , instSpindles = calcSpindleUse True t inst } -- Forthcoming instance, update forthcoming fields only. | otherwise = updateForthcomingOnlyFields $ updateForthcomingFields t where old_load = utilLoad t uses_disk = Instance.usesLocalStorage inst -- Updates the *Forth fields that include real and forthcoming instances. updateForthcomingFields node = let old_load_forth = utilLoadForth node in node { sListForth = Instance.idx inst:sListForth node , utilLoadForth = old_load_forth { T.dskWeight = T.dskWeight old_load_forth + T.dskWeight (Instance.util inst) } -- TODO Should this be in updateForthcomingOnlyFields? , instSpindlesForth = calcSpindleUseForth True node inst -- TODO Set failN1Forth, rMemForth, pRemForth and peersForth } updateForthcomingOnlyFields node = let new_fDskForth = decIf uses_disk (fDskForth node) (Instance.dsk inst) new_free_sp_forth = calcNewFreeSpindlesForth True node inst new_pDskForth = computeNewPDsk node new_free_sp_forth new_fDskForth in node { fDskForth = new_fDskForth , pDskForth = new_pDskForth , fSpindlesForth = new_free_sp_forth } -- | Computes the new 'pDsk' value, handling nodes without local disk -- storage (we consider all their disk unused).
1,950
setSec :: Node -> Instance.Instance -> Node setSec t inst -- Real instance, update real fields and forthcoming fields. | not (Instance.forthcoming inst) = updateForthcomingFields $ t { sList = Instance.idx inst:sList t , utilLoad = old_load { T.dskWeight = T.dskWeight old_load + T.dskWeight (Instance.util inst) } , instSpindles = calcSpindleUse True t inst } -- Forthcoming instance, update forthcoming fields only. | otherwise = updateForthcomingOnlyFields $ updateForthcomingFields t where old_load = utilLoad t uses_disk = Instance.usesLocalStorage inst -- Updates the *Forth fields that include real and forthcoming instances. updateForthcomingFields node = let old_load_forth = utilLoadForth node in node { sListForth = Instance.idx inst:sListForth node , utilLoadForth = old_load_forth { T.dskWeight = T.dskWeight old_load_forth + T.dskWeight (Instance.util inst) } -- TODO Should this be in updateForthcomingOnlyFields? , instSpindlesForth = calcSpindleUseForth True node inst -- TODO Set failN1Forth, rMemForth, pRemForth and peersForth } updateForthcomingOnlyFields node = let new_fDskForth = decIf uses_disk (fDskForth node) (Instance.dsk inst) new_free_sp_forth = calcNewFreeSpindlesForth True node inst new_pDskForth = computeNewPDsk node new_free_sp_forth new_fDskForth in node { fDskForth = new_fDskForth , pDskForth = new_pDskForth , fSpindlesForth = new_free_sp_forth } -- | Computes the new 'pDsk' value, handling nodes without local disk -- storage (we consider all their disk unused).
1,950
setSec t inst -- Real instance, update real fields and forthcoming fields. | not (Instance.forthcoming inst) = updateForthcomingFields $ t { sList = Instance.idx inst:sList t , utilLoad = old_load { T.dskWeight = T.dskWeight old_load + T.dskWeight (Instance.util inst) } , instSpindles = calcSpindleUse True t inst } -- Forthcoming instance, update forthcoming fields only. | otherwise = updateForthcomingOnlyFields $ updateForthcomingFields t where old_load = utilLoad t uses_disk = Instance.usesLocalStorage inst -- Updates the *Forth fields that include real and forthcoming instances. updateForthcomingFields node = let old_load_forth = utilLoadForth node in node { sListForth = Instance.idx inst:sListForth node , utilLoadForth = old_load_forth { T.dskWeight = T.dskWeight old_load_forth + T.dskWeight (Instance.util inst) } -- TODO Should this be in updateForthcomingOnlyFields? , instSpindlesForth = calcSpindleUseForth True node inst -- TODO Set failN1Forth, rMemForth, pRemForth and peersForth } updateForthcomingOnlyFields node = let new_fDskForth = decIf uses_disk (fDskForth node) (Instance.dsk inst) new_free_sp_forth = calcNewFreeSpindlesForth True node inst new_pDskForth = computeNewPDsk node new_free_sp_forth new_fDskForth in node { fDskForth = new_fDskForth , pDskForth = new_pDskForth , fSpindlesForth = new_free_sp_forth } -- | Computes the new 'pDsk' value, handling nodes without local disk -- storage (we consider all their disk unused).
1,906
false
true
1
15
645
338
174
164
null
null
mariefarrell/Hets
Maude/Maude2DG.hs
gpl-2.0
-- | builds the development graph of the specified Maude file directMaudeParsing :: HetcatsOpts -> FilePath -> IO (DGraph, DGraph) directMaudeParsing opts fp = do putIfVerbose opts 2 $ "Reading file " ++ fp ns <- parse fp let ns' = either (const []) id ns (inString, hIn, hOut, hErr, procH) <- runMaude exitCode <- getProcessExitCode procH case exitCode of Nothing -> do maudePutStrLn hIn $ "load " ++ fp maudePutStrLn hIn inString psps <- predefinedSpecs opts hIn hOut sps <- traverseSpecs opts hIn hOut ns' (ok, errs) <- getErrors hErr terminateProcess procH if ok then return $ maude2DG psps sps else error errs Just ExitSuccess -> error "maude terminated immediately" Just (ExitFailure i) -> error $ "calling maude failed with exitCode: " ++ show i
938
directMaudeParsing :: HetcatsOpts -> FilePath -> IO (DGraph, DGraph) directMaudeParsing opts fp = do putIfVerbose opts 2 $ "Reading file " ++ fp ns <- parse fp let ns' = either (const []) id ns (inString, hIn, hOut, hErr, procH) <- runMaude exitCode <- getProcessExitCode procH case exitCode of Nothing -> do maudePutStrLn hIn $ "load " ++ fp maudePutStrLn hIn inString psps <- predefinedSpecs opts hIn hOut sps <- traverseSpecs opts hIn hOut ns' (ok, errs) <- getErrors hErr terminateProcess procH if ok then return $ maude2DG psps sps else error errs Just ExitSuccess -> error "maude terminated immediately" Just (ExitFailure i) -> error $ "calling maude failed with exitCode: " ++ show i
876
directMaudeParsing opts fp = do putIfVerbose opts 2 $ "Reading file " ++ fp ns <- parse fp let ns' = either (const []) id ns (inString, hIn, hOut, hErr, procH) <- runMaude exitCode <- getProcessExitCode procH case exitCode of Nothing -> do maudePutStrLn hIn $ "load " ++ fp maudePutStrLn hIn inString psps <- predefinedSpecs opts hIn hOut sps <- traverseSpecs opts hIn hOut ns' (ok, errs) <- getErrors hErr terminateProcess procH if ok then return $ maude2DG psps sps else error errs Just ExitSuccess -> error "maude terminated immediately" Just (ExitFailure i) -> error $ "calling maude failed with exitCode: " ++ show i
807
true
true
0
14
311
264
123
141
null
null
kRITZCREEK/psc-ide
server/Main.hs
mit
handleCommand (Pursuit query Package) = findPursuitPackages query
69
handleCommand (Pursuit query Package) = findPursuitPackages query
69
handleCommand (Pursuit query Package) = findPursuitPackages query
69
false
false
0
7
10
20
9
11
null
null
deadfoxygrandpa/Elm
compiler/SourceSyntax/Helpers.hs
bsd-3-clause
isTuple :: String -> Bool isTuple name = take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
102
isTuple :: String -> Bool isTuple name = take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
102
isTuple name = take 6 name == "_Tuple" && all Char.isDigit (drop 6 name)
76
false
true
3
7
22
41
19
22
null
null
proger/haskell-dstm
Chat/ChatClient.hs
bsd-3-clause
main :: IO () main = startDist $ do putStrLn "Your Name: " name <- getLine serverTVar <- lookupTVar "localhost" "Chat" case serverTVar of Nothing -> putStrLn "Chatserver not reachable" Just cmdTVar -> do myTVar <- atomic $ do new <- newTVar Nothing writeTVar cmdTVar (Just (Join name new)) return new forkIO (serverClient myTVar) stdinClient name cmdTVar
413
main :: IO () main = startDist $ do putStrLn "Your Name: " name <- getLine serverTVar <- lookupTVar "localhost" "Chat" case serverTVar of Nothing -> putStrLn "Chatserver not reachable" Just cmdTVar -> do myTVar <- atomic $ do new <- newTVar Nothing writeTVar cmdTVar (Just (Join name new)) return new forkIO (serverClient myTVar) stdinClient name cmdTVar
413
main = startDist $ do putStrLn "Your Name: " name <- getLine serverTVar <- lookupTVar "localhost" "Chat" case serverTVar of Nothing -> putStrLn "Chatserver not reachable" Just cmdTVar -> do myTVar <- atomic $ do new <- newTVar Nothing writeTVar cmdTVar (Just (Join name new)) return new forkIO (serverClient myTVar) stdinClient name cmdTVar
399
false
true
0
21
115
139
60
79
null
null
jml/graphql-api
src/GraphQL/Internal/Syntax/Parser.hs
bsd-3-clause
defaultValue :: Parser AST.DefaultValue defaultValue = tok "=" *> value
71
defaultValue :: Parser AST.DefaultValue defaultValue = tok "=" *> value
71
defaultValue = tok "=" *> value
31
false
true
2
7
9
31
13
18
null
null
mfine/ghc
compiler/main/DriverPhases.hs
bsd-3-clause
startPhase "m" = Cobjc
29
startPhase "m" = Cobjc
29
startPhase "m" = Cobjc
29
false
false
0
5
10
9
4
5
null
null
vdweegen/UvA-Software_Testing
Lab3/Final/Exercises.hs
gpl-3.0
uniqueMap :: Eq a => (a1 -> a) -> [a1] -> [a] uniqueMap f xs = ys where ys = nub $ map f xs -- | Exercise 4 ====================================================================== | == -- Time spent: 1 hour on arbitrary and generators -- 1 hour on the properties -- | Generates random formulas, base case is a Prop, we recursively call genForm with a smaller n, -- We could use a different function to shrink n or use a different value for the multipleNextForm -- which doesn't depend on n, however the mod takes care of that now -- | In order to check the correctness, we apply similar steps as the tests in Exercise 3, -- but now using random forms. Therefore, the property does not test if the physical implementation differs. -- In theory, the random function generator could generate something which complies to the CNF -- | Limited to maximum 5 due to computational constraints
918
uniqueMap :: Eq a => (a1 -> a) -> [a1] -> [a] uniqueMap f xs = ys where ys = nub $ map f xs -- | Exercise 4 ====================================================================== | == -- Time spent: 1 hour on arbitrary and generators -- 1 hour on the properties -- | Generates random formulas, base case is a Prop, we recursively call genForm with a smaller n, -- We could use a different function to shrink n or use a different value for the multipleNextForm -- which doesn't depend on n, however the mod takes care of that now -- | In order to check the correctness, we apply similar steps as the tests in Exercise 3, -- but now using random forms. Therefore, the property does not test if the physical implementation differs. -- In theory, the random function generator could generate something which complies to the CNF -- | Limited to maximum 5 due to computational constraints
918
uniqueMap f xs = ys where ys = nub $ map f xs -- | Exercise 4 ====================================================================== | == -- Time spent: 1 hour on arbitrary and generators -- 1 hour on the properties -- | Generates random formulas, base case is a Prop, we recursively call genForm with a smaller n, -- We could use a different function to shrink n or use a different value for the multipleNextForm -- which doesn't depend on n, however the mod takes care of that now -- | In order to check the correctness, we apply similar steps as the tests in Exercise 3, -- but now using random forms. Therefore, the property does not test if the physical implementation differs. -- In theory, the random function generator could generate something which complies to the CNF -- | Limited to maximum 5 due to computational constraints
872
false
true
0
8
192
75
42
33
null
null
daleooo/barrelfish
tools/flounder/GHBackend.hs
mit
-- -- Generate the binding structure -- binding_struct :: String -> [MessageDef] -> C.Unit binding_struct n ml = C.StructDecl (intf_bind_type n) fields where fields = [ C.ParamComment "Arbitrary user state pointer", C.Param (C.Ptr C.Void) "st", C.ParamBlank, C.ParamComment "Waitset used for receive handlers and send continuations", C.Param (C.Ptr $ C.Struct "waitset") "waitset", C.ParamBlank, C.ParamComment "Mutex for the use of user code.", C.ParamComment "Must be held before any operation where there is a possibility of", C.ParamComment "concurrent access to the same binding (eg. multiple threads, or", C.ParamComment "asynchronous event handlers that use the same binding object).", C.Param (C.Struct "event_mutex") "mutex", C.ParamBlank, C.ParamComment "returns true iff a message could currently be accepted by the binding", C.Param (C.Ptr $ C.TypeName $ can_send_fn_type n) "can_send", C.ParamBlank, C.ParamComment "register an event for when a message is likely to be able to be sent", C.Param (C.Ptr $ C.TypeName $ register_send_fn_type n) "register_send", C.ParamBlank, C.ParamComment "change the waitset used by a binding", C.Param (C.Ptr $ C.TypeName $ change_waitset_fn_type n) "change_waitset", C.ParamBlank, C.ParamComment "perform control operations", C.Param (C.Ptr $ C.TypeName $ control_fn_type n) "control", C.ParamBlank, C.ParamComment "error handler for any async errors associated with this binding", C.ParamComment "must be filled-in by user", C.Param (C.Ptr $ C.TypeName $ error_handler_fn_type n) "error_handler", C.ParamBlank, C.ParamComment "Message send functions (filled in by binding)", C.Param (C.Struct $ intf_vtbl_type n TX) "tx_vtbl", C.ParamBlank, C.ParamComment "Incoming message handlers (filled in by user)", C.Param (C.Struct $ intf_vtbl_type n RX) "rx_vtbl", C.ParamBlank, C.ParamComment "Private state belonging to the binding implementation", C.Param (C.Union $ binding_arg_union_type n) "tx_union", C.Param (C.Union $ binding_arg_union_type n) "rx_union", C.Param (C.Struct "waitset_chanstate") "register_chanstate", C.Param (C.Struct "waitset_chanstate") "tx_cont_chanstate", C.Param (C.Enum $ msg_enum_name n) "tx_msgnum", C.Param (C.Enum $ msg_enum_name n) "rx_msgnum", C.Param (C.TypeName "int") "tx_msg_fragment", C.Param (C.TypeName "int") "rx_msg_fragment", C.Param (C.TypeName "size_t") "tx_str_pos", C.Param (C.TypeName "size_t") "rx_str_pos", C.Param (C.TypeName "size_t") "tx_str_len", C.Param (C.TypeName "size_t") "rx_str_len", C.Param (C.Struct "event_queue_node") "event_qnode", C.Param (C.Ptr $ C.TypeName $ intf_bind_cont_type n) "bind_cont"] -- -- Generate prototypes for export. --
3,060
binding_struct :: String -> [MessageDef] -> C.Unit binding_struct n ml = C.StructDecl (intf_bind_type n) fields where fields = [ C.ParamComment "Arbitrary user state pointer", C.Param (C.Ptr C.Void) "st", C.ParamBlank, C.ParamComment "Waitset used for receive handlers and send continuations", C.Param (C.Ptr $ C.Struct "waitset") "waitset", C.ParamBlank, C.ParamComment "Mutex for the use of user code.", C.ParamComment "Must be held before any operation where there is a possibility of", C.ParamComment "concurrent access to the same binding (eg. multiple threads, or", C.ParamComment "asynchronous event handlers that use the same binding object).", C.Param (C.Struct "event_mutex") "mutex", C.ParamBlank, C.ParamComment "returns true iff a message could currently be accepted by the binding", C.Param (C.Ptr $ C.TypeName $ can_send_fn_type n) "can_send", C.ParamBlank, C.ParamComment "register an event for when a message is likely to be able to be sent", C.Param (C.Ptr $ C.TypeName $ register_send_fn_type n) "register_send", C.ParamBlank, C.ParamComment "change the waitset used by a binding", C.Param (C.Ptr $ C.TypeName $ change_waitset_fn_type n) "change_waitset", C.ParamBlank, C.ParamComment "perform control operations", C.Param (C.Ptr $ C.TypeName $ control_fn_type n) "control", C.ParamBlank, C.ParamComment "error handler for any async errors associated with this binding", C.ParamComment "must be filled-in by user", C.Param (C.Ptr $ C.TypeName $ error_handler_fn_type n) "error_handler", C.ParamBlank, C.ParamComment "Message send functions (filled in by binding)", C.Param (C.Struct $ intf_vtbl_type n TX) "tx_vtbl", C.ParamBlank, C.ParamComment "Incoming message handlers (filled in by user)", C.Param (C.Struct $ intf_vtbl_type n RX) "rx_vtbl", C.ParamBlank, C.ParamComment "Private state belonging to the binding implementation", C.Param (C.Union $ binding_arg_union_type n) "tx_union", C.Param (C.Union $ binding_arg_union_type n) "rx_union", C.Param (C.Struct "waitset_chanstate") "register_chanstate", C.Param (C.Struct "waitset_chanstate") "tx_cont_chanstate", C.Param (C.Enum $ msg_enum_name n) "tx_msgnum", C.Param (C.Enum $ msg_enum_name n) "rx_msgnum", C.Param (C.TypeName "int") "tx_msg_fragment", C.Param (C.TypeName "int") "rx_msg_fragment", C.Param (C.TypeName "size_t") "tx_str_pos", C.Param (C.TypeName "size_t") "rx_str_pos", C.Param (C.TypeName "size_t") "tx_str_len", C.Param (C.TypeName "size_t") "rx_str_len", C.Param (C.Struct "event_queue_node") "event_qnode", C.Param (C.Ptr $ C.TypeName $ intf_bind_cont_type n) "bind_cont"] -- -- Generate prototypes for export. --
3,020
binding_struct n ml = C.StructDecl (intf_bind_type n) fields where fields = [ C.ParamComment "Arbitrary user state pointer", C.Param (C.Ptr C.Void) "st", C.ParamBlank, C.ParamComment "Waitset used for receive handlers and send continuations", C.Param (C.Ptr $ C.Struct "waitset") "waitset", C.ParamBlank, C.ParamComment "Mutex for the use of user code.", C.ParamComment "Must be held before any operation where there is a possibility of", C.ParamComment "concurrent access to the same binding (eg. multiple threads, or", C.ParamComment "asynchronous event handlers that use the same binding object).", C.Param (C.Struct "event_mutex") "mutex", C.ParamBlank, C.ParamComment "returns true iff a message could currently be accepted by the binding", C.Param (C.Ptr $ C.TypeName $ can_send_fn_type n) "can_send", C.ParamBlank, C.ParamComment "register an event for when a message is likely to be able to be sent", C.Param (C.Ptr $ C.TypeName $ register_send_fn_type n) "register_send", C.ParamBlank, C.ParamComment "change the waitset used by a binding", C.Param (C.Ptr $ C.TypeName $ change_waitset_fn_type n) "change_waitset", C.ParamBlank, C.ParamComment "perform control operations", C.Param (C.Ptr $ C.TypeName $ control_fn_type n) "control", C.ParamBlank, C.ParamComment "error handler for any async errors associated with this binding", C.ParamComment "must be filled-in by user", C.Param (C.Ptr $ C.TypeName $ error_handler_fn_type n) "error_handler", C.ParamBlank, C.ParamComment "Message send functions (filled in by binding)", C.Param (C.Struct $ intf_vtbl_type n TX) "tx_vtbl", C.ParamBlank, C.ParamComment "Incoming message handlers (filled in by user)", C.Param (C.Struct $ intf_vtbl_type n RX) "rx_vtbl", C.ParamBlank, C.ParamComment "Private state belonging to the binding implementation", C.Param (C.Union $ binding_arg_union_type n) "tx_union", C.Param (C.Union $ binding_arg_union_type n) "rx_union", C.Param (C.Struct "waitset_chanstate") "register_chanstate", C.Param (C.Struct "waitset_chanstate") "tx_cont_chanstate", C.Param (C.Enum $ msg_enum_name n) "tx_msgnum", C.Param (C.Enum $ msg_enum_name n) "rx_msgnum", C.Param (C.TypeName "int") "tx_msg_fragment", C.Param (C.TypeName "int") "rx_msg_fragment", C.Param (C.TypeName "size_t") "tx_str_pos", C.Param (C.TypeName "size_t") "rx_str_pos", C.Param (C.TypeName "size_t") "tx_str_len", C.Param (C.TypeName "size_t") "rx_str_len", C.Param (C.Struct "event_queue_node") "event_qnode", C.Param (C.Ptr $ C.TypeName $ intf_bind_cont_type n) "bind_cont"] -- -- Generate prototypes for export. --
2,969
true
true
0
10
726
754
385
369
null
null
tpsinnem/Idris-dev
src/Idris/AbsSyntaxTree.hs
bsd-3-clause
mapPDeclFC f g (POpenInterfaces fc ifs decls) = POpenInterfaces (f fc) ifs (map (mapPDeclFC f g) decls)
107
mapPDeclFC f g (POpenInterfaces fc ifs decls) = POpenInterfaces (f fc) ifs (map (mapPDeclFC f g) decls)
107
mapPDeclFC f g (POpenInterfaces fc ifs decls) = POpenInterfaces (f fc) ifs (map (mapPDeclFC f g) decls)
107
false
false
0
9
20
52
25
27
null
null
ysnrkdm/Hamlet
src/Util.hs
mit
coordFromPos = posFile &&& posRank
34
coordFromPos = posFile &&& posRank
34
coordFromPos = posFile &&& posRank
34
false
false
3
5
4
15
5
10
null
null
ideas-edu/ideas
src/Ideas/Utils/Prelude.hs
apache-2.0
subsets :: [a] -> [[a]] subsets = foldr op [[]] where op a xs = xs ++ map (a:) xs
84
subsets :: [a] -> [[a]] subsets = foldr op [[]] where op a xs = xs ++ map (a:) xs
83
subsets = foldr op [[]] where op a xs = xs ++ map (a:) xs
59
false
true
0
7
22
59
32
27
null
null
michalkonecny/polypaver
src/Numeric/ER/RnToRm/BisectionTree.hs
bsd-3-clause
const :: -- (DomainIntBox box varid d) => box -> v -> BisectionTree box varid d v const domB value = Leaf 0 domB value
142
const :: -- (DomainIntBox box varid d) => box -> v -> BisectionTree box varid d v const domB value = Leaf 0 domB value
137
const domB value = Leaf 0 domB value
40
false
true
0
8
48
45
21
24
null
null
ihc/futhark
src/Futhark/Representation/AST/Attributes/Types.hs
isc
shapeExtMapping :: [TypeBase ExtShape u] -> [TypeBase Shape u1] -> M.Map Int SubExp shapeExtMapping = dimMapping arrayExtDims arrayDims match where match Free{} _ = mempty match (Ext i) dim = M.singleton i dim
220
shapeExtMapping :: [TypeBase ExtShape u] -> [TypeBase Shape u1] -> M.Map Int SubExp shapeExtMapping = dimMapping arrayExtDims arrayDims match where match Free{} _ = mempty match (Ext i) dim = M.singleton i dim
220
shapeExtMapping = dimMapping arrayExtDims arrayDims match where match Free{} _ = mempty match (Ext i) dim = M.singleton i dim
136
false
true
1
9
43
97
44
53
null
null
djeik/goto
libgoto/Language/GoLite/Lexer/Symbols.hs
mit
-- | Parses a bitwise-and-not-equal assignment operator \"&^=\", checking for a -- semicolon. opBitwiseAndNotEq :: Parser (Semi (AssignOp a)) opBitwiseAndNotEq = semiAssignOp "&^=" BitwiseAndNotEq
196
opBitwiseAndNotEq :: Parser (Semi (AssignOp a)) opBitwiseAndNotEq = semiAssignOp "&^=" BitwiseAndNotEq
102
opBitwiseAndNotEq = semiAssignOp "&^=" BitwiseAndNotEq
54
true
true
0
9
23
33
17
16
null
null
helino/wham
src/Wham/Translator.hs
bsd-3-clause
translateBoolean (Boolean False) cp = [FALSE cp]
48
translateBoolean (Boolean False) cp = [FALSE cp]
48
translateBoolean (Boolean False) cp = [FALSE cp]
48
false
false
0
7
6
23
11
12
null
null
lostbean/sledge
src/Texture/TesseractGrid.hs
gpl-3.0
-- ============================= Basic Functions ========================================= tesseractToQuaternion :: TesseractPoint -> Quaternion tesseractToQuaternion tp = case tp of Cell1 v -> mkQuaternion $ Vec4 1 (_1 v) (_2 v) (_3 v) Cell2 v -> mkQuaternion $ Vec4 (_1 v) 1 (_2 v) (_3 v) Cell3 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) 1 (_3 v) Cell4 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) (_3 v) 1
407
tesseractToQuaternion :: TesseractPoint -> Quaternion tesseractToQuaternion tp = case tp of Cell1 v -> mkQuaternion $ Vec4 1 (_1 v) (_2 v) (_3 v) Cell2 v -> mkQuaternion $ Vec4 (_1 v) 1 (_2 v) (_3 v) Cell3 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) 1 (_3 v) Cell4 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) (_3 v) 1
315
tesseractToQuaternion tp = case tp of Cell1 v -> mkQuaternion $ Vec4 1 (_1 v) (_2 v) (_3 v) Cell2 v -> mkQuaternion $ Vec4 (_1 v) 1 (_2 v) (_3 v) Cell3 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) 1 (_3 v) Cell4 v -> mkQuaternion $ Vec4 (_1 v) (_2 v) (_3 v) 1
261
true
true
0
11
76
183
88
95
null
null
brendanhay/gogol
gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/Clients/Invitations/Get.hs
mpl-2.0
-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). acigUploadProtocol :: Lens' AccountsClientsInvitationsGet (Maybe Text) acigUploadProtocol = lens _acigUploadProtocol (\ s a -> s{_acigUploadProtocol = a})
224
acigUploadProtocol :: Lens' AccountsClientsInvitationsGet (Maybe Text) acigUploadProtocol = lens _acigUploadProtocol (\ s a -> s{_acigUploadProtocol = a})
162
acigUploadProtocol = lens _acigUploadProtocol (\ s a -> s{_acigUploadProtocol = a})
91
true
true
1
9
33
51
25
26
null
null
rvion/ride
jetpack/src/Data/Vector/AsVec.hs
bsd-3-clause
-- vec_and :: Vector Bool -> Bool vec_and = I.and
49
vec_and = I.and
15
vec_and = I.and
15
true
false
1
6
9
13
5
8
null
null
GaloisInc/orc
src/Orc/Combinators.hs
bsd-3-clause
ollect :: Orc a -> Orc [a] collect p = do accum <- newTVar [] silent (do x <- p modifyTVar accum (x:)) <+> readTVar accum --------------------------------------------------------------------------- -- | List-like functions -- | Runs the computation @p@ and returns the first @n@ results.
326
collect :: Orc a -> Orc [a] collect p = do accum <- newTVar [] silent (do x <- p modifyTVar accum (x:)) <+> readTVar accum --------------------------------------------------------------------------- -- | List-like functions -- | Runs the computation @p@ and returns the first @n@ results.
326
collect p = do accum <- newTVar [] silent (do x <- p modifyTVar accum (x:)) <+> readTVar accum --------------------------------------------------------------------------- -- | List-like functions -- | Runs the computation @p@ and returns the first @n@ results.
298
false
true
0
13
81
81
38
43
null
null
YuichiroSato/GameOfSymbolGrounding
src/Update/TimeEvolution.hs
bsd-3-clause
removeDuplicate :: Mid -> Mid removeDuplicate m = midMap resolve m
66
removeDuplicate :: Mid -> Mid removeDuplicate m = midMap resolve m
66
removeDuplicate m = midMap resolve m
36
false
true
0
5
10
26
12
14
null
null
bhamrick/hsmath
Math/Lattice/LLL.hs
bsd-3-clause
gramSchmidtStep :: Fractional a => [[a]] -> [a] -> [a] gramSchmidtStep [] v = v
79
gramSchmidtStep :: Fractional a => [[a]] -> [a] -> [a] gramSchmidtStep [] v = v
79
gramSchmidtStep [] v = v
24
false
true
0
8
14
45
24
21
null
null