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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NicolasDP/hit | Data/Git/Storage.hs | bsd-3-clause | getObjectRawAt git (Loose ref) _ = Just . (\(h,d)-> ObjectInfo h d[]) <$> looseReadRaw (gitRepoPath git) ref | 108 | getObjectRawAt git (Loose ref) _ = Just . (\(h,d)-> ObjectInfo h d[]) <$> looseReadRaw (gitRepoPath git) ref | 108 | getObjectRawAt git (Loose ref) _ = Just . (\(h,d)-> ObjectInfo h d[]) <$> looseReadRaw (gitRepoPath git) ref | 108 | false | false | 0 | 10 | 16 | 61 | 31 | 30 | null | null |
ryantm/ghc | testsuite/tests/programs/maessen-hashtab/HashTest.hs | bsd-3-clause | main :: IO ()
main = do
[r] <- getArgs
setStdGen (mkStdGen (read r :: Int))
sequence_ $
[ te "emptyLookup:" prop_emptyLookup,
te "emptyToList:" prop_emptyToList,
te "emptyFromList:" prop_emptyFromList,
te "insert:" prop_insert,
te "insertu:" prop_insertu,
te "delete:" prop_delete... | 642 | main :: IO ()
main = do
[r] <- getArgs
setStdGen (mkStdGen (read r :: Int))
sequence_ $
[ te "emptyLookup:" prop_emptyLookup,
te "emptyToList:" prop_emptyToList,
te "emptyFromList:" prop_emptyFromList,
te "insert:" prop_insert,
te "insertu:" prop_insertu,
te "delete:" prop_delete... | 642 | main = do
[r] <- getArgs
setStdGen (mkStdGen (read r :: Int))
sequence_ $
[ te "emptyLookup:" prop_emptyLookup,
te "emptyToList:" prop_emptyToList,
te "emptyFromList:" prop_emptyFromList,
te "insert:" prop_insert,
te "insertu:" prop_insertu,
te "delete:" prop_delete,
te "de... | 628 | false | true | 1 | 12 | 157 | 176 | 84 | 92 | null | null |
enolan/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LMinus (ATInt ITBig)) [l, r] = v ++ "idris_bigMinus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 100 | doOp v (LMinus (ATInt ITBig)) [l, r] = v ++ "idris_bigMinus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 100 | doOp v (LMinus (ATInt ITBig)) [l, r] = v ++ "idris_bigMinus(vm, " ++ creg l ++ ", " ++ creg r ++ ")" | 100 | false | false | 1 | 14 | 22 | 62 | 28 | 34 | null | null |
wuxb45/eval | Eval/Lib.hs | bsd-3-clause | reduce :: Expr
reduce = Lambda ["combiner", "res-list"] $
Let [("first", Apply "first-res" ["res-list"]),
("second", Apply "second-res" ["res-list"]),
("rest-2", Apply "rest-2-res" ["res-list"])]
(Let [("tmp", Apply "combiner" ["first", "second"])]
(If (Apply "empty?" ["rest-2"])
... | 482 | reduce :: Expr
reduce = Lambda ["combiner", "res-list"] $
Let [("first", Apply "first-res" ["res-list"]),
("second", Apply "second-res" ["res-list"]),
("rest-2", Apply "rest-2-res" ["res-list"])]
(Let [("tmp", Apply "combiner" ["first", "second"])]
(If (Apply "empty?" ["rest-2"])
... | 482 | reduce = Lambda ["combiner", "res-list"] $
Let [("first", Apply "first-res" ["res-list"]),
("second", Apply "second-res" ["res-list"]),
("rest-2", Apply "rest-2-res" ["res-list"])]
(Let [("tmp", Apply "combiner" ["first", "second"])]
(If (Apply "empty?" ["rest-2"])
(Ref... | 467 | false | true | 0 | 14 | 128 | 184 | 100 | 84 | null | null |
ezyang/ghc | libraries/base/GHC/Enum.hs | bsd-3-clause | maxIntWord :: Word
-- The biggest word representable as an Int
maxIntWord = W# (case maxInt of I# i -> int2Word# i) | 115 | maxIntWord :: Word
maxIntWord = W# (case maxInt of I# i -> int2Word# i) | 71 | maxIntWord = W# (case maxInt of I# i -> int2Word# i) | 52 | true | true | 0 | 10 | 21 | 34 | 17 | 17 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/NodeMap.hs | gpl-3.0 | mkNodeM :: (Ord a, DynGraph g) => a -> NodeMapM a b g (LNode a);
mkNodeM = liftN2 mkNode | 90 | mkNodeM :: (Ord a, DynGraph g) => a -> NodeMapM a b g (LNode a)
mkNodeM = liftN2 mkNode | 87 | mkNodeM = liftN2 mkNode | 23 | false | true | 0 | 9 | 20 | 52 | 26 | 26 | null | null |
randrade23/html-render | src/HTMLRender/HTMLTest.hs | mit | generateHTML tags = do {
tag <- elements tags;
str <- listOf (elements validChars);
return ("<" ++ tag ++ ">" ++ (trim str) ++ "</" ++ tag ++ ">");
} | 161 | generateHTML tags = do {
tag <- elements tags;
str <- listOf (elements validChars);
return ("<" ++ tag ++ ">" ++ (trim str) ++ "</" ++ tag ++ ">");
} | 161 | generateHTML tags = do {
tag <- elements tags;
str <- listOf (elements validChars);
return ("<" ++ tag ++ ">" ++ (trim str) ++ "</" ++ tag ++ ">");
} | 161 | false | false | 0 | 14 | 41 | 79 | 39 | 40 | null | null |
athanclark/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | isInjective _ = False | 38 | isInjective _ = False | 38 | isInjective _ = False | 38 | false | false | 0 | 4 | 20 | 10 | 4 | 6 | null | null |
ruslantalpa/postgrest | src/PostgREST/OpenAPI.hs | mit | isPortValid URIAuth {uriPort = (':':p)} =
case readMaybe p of
Just i -> i > (0 :: Integer) && i < 65536
Nothing -> False | 130 | isPortValid URIAuth {uriPort = (':':p)} =
case readMaybe p of
Just i -> i > (0 :: Integer) && i < 65536
Nothing -> False | 130 | isPortValid URIAuth {uriPort = (':':p)} =
case readMaybe p of
Just i -> i > (0 :: Integer) && i < 65536
Nothing -> False | 130 | false | false | 5 | 10 | 34 | 57 | 30 | 27 | null | null |
robx/puzzle-draw | src/Draw/Elements.hs | mit | greaterClue :: Backend' b => GreaterClue -> [Drawing b]
greaterClue [] = mempty | 79 | greaterClue :: Backend' b => GreaterClue -> [Drawing b]
greaterClue [] = mempty | 79 | greaterClue [] = mempty | 23 | false | true | 0 | 8 | 12 | 33 | 16 | 17 | null | null |
input-output-hk/pos-haskell-prototype | chain/src/Pos/Chain/Ssc/Mem.hs | mit | sscRunGlobalUpdate
:: (MonadSscMem ctx m, Rand.MonadRandom m, WithLogger m, MonadIO m)
=> StateT SscGlobalState
(NamedPureLogger (Rand.MonadPseudoRandom Rand.ChaChaDRG)) a
-> m a
sscRunGlobalUpdate action = do
globalVar <- sscGlobal <$> askSscMem
seed <- Rand.drgNew
launchNamedPureLog ato... | 552 | sscRunGlobalUpdate
:: (MonadSscMem ctx m, Rand.MonadRandom m, WithLogger m, MonadIO m)
=> StateT SscGlobalState
(NamedPureLogger (Rand.MonadPseudoRandom Rand.ChaChaDRG)) a
-> m a
sscRunGlobalUpdate action = do
globalVar <- sscGlobal <$> askSscMem
seed <- Rand.drgNew
launchNamedPureLog ato... | 552 | sscRunGlobalUpdate action = do
globalVar <- sscGlobal <$> askSscMem
seed <- Rand.drgNew
launchNamedPureLog atomically $
syncingStateWith globalVar $
executeMonadBaseRandom seed action
where
-- (... MonadPseudoRandom) a -> (... n) a
executeMonadBaseRandom seed =
hoist $ hois... | 354 | false | true | 0 | 13 | 127 | 156 | 73 | 83 | null | null |
oldmanmike/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | assignReg_I64Code :: CmmReg -> CmmExpr -> NatM InstrBlock
assignReg_I64Code (CmmLocal (LocalReg u_dst _)) valueTree = do
ChildCode64 vcode r_src_lo <- iselExpr64 valueTree
let
r_dst_lo = RegVirtual $ mkVirtualReg u_dst II32
r_dst_hi = getHiVRegFromLo r_dst_lo
r_src_hi = getHiVRegFromLo... | 516 | assignReg_I64Code :: CmmReg -> CmmExpr -> NatM InstrBlock
assignReg_I64Code (CmmLocal (LocalReg u_dst _)) valueTree = do
ChildCode64 vcode r_src_lo <- iselExpr64 valueTree
let
r_dst_lo = RegVirtual $ mkVirtualReg u_dst II32
r_dst_hi = getHiVRegFromLo r_dst_lo
r_src_hi = getHiVRegFromLo... | 516 | assignReg_I64Code (CmmLocal (LocalReg u_dst _)) valueTree = do
ChildCode64 vcode r_src_lo <- iselExpr64 valueTree
let
r_dst_lo = RegVirtual $ mkVirtualReg u_dst II32
r_dst_hi = getHiVRegFromLo r_dst_lo
r_src_hi = getHiVRegFromLo r_src_lo
mov_lo = MOV II32 (OpReg r_src_lo) (OpRe... | 457 | false | true | 0 | 13 | 129 | 164 | 79 | 85 | null | null |
gwright83/Wheeler | examples/Test.hs | bsd-3-clause | l = Symbol $ ncSymbol "l" "foo" | 31 | l = Symbol $ ncSymbol "l" "foo" | 31 | l = Symbol $ ncSymbol "l" "foo" | 31 | false | false | 1 | 6 | 6 | 18 | 7 | 11 | null | null |
abau/bildpunkt | Bildpunkt/DistanceField.hs | gpl-3.0 | transform :: (Exp Vector -> Exp Vector) -> DistanceField -> DistanceField
transform t f = DistanceField
(\p -> evaluate f $ t p)
(\p -> evaluateColor f $ t p) | 167 | transform :: (Exp Vector -> Exp Vector) -> DistanceField -> DistanceField
transform t f = DistanceField
(\p -> evaluate f $ t p)
(\p -> evaluateColor f $ t p) | 167 | transform t f = DistanceField
(\p -> evaluate f $ t p)
(\p -> evaluateColor f $ t p) | 93 | false | true | 0 | 9 | 38 | 85 | 39 | 46 | null | null |
Soostone/hadron | examples/WordCountLocal.hs | bsd-3-clause | truncated :: CSV B.ByteString a => Tap a
truncated = tap "data/truncated.csv" (csvProtocol def) | 95 | truncated :: CSV B.ByteString a => Tap a
truncated = tap "data/truncated.csv" (csvProtocol def) | 95 | truncated = tap "data/truncated.csv" (csvProtocol def) | 54 | false | true | 0 | 7 | 13 | 36 | 17 | 19 | null | null |
dolio/vector | Data/Vector/Fusion/Bundle.hs | bsd-3-clause | flatten mk istep sz = M.flatten (return . mk) (return . istep) sz . lift | 72 | flatten mk istep sz = M.flatten (return . mk) (return . istep) sz . lift | 72 | flatten mk istep sz = M.flatten (return . mk) (return . istep) sz . lift | 72 | false | false | 1 | 8 | 14 | 47 | 20 | 27 | null | null |
ihc/futhark | src/Futhark/Optimise/Simplifier/Lore.hs | isc | removeProgWisdom :: CanBeWise (Op lore) => Prog (Wise lore) -> Prog lore
removeProgWisdom = runIdentity . rephraseProg removeWisdom | 131 | removeProgWisdom :: CanBeWise (Op lore) => Prog (Wise lore) -> Prog lore
removeProgWisdom = runIdentity . rephraseProg removeWisdom | 131 | removeProgWisdom = runIdentity . rephraseProg removeWisdom | 58 | false | true | 1 | 10 | 17 | 53 | 23 | 30 | null | null |
LeifW/rdf4h | src/Text/RDF/RDF4H/TurtleParser.hs | bsd-3-clause | t_triples :: GenParser ParseState ()
t_triples = t_subject >> (many1 t_ws <?> "subject-predicate-whitespace") >> t_predicateObjectList >> resetSubjectPredicate | 159 | t_triples :: GenParser ParseState ()
t_triples = t_subject >> (many1 t_ws <?> "subject-predicate-whitespace") >> t_predicateObjectList >> resetSubjectPredicate | 159 | t_triples = t_subject >> (many1 t_ws <?> "subject-predicate-whitespace") >> t_predicateObjectList >> resetSubjectPredicate | 122 | false | true | 0 | 10 | 16 | 40 | 20 | 20 | null | null |
gsdlab/clafer | src/Language/Clafer/Generator/Html.hs | mit | genTooltip :: Module -> Map.Map Span [Ir] -> String
genTooltip m ir = unlines $ filter (\x -> trim x /= []) $ lines $ cleanOutput $ revertLayout $ printModule m ir False | 169 | genTooltip :: Module -> Map.Map Span [Ir] -> String
genTooltip m ir = unlines $ filter (\x -> trim x /= []) $ lines $ cleanOutput $ revertLayout $ printModule m ir False | 169 | genTooltip m ir = unlines $ filter (\x -> trim x /= []) $ lines $ cleanOutput $ revertLayout $ printModule m ir False | 117 | false | true | 0 | 14 | 32 | 81 | 40 | 41 | null | null |
allanderek/ipclib | Language/Pepa/Rates.hs | gpl-2.0 | isNonReducable _ = False | 36 | isNonReducable _ = False | 36 | isNonReducable _ = False | 36 | false | false | 0 | 5 | 15 | 9 | 4 | 5 | null | null |
lynnard/cocos2d-hs | src/Graphics/UI/Cocos2d/Label.hs | bsd-3-clause | label_getHeight :: (LabelValue arg'1) => arg'1 -> HoppyP.IO HoppyP.Float
label_getHeight arg'1 =
withLabelPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(label_getHeight' arg'1') | 224 | label_getHeight :: (LabelValue arg'1) => arg'1 -> HoppyP.IO HoppyP.Float
label_getHeight arg'1 =
withLabelPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(label_getHeight' arg'1') | 224 | label_getHeight arg'1 =
withLabelPtr arg'1 $ HoppyP.flip HoppyFHR.withCppPtr $ \arg'1' ->
HoppyP.fmap HoppyP.realToFrac
(label_getHeight' arg'1') | 151 | false | true | 0 | 8 | 29 | 73 | 35 | 38 | null | null |
mcschroeder/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | mkCorePairExpr :: CoreExpr -> CoreExpr -> CoreExpr
mkCorePairExpr e1 e2 = mkCoreTup [e1, e2] | 92 | mkCorePairExpr :: CoreExpr -> CoreExpr -> CoreExpr
mkCorePairExpr e1 e2 = mkCoreTup [e1, e2] | 92 | mkCorePairExpr e1 e2 = mkCoreTup [e1, e2] | 41 | false | true | 0 | 8 | 13 | 38 | 18 | 20 | null | null |
jezen/mail-for-muggles | src/Main.hs | bsd-3-clause | rfc5322 :: ReadP Address
rfc5322 = withName <|> onlyEmail <* eof | 64 | rfc5322 :: ReadP Address
rfc5322 = withName <|> onlyEmail <* eof | 64 | rfc5322 = withName <|> onlyEmail <* eof | 39 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
lpeterse/koka | src/Interpreter/Message.hs | apache-2.0 | messageEvaluation :: Printer p => State p -> IO ()
messageEvaluation st
= messageInfoLnLn st "evaluation is disabled" | 119 | messageEvaluation :: Printer p => State p -> IO ()
messageEvaluation st
= messageInfoLnLn st "evaluation is disabled" | 119 | messageEvaluation st
= messageInfoLnLn st "evaluation is disabled" | 68 | false | true | 0 | 8 | 19 | 38 | 17 | 21 | null | null |
Saeron/haskell | data.structures/haskell/DataStructures/Set/ListSet.hs | apache-2.0 | intersection :: (Ord a) => Set a -> Set a -> Set a
intersection s s' = fold (\x inter -> if isElem x s then insert x inter else inter) empty s' | 145 | intersection :: (Ord a) => Set a -> Set a -> Set a
intersection s s' = fold (\x inter -> if isElem x s then insert x inter else inter) empty s' | 144 | intersection s s' = fold (\x inter -> if isElem x s then insert x inter else inter) empty s' | 93 | false | true | 0 | 9 | 34 | 81 | 39 | 42 | null | null |
diffusionkinetics/open | dashdo/src/Dashdo/Elements.hs | mit | toParentFormField :: Lens' t b -> FormField b -> FormField t
toParentFormField g (n, f) =
(n, f')
where f' t txt = t & g .~ (f (t ^. g) txt) | 146 | toParentFormField :: Lens' t b -> FormField b -> FormField t
toParentFormField g (n, f) =
(n, f')
where f' t txt = t & g .~ (f (t ^. g) txt) | 146 | toParentFormField g (n, f) =
(n, f')
where f' t txt = t & g .~ (f (t ^. g) txt) | 85 | false | true | 0 | 11 | 37 | 82 | 42 | 40 | null | null |
mpickering/ghc-exactprint | tests/examples/ghc710/Undefined13.hs | bsd-3-clause | mkParameter a v = ParameterRaw a v | 34 | mkParameter a v = ParameterRaw a v | 34 | mkParameter a v = ParameterRaw a v | 34 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
gnn/Hets | OWL2/XML.hs | gpl-2.0 | getPrefixMap :: Element -> [(String, String)]
getPrefixMap e = map get1Map $ filterCh "Prefix" e | 96 | getPrefixMap :: Element -> [(String, String)]
getPrefixMap e = map get1Map $ filterCh "Prefix" e | 96 | getPrefixMap e = map get1Map $ filterCh "Prefix" e | 50 | false | true | 0 | 7 | 14 | 39 | 20 | 19 | null | null |
thomasathorne/h-chu | src/GameState.hs | bsd-3-clause | initialiseGame :: Player -> Player -> Player -> Player -> IO GameState
initialiseGame y l p r = do
n <- getName
m <- getName
atomically $ do
a <- newTVar []
[b,c] <- sequence [newTVar 0, newTVar 0]
d <- newTVar PreRound
e <- newTVar Nothing
f <- newTVar Nothing
return $ GameState y l p r a b c n m d e f | 319 | initialiseGame :: Player -> Player -> Player -> Player -> IO GameState
initialiseGame y l p r = do
n <- getName
m <- getName
atomically $ do
a <- newTVar []
[b,c] <- sequence [newTVar 0, newTVar 0]
d <- newTVar PreRound
e <- newTVar Nothing
f <- newTVar Nothing
return $ GameState y l p r a b c n m d e f | 319 | initialiseGame y l p r = do
n <- getName
m <- getName
atomically $ do
a <- newTVar []
[b,c] <- sequence [newTVar 0, newTVar 0]
d <- newTVar PreRound
e <- newTVar Nothing
f <- newTVar Nothing
return $ GameState y l p r a b c n m d e f | 248 | false | true | 0 | 13 | 80 | 162 | 74 | 88 | null | null |
aostiles/LiveHaskell | src/IHaskell/Convert/LhsToIpynb.hs | mit | untag (MarkdownLine a) = a | 26 | untag (MarkdownLine a) = a | 26 | untag (MarkdownLine a) = a | 26 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types/Product.hs | mpl-2.0 | -- | The volume status.
vsiVolumeStatus :: Lens' VolumeStatusItem (Maybe VolumeStatusInfo)
vsiVolumeStatus = lens _vsiVolumeStatus (\ s a -> s{_vsiVolumeStatus = a}) | 165 | vsiVolumeStatus :: Lens' VolumeStatusItem (Maybe VolumeStatusInfo)
vsiVolumeStatus = lens _vsiVolumeStatus (\ s a -> s{_vsiVolumeStatus = a}) | 141 | vsiVolumeStatus = lens _vsiVolumeStatus (\ s a -> s{_vsiVolumeStatus = a}) | 74 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/StorageUsageCallback.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/StorageUsageCallback Mozilla StorageUsageCallback documentation>
newStorageUsageCallbackSync ::
(MonadDOM m) =>
(Double -> Double -> JSM ()) -> m StorageUsageCallback
newStorageUsageCallbackSync callback
... | 733 | newStorageUsageCallbackSync ::
(MonadDOM m) =>
(Double -> Double -> JSM ()) -> m StorageUsageCallback
newStorageUsageCallbackSync callback
= liftDOM
(StorageUsageCallback . Callback <$>
function
(\ _ _ [currentUsageInBytes, currentQuo... | 612 | newStorageUsageCallbackSync callback
= liftDOM
(StorageUsageCallback . Callback <$>
function
(\ _ _ [currentUsageInBytes, currentQuotaInBytes] ->
fromJSValUnchecked currentQuotaInBytes >>=
\ currentQuotaInBytes' ->
fromJSValUnchecked currentUsa... | 452 | true | true | 0 | 14 | 224 | 111 | 57 | 54 | null | null |
dillonhuff/Proper | src/Proper/Lexer.hs | bsd-3-clause | testId s = Id s (newPos "DUMMY" 0 0) | 36 | testId s = Id s (newPos "DUMMY" 0 0) | 36 | testId s = Id s (newPos "DUMMY" 0 0) | 36 | false | false | 1 | 7 | 8 | 29 | 11 | 18 | null | null |
alexstachnik/High-Level-C | src/Test.hs | gpl-2.0 | test ret = do
ifThenElseRest (intLit 15 %<= intLit 5)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 12
c
)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 13
c
)
whileStmt (intLit 3 %<= intLit 10)
(\break cont -> do
x <- makeVar :: Var ... | 609 | test ret = do
ifThenElseRest (intLit 15 %<= intLit 5)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 12
c
)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 13
c
)
whileStmt (intLit 3 %<= intLit 10)
(\break cont -> do
x <- makeVar :: Var ... | 609 | test ret = do
ifThenElseRest (intLit 15 %<= intLit 5)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 12
c
)
(\c -> do
x <- makeVar :: Var HLCInt
x =: intLit 13
c
)
whileStmt (intLit 3 %<= intLit 10)
(\break cont -> do
x <- makeVar :: Var ... | 609 | false | false | 0 | 16 | 254 | 226 | 103 | 123 | null | null |
ganeti/ganeti | src/Ganeti/HTools/Program/Hscan.hs | bsd-2-clause | -- | Options list and functions.
options :: IO [OptType]
options = do
luxi <- oLuxiSocket
return
[ oPrintNodes
, oOutputDir
, luxi
, oVerbose
, oNoHeaders
, oStaticKvmNodeMemory
]
-- | The list of arguments supported by the program. | 265 | options :: IO [OptType]
options = do
luxi <- oLuxiSocket
return
[ oPrintNodes
, oOutputDir
, luxi
, oVerbose
, oNoHeaders
, oStaticKvmNodeMemory
]
-- | The list of arguments supported by the program. | 232 | options = do
luxi <- oLuxiSocket
return
[ oPrintNodes
, oOutputDir
, luxi
, oVerbose
, oNoHeaders
, oStaticKvmNodeMemory
]
-- | The list of arguments supported by the program. | 208 | true | true | 0 | 9 | 72 | 56 | 29 | 27 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/CodeGen/Flatten.hs | bsd-3-clause | flattenPrimOp t = \_ -> error $ "TODO: flattenPrimOp: " ++ show t | 66 | flattenPrimOp t = \_ -> error $ "TODO: flattenPrimOp: " ++ show t | 66 | flattenPrimOp t = \_ -> error $ "TODO: flattenPrimOp: " ++ show t | 66 | false | false | 0 | 7 | 13 | 25 | 12 | 13 | null | null |
liuyang1/euler | square.091.hs | mit | vec (Point (x0, y0)) (Point (x1, y1)) = Point (x0 - x1, y0 - y1) | 64 | vec (Point (x0, y0)) (Point (x1, y1)) = Point (x0 - x1, y0 - y1) | 64 | vec (Point (x0, y0)) (Point (x1, y1)) = Point (x0 - x1, y0 - y1) | 64 | false | false | 1 | 8 | 14 | 54 | 28 | 26 | null | null |
mvoidex/redis-worker | src/System/Worker/Redis.hs | bsd-3-clause | popTask :: (MonadTask m) => ByteString -> ByteString -> Integer -> (ByteString -> M.Map ByteString ByteString -> m a) -> (ByteString -> m a) -> m a
popTask tl pl timeout process processFail = popTaskId tl pl timeout process' where
process' i = do
v <- inTask $ hgetall i
case v of
Left _ -> processFail i... | 422 | popTask :: (MonadTask m) => ByteString -> ByteString -> Integer -> (ByteString -> M.Map ByteString ByteString -> m a) -> (ByteString -> m a) -> m a
popTask tl pl timeout process processFail = popTaskId tl pl timeout process' where
process' i = do
v <- inTask $ hgetall i
case v of
Left _ -> processFail i... | 422 | popTask tl pl timeout process processFail = popTaskId tl pl timeout process' where
process' i = do
v <- inTask $ hgetall i
case v of
Left _ -> processFail i
Right m -> process i $ M.fromList m
-- | Move all tasks from processing-list back to task-list | 274 | false | true | 0 | 15 | 98 | 166 | 76 | 90 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F17.hs | bsd-3-clause | ptr_glMultTransposeMatrixxOES :: FunPtr (Ptr GLfixed -> IO ())
ptr_glMultTransposeMatrixxOES = unsafePerformIO $ getCommand "glMultTransposeMatrixxOES" | 151 | ptr_glMultTransposeMatrixxOES :: FunPtr (Ptr GLfixed -> IO ())
ptr_glMultTransposeMatrixxOES = unsafePerformIO $ getCommand "glMultTransposeMatrixxOES" | 151 | ptr_glMultTransposeMatrixxOES = unsafePerformIO $ getCommand "glMultTransposeMatrixxOES" | 88 | false | true | 0 | 9 | 13 | 36 | 17 | 19 | null | null |
nau/lasca-compiler | src/lib/Lasca/Infer.hs | bsd-3-clause | extend :: TypeEnv -> (Name, Type) -> TypeEnv
extend (TypeEnv env) (x, s) = TypeEnv $ Map.insert x s env | 103 | extend :: TypeEnv -> (Name, Type) -> TypeEnv
extend (TypeEnv env) (x, s) = TypeEnv $ Map.insert x s env | 103 | extend (TypeEnv env) (x, s) = TypeEnv $ Map.insert x s env | 58 | false | true | 0 | 10 | 19 | 60 | 30 | 30 | null | null |
grnet/snf-ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pUseLocking :: Field
pUseLocking =
withDoc "Whether to use synchronization" $
defaultFalse "use_locking" | 108 | pUseLocking :: Field
pUseLocking =
withDoc "Whether to use synchronization" $
defaultFalse "use_locking" | 108 | pUseLocking =
withDoc "Whether to use synchronization" $
defaultFalse "use_locking" | 87 | false | true | 0 | 6 | 16 | 21 | 10 | 11 | null | null |
andir/ganeti | src/Ganeti/Kvmd.hs | bsd-2-clause | ensureMonitor :: Monitors -> FilePath -> IO ()
ensureMonitor monitors monitorFile =
modifyMVar_ monitors $
\files ->
if monitorFile `Set.member` files
then return files
else do
forkIO tryMonitor >> return ()
return $ monitorFile `Set.insert` files
where tryMonitor =
d... | 976 | ensureMonitor :: Monitors -> FilePath -> IO ()
ensureMonitor monitors monitorFile =
modifyMVar_ monitors $
\files ->
if monitorFile `Set.member` files
then return files
else do
forkIO tryMonitor >> return ()
return $ monitorFile `Set.insert` files
where tryMonitor =
d... | 976 | ensureMonitor monitors monitorFile =
modifyMVar_ monitors $
\files ->
if monitorFile `Set.member` files
then return files
else do
forkIO tryMonitor >> return ()
return $ monitorFile `Set.insert` files
where tryMonitor =
do Logging.logInfo $ "Start monitor " ++ show mo... | 929 | false | true | 6 | 12 | 297 | 211 | 108 | 103 | null | null |
mpickering/HaRe | src/Language/Haskell/Refact/Refactoring/DupDef.hs | bsd-3-clause | doDuplicatingClient :: GHC.ModuleName -> [GHC.Name]
-> RefactGhc ()
doDuplicatingClient serverModName newPNames = do
parsed <- getRefactParsed
parsed' <- addHiding serverModName parsed (map GHC.nameRdrName newPNames)
putRefactParsed parsed' emptyAnns
return ()
--Check here:
-- | get the module... | 409 | doDuplicatingClient :: GHC.ModuleName -> [GHC.Name]
-> RefactGhc ()
doDuplicatingClient serverModName newPNames = do
parsed <- getRefactParsed
parsed' <- addHiding serverModName parsed (map GHC.nameRdrName newPNames)
putRefactParsed parsed' emptyAnns
return ()
--Check here:
-- | get the module... | 409 | doDuplicatingClient serverModName newPNames = do
parsed <- getRefactParsed
parsed' <- addHiding serverModName parsed (map GHC.nameRdrName newPNames)
putRefactParsed parsed' emptyAnns
return ()
--Check here:
-- | get the module name or alias name by which the duplicated
-- definition will be imported automat... | 327 | false | true | 0 | 11 | 75 | 86 | 41 | 45 | null | null |
dschalk/score3 | Fm.hs | mit | rM :: Int -> IO Int
rM x = getStdRandom (System.Random.randomR ((1,x) :: (Int,Int))) | 84 | rM :: Int -> IO Int
rM x = getStdRandom (System.Random.randomR ((1,x) :: (Int,Int))) | 84 | rM x = getStdRandom (System.Random.randomR ((1,x) :: (Int,Int))) | 64 | false | true | 0 | 9 | 13 | 51 | 28 | 23 | null | null |
ford-prefect/haskell-gi | lib/Data/GI/CodeGen/Overrides.hs | lgpl-2.1 | parseXMLName :: Text -> Parser XML.Name
parseXMLName a = case T.splitOn ":" a of
[n] -> return (xmlLocalName n)
["c", n] -> return (xmlNSName CGIRNS n)
["glib", n] -> return (xmlNSName GLibGIRNS n)
_ -> throwError ("Could not understand xml nam... | 407 | parseXMLName :: Text -> Parser XML.Name
parseXMLName a = case T.splitOn ":" a of
[n] -> return (xmlLocalName n)
["c", n] -> return (xmlNSName CGIRNS n)
["glib", n] -> return (xmlNSName GLibGIRNS n)
_ -> throwError ("Could not understand xml nam... | 407 | parseXMLName a = case T.splitOn ":" a of
[n] -> return (xmlLocalName n)
["c", n] -> return (xmlNSName CGIRNS n)
["glib", n] -> return (xmlNSName GLibGIRNS n)
_ -> throwError ("Could not understand xml name \""
... | 367 | false | true | 0 | 11 | 163 | 119 | 60 | 59 | null | null |
fehu/itesm-ga | src/Parcial2/Examples/Data.hs | mit | chExOrange = prepareChromosomeExample "orange" | 46 | chExOrange = prepareChromosomeExample "orange" | 46 | chExOrange = prepareChromosomeExample "orange" | 46 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
ctford/Idris-Elba-dev | src/IRTS/Java/JTypes.hs | bsd-3-clause | sourceTypes (LStrLt) = [stringType, stringType] | 47 | sourceTypes (LStrLt) = [stringType, stringType] | 47 | sourceTypes (LStrLt) = [stringType, stringType] | 47 | false | false | 0 | 6 | 4 | 18 | 10 | 8 | null | null |
TimRichter/Idris-dev | src/Idris/DSL.hs | bsd-3-clause | expandSugar :: DSL -> PTerm -> PTerm
expandSugar dsl (PLam fc n nfc ty tm)
| Just lam <- dsl_lambda dsl
= let sc = PApp fc lam [ pexp (mkTTName fc n)
, pexp (var dsl n tm 0)]
in expandSugar dsl sc | 249 | expandSugar :: DSL -> PTerm -> PTerm
expandSugar dsl (PLam fc n nfc ty tm)
| Just lam <- dsl_lambda dsl
= let sc = PApp fc lam [ pexp (mkTTName fc n)
, pexp (var dsl n tm 0)]
in expandSugar dsl sc | 249 | expandSugar dsl (PLam fc n nfc ty tm)
| Just lam <- dsl_lambda dsl
= let sc = PApp fc lam [ pexp (mkTTName fc n)
, pexp (var dsl n tm 0)]
in expandSugar dsl sc | 212 | false | true | 0 | 14 | 96 | 109 | 51 | 58 | null | null |
allanderek/ipclib | Language/Ptrees/Evaluate.hs | gpl-2.0 | evaluatePtreeFile :: Ipc.CliOptions a -> FilePath -> IO ExitCode
evaluatePtreeFile options file =
result >>= Ipc.exitFromMainControl options file outputResult
where
result :: IO (MainControl Result)
result = MainControl.runMainControlT $
PtreeParser.parsePtreeFile file >>= evaluatePtree initialEnv
... | 648 | evaluatePtreeFile :: Ipc.CliOptions a -> FilePath -> IO ExitCode
evaluatePtreeFile options file =
result >>= Ipc.exitFromMainControl options file outputResult
where
result :: IO (MainControl Result)
result = MainControl.runMainControlT $
PtreeParser.parsePtreeFile file >>= evaluatePtree initialEnv
... | 648 | evaluatePtreeFile options file =
result >>= Ipc.exitFromMainControl options file outputResult
where
result :: IO (MainControl Result)
result = MainControl.runMainControlT $
PtreeParser.parsePtreeFile file >>= evaluatePtree initialEnv
initialEnv = Environment { envPtreeFile = Just file
... | 583 | false | true | 0 | 8 | 210 | 122 | 63 | 59 | null | null |
herrmann/pfai-search-uct | src/AI/Search/UCT.hs | bsd-3-clause | update :: Double -- ^ The value from the rollout
-> FullUctNode -- ^ Leaf node location
-> FullUctNode -- ^ Updated tree root location
update val = go
where
go loc' =
let loc'' = modifyLabel upd loc'
upd n = UctNode { visits = visits n + 1, value = value n + val }
in case parent loc'' of... | 447 | update :: Double -- ^ The value from the rollout
-> FullUctNode -- ^ Leaf node location
-> FullUctNode
update val = go
where
go loc' =
let loc'' = modifyLabel upd loc'
upd n = UctNode { visits = visits n + 1, value = value n + val }
in case parent loc'' of
Nothing -> loc''
... | 415 | update val = go
where
go loc' =
let loc'' = modifyLabel upd loc'
upd n = UctNode { visits = visits n + 1, value = value n + val }
in case parent loc'' of
Nothing -> loc''
Just l -> go l
-- | Dummy rollout function that chooses between victory or defeat at random. | 308 | true | true | 0 | 12 | 131 | 116 | 57 | 59 | null | null |
mvr/abyme | haskell-model/src/Abyme/Shapey/Universe/Generate.hs | bsd-3-clause | potentialNewSquares :: Universe -> Shape -> [((ShapeId, V2 Integer), V2 Integer)]
potentialNewSquares u s = do
(d, s, l') <- haloWithOriginal u s
guard (not $ isInhabited u l')
let pos = directionToVector d + s ^. squarePosition
newparent = l' ^. locationShape
parentPos = locationToPosition l' - pos
... | 409 | potentialNewSquares :: Universe -> Shape -> [((ShapeId, V2 Integer), V2 Integer)]
potentialNewSquares u s = do
(d, s, l') <- haloWithOriginal u s
guard (not $ isInhabited u l')
let pos = directionToVector d + s ^. squarePosition
newparent = l' ^. locationShape
parentPos = locationToPosition l' - pos
... | 409 | potentialNewSquares u s = do
(d, s, l') <- haloWithOriginal u s
guard (not $ isInhabited u l')
let pos = directionToVector d + s ^. squarePosition
newparent = l' ^. locationShape
parentPos = locationToPosition l' - pos
return $ ((newparent ^. shapeId, parentPos), pos)
-- Assuming the square is unin... | 327 | false | true | 0 | 12 | 82 | 149 | 77 | 72 | null | null |
taojang/haskell-programming-book-exercise | src/ch17/ListApp.hs | bsd-3-clause | concat' Nil ys = ys | 19 | concat' Nil ys = ys | 19 | concat' Nil ys = ys | 19 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
fmapfmapfmap/amazonka | amazonka-s3/gen/Network/AWS/S3/ListMultipartUploads.hs | mpl-2.0 | -- | When a list is truncated, this element specifies the value that should
-- be used for the key-marker request parameter in a subsequent request.
lmursNextKeyMarker :: Lens' ListMultipartUploadsResponse (Maybe Text)
lmursNextKeyMarker = lens _lmursNextKeyMarker (\ s a -> s{_lmursNextKeyMarker = a}) | 302 | lmursNextKeyMarker :: Lens' ListMultipartUploadsResponse (Maybe Text)
lmursNextKeyMarker = lens _lmursNextKeyMarker (\ s a -> s{_lmursNextKeyMarker = a}) | 153 | lmursNextKeyMarker = lens _lmursNextKeyMarker (\ s a -> s{_lmursNextKeyMarker = a}) | 83 | true | true | 0 | 9 | 42 | 47 | 26 | 21 | null | null |
stefanocerruti/haskell-primer-alpha | src/TimeSeries.hs | bsd-3-clause | diffPair (Just x) (Just y) = Just (x - y) | 41 | diffPair (Just x) (Just y) = Just (x - y) | 41 | diffPair (Just x) (Just y) = Just (x - y) | 41 | false | false | 0 | 7 | 9 | 33 | 16 | 17 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Monad comprehensions
guardMName, liftMName, mzipName :: Name
guardMName = varQual mONAD (fsLit "guard") guardMIdKey | 129 | guardMName, liftMName, mzipName :: Name
guardMName = varQual mONAD (fsLit "guard") guardMIdKey | 105 | guardMName = varQual mONAD (fsLit "guard") guardMIdKey | 65 | true | true | 0 | 7 | 25 | 29 | 17 | 12 | null | null |
taktoa/hskpipe | src/Compile.hs | gpl-3.0 | typeCheck (EInt _) = Just TNumber | 40 | typeCheck (EInt _) = Just TNumber | 40 | typeCheck (EInt _) = Just TNumber | 40 | false | false | 0 | 6 | 12 | 19 | 8 | 11 | null | null |
mfilmer/haskBMP | bitmap.hs | gpl-3.0 | image2 = [[Pixel8 (255,0,0), Pixel8 (255,255,255)],
[Pixel8 (0,0,255), Pixel8 (0,255,0)]] | 99 | image2 = [[Pixel8 (255,0,0), Pixel8 (255,255,255)],
[Pixel8 (0,0,255), Pixel8 (0,255,0)]] | 99 | image2 = [[Pixel8 (255,0,0), Pixel8 (255,255,255)],
[Pixel8 (0,0,255), Pixel8 (0,255,0)]] | 99 | false | false | 0 | 8 | 19 | 72 | 43 | 29 | null | null |
bitemyapp/hlint | data/Default.hs | bsd-3-clause | error = any (== a) ==> elem a | 29 | error = any (== a) ==> elem a | 29 | error = any (== a) ==> elem a | 29 | false | false | 2 | 5 | 7 | 24 | 10 | 14 | null | null |
gcampax/ghc | compiler/types/Type.hs | bsd-3-clause | cmpTypeX _ (LitTy _) (TyVarTy _) = GT | 45 | cmpTypeX _ (LitTy _) (TyVarTy _) = GT | 45 | cmpTypeX _ (LitTy _) (TyVarTy _) = GT | 45 | false | false | 0 | 7 | 15 | 25 | 12 | 13 | null | null |
TransformingMusicology/tabcode-haskell | src/TabCode/Serialiser/MEIXML/Serialiser.hs | gpl-3.0 | tc :: Namespace
tc = namespace "tc" "http://data.t-mus.org/ns/tabcode" | 70 | tc :: Namespace
tc = namespace "tc" "http://data.t-mus.org/ns/tabcode" | 70 | tc = namespace "tc" "http://data.t-mus.org/ns/tabcode" | 54 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
lambda-11235/pure-hlisp | src/Eval.hs | gpl-2.0 | handleLookup :: String -> LispState LDatum
handleLookup name =
do env <- get
case M.lookup name env of
Just chunk -> force chunk
Nothing -> failWith (UnboundSym name)
-- | Handles an application of a special form or function. | 257 | handleLookup :: String -> LispState LDatum
handleLookup name =
do env <- get
case M.lookup name env of
Just chunk -> force chunk
Nothing -> failWith (UnboundSym name)
-- | Handles an application of a special form or function. | 257 | handleLookup name =
do env <- get
case M.lookup name env of
Just chunk -> force chunk
Nothing -> failWith (UnboundSym name)
-- | Handles an application of a special form or function. | 214 | false | true | 0 | 13 | 70 | 74 | 33 | 41 | null | null |
kawamuray/ganeti | src/Ganeti/Constants.hs | gpl-2.0 | -- * Import/export config options
inisectBep :: String
inisectBep = "backend" | 78 | inisectBep :: String
inisectBep = "backend" | 43 | inisectBep = "backend" | 22 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
olsner/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | evTermCoercion :: EvTerm -> TcCoercion
-- Applied only to EvTerms of type (s~t)
-- See Note [Coercion evidence terms]
evTermCoercion (EvId v) = mkCoVarCo v | 162 | evTermCoercion :: EvTerm -> TcCoercion
evTermCoercion (EvId v) = mkCoVarCo v | 83 | evTermCoercion (EvId v) = mkCoVarCo v | 44 | true | true | 0 | 7 | 31 | 29 | 15 | 14 | null | null |
thomie/cabal | cabal-install/tests/UnitTests/Distribution/Client/FileMonitor.hs | bsd-3-clause | testEmptyMonitor :: Assertion
testEmptyMonitor =
withFileMonitor $ \root monitor -> do
touchFile root "a"
updateMonitor root monitor [] () ()
touchFile root "b"
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
-- monitor a file that is expected to exist | 312 | testEmptyMonitor :: Assertion
testEmptyMonitor =
withFileMonitor $ \root monitor -> do
touchFile root "a"
updateMonitor root monitor [] () ()
touchFile root "b"
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
-- monitor a file that is expected to exist | 312 | testEmptyMonitor =
withFileMonitor $ \root monitor -> do
touchFile root "a"
updateMonitor root monitor [] () ()
touchFile root "b"
(res, files) <- expectMonitorUnchanged root monitor ()
res @?= ()
files @?= []
-- monitor a file that is expected to exist | 282 | false | true | 0 | 11 | 73 | 99 | 47 | 52 | null | null |
ghcjs/ghcjs | test/ghc/perf/t14936.hs | mit | -- This 'go' loop should allocate nothing, because it specialises
-- for the shape of the state. But in 8.4 it did (Trac #14936)
slow :: Int -> IO ()
slow i = do let go 0 = pure ()
go j = do Foo (!a, !off) <- S.get
S.put (Foo (a+1, off))
go (j - 1)
... | 382 | slow :: Int -> IO ()
slow i = do let go 0 = pure ()
go j = do Foo (!a, !off) <- S.get
S.put (Foo (a+1, off))
go (j - 1)
S.evalStateT (go i) (Foo ((0::Int),(intSize::Int))) | 251 | slow i = do let go 0 = pure ()
go j = do Foo (!a, !off) <- S.get
S.put (Foo (a+1, off))
go (j - 1)
S.evalStateT (go i) (Foo ((0::Int),(intSize::Int))) | 230 | true | true | 0 | 17 | 143 | 152 | 74 | 78 | null | null |
cmc-haskell-2015/checkers | src/DrawingConsole/Internal.hs | lgpl-3.0 | makeField :: Game -> String
makeField game@(Game cfg _) =
rows ++ " " ++ (makeBorder boardSize) ++ "\n" ++
" " ++ (makeColLabels boardSize)
where
boardSize = gcBoardSize cfg
rows = concat [makeRow game n | n <- [boardSize-1, boardSize-2 .. 0]]
-- | Отрисовать игру в консоль | 297 | makeField :: Game -> String
makeField game@(Game cfg _) =
rows ++ " " ++ (makeBorder boardSize) ++ "\n" ++
" " ++ (makeColLabels boardSize)
where
boardSize = gcBoardSize cfg
rows = concat [makeRow game n | n <- [boardSize-1, boardSize-2 .. 0]]
-- | Отрисовать игру в консоль | 297 | makeField game@(Game cfg _) =
rows ++ " " ++ (makeBorder boardSize) ++ "\n" ++
" " ++ (makeColLabels boardSize)
where
boardSize = gcBoardSize cfg
rows = concat [makeRow game n | n <- [boardSize-1, boardSize-2 .. 0]]
-- | Отрисовать игру в консоль | 269 | false | true | 0 | 10 | 71 | 114 | 59 | 55 | null | null |
phi16/Lambia | src/Lambia/Index.hs | gpl-3.0 | iE :: Store s => [ByteString] -> Expr -> Local s (Syn s)
iE us (Expr decls t) = do
s <- get
forM_ decls $ \(Decl str sc e) -> do
Status g l <- get
m <- iE us e
let
g' = append str Nothing (fromSyn m) g
l' = append str Nothing (fromSyn m) l
put $ Status g' l'
i <- iT us t
put s
retu... | 324 | iE :: Store s => [ByteString] -> Expr -> Local s (Syn s)
iE us (Expr decls t) = do
s <- get
forM_ decls $ \(Decl str sc e) -> do
Status g l <- get
m <- iE us e
let
g' = append str Nothing (fromSyn m) g
l' = append str Nothing (fromSyn m) l
put $ Status g' l'
i <- iT us t
put s
retu... | 324 | iE us (Expr decls t) = do
s <- get
forM_ decls $ \(Decl str sc e) -> do
Status g l <- get
m <- iE us e
let
g' = append str Nothing (fromSyn m) g
l' = append str Nothing (fromSyn m) l
put $ Status g' l'
i <- iT us t
put s
return i | 267 | false | true | 0 | 17 | 110 | 194 | 87 | 107 | null | null |
kishoredbn/barrelfish | tools/sockeye/SockeyeParser.hs | mit | constName = identString <?> "constant name" | 48 | constName = identString <?> "constant name" | 48 | constName = identString <?> "constant name" | 48 | false | false | 0 | 5 | 10 | 10 | 5 | 5 | null | null |
phaazon/vector | tests/Tests/Vector.hs | bsd-3-clause | testEnumFunctions :: forall a v. (COMMON_CONTEXT(a, v), Enum a, Ord a, Num a, Random a) => v a -> [Test]
testEnumFunctions _ = $(testProperties
[ 'prop_enumFromN, 'prop_enumFromThenN,
'prop_enumFromTo, 'prop_enumFromThenTo])
where
prop_enumFromN :: P (a -> Int -> v a)
= (\_ n -> n < 1000)
===>... | 1,136 | testEnumFunctions :: forall a v. (COMMON_CONTEXT(a, v), Enum a, Ord a, Num a, Random a) => v a -> [Test]
testEnumFunctions _ = $(testProperties
[ 'prop_enumFromN, 'prop_enumFromThenN,
'prop_enumFromTo, 'prop_enumFromThenTo])
where
prop_enumFromN :: P (a -> Int -> v a)
= (\_ n -> n < 1000)
===>... | 1,136 | testEnumFunctions _ = $(testProperties
[ 'prop_enumFromN, 'prop_enumFromThenN,
'prop_enumFromTo, 'prop_enumFromThenTo])
where
prop_enumFromN :: P (a -> Int -> v a)
= (\_ n -> n < 1000)
===> V.enumFromN `eq` (\x n -> take n $ scanl (+) x $ repeat 1)
prop_enumFromThenN :: P (a -> a -> Int -... | 1,031 | false | true | 0 | 13 | 437 | 544 | 286 | 258 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Desugar710/Check.hs | bsd-3-clause | check' :: [(EqnNo, EquationInfo)]
-> ([ExhaustivePat], -- Pattern scheme that might not be matched at all
EqnSet) -- Eqns that are used (others are overlapped)
check' [] = ([],emptyUniqSet) | 225 | check' :: [(EqnNo, EquationInfo)]
-> ([ExhaustivePat], -- Pattern scheme that might not be matched at all
EqnSet)
check' [] = ([],emptyUniqSet) | 166 | check' [] = ([],emptyUniqSet) | 29 | true | true | 0 | 9 | 64 | 54 | 30 | 24 | null | null |
abakst/symmetry | checker/src/cloud-haskell-tests/Helper.hs | mit | getRandPLInRange b e n = do l <- getRandLInRange b e n
return (map toPeano l) | 105 | getRandPLInRange b e n = do l <- getRandLInRange b e n
return (map toPeano l) | 105 | getRandPLInRange b e n = do l <- getRandLInRange b e n
return (map toPeano l) | 105 | false | false | 0 | 9 | 43 | 41 | 18 | 23 | null | null |
apyrgio/snf-ganeti | src/Ganeti/ConstantUtils.hs | bsd-2-clause | -- * Priority levels
--
-- This is defined here and not in 'Ganeti.Types' in order to avoid a
-- GHC stage restriction and because there is no suitable 'declareADT'
-- variant that handles integer values directly.
priorityLow :: Int
priorityLow = 10 | 250 | priorityLow :: Int
priorityLow = 10 | 35 | priorityLow = 10 | 16 | true | true | 0 | 4 | 43 | 16 | 11 | 5 | null | null |
sol/aeson | Data/Aeson/TH.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Convenience
--------------------------------------------------------------------------------
-- | Generates both 'ToJSON' and 'FromJSON' instance declarations for the given
-- data type or data family instance constructor.
--
-- This i... | 678 | deriveJSON :: Options
-- ^ Encoding options.
-> Name
-- ^ Name of the type for which to generate 'ToJSON' and 'FromJSON'
-- instances.
-> Q [Dec]
deriveJSON = deriveJSONBoth deriveToJSON deriveFromJSON | 256 | deriveJSON = deriveJSONBoth deriveToJSON deriveFromJSON | 55 | true | true | 0 | 8 | 128 | 41 | 26 | 15 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 72501 = 2130 | 32 | getValueFromProduct 72501 = 2130 | 32 | getValueFromProduct 72501 = 2130 | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
pbogdan/ngx-cache-inspector | src/Inspector.hs | bsd-3-clause | matches :: Text -> ByteString -> Bool
matches needle haystack = not . null $ indices (toS needle) haystack | 106 | matches :: Text -> ByteString -> Bool
matches needle haystack = not . null $ indices (toS needle) haystack | 106 | matches needle haystack = not . null $ indices (toS needle) haystack | 68 | false | true | 0 | 8 | 18 | 43 | 21 | 22 | null | null |
mdsteele/fallback | src/Fallback/View/LoadGame.hs | gpl-3.0 | nsSelectedSummary :: InternalState -> SavedGameSummary
nsSelectedSummary ns = nsSummaries ns ! nsSelectedIndex ns | 113 | nsSelectedSummary :: InternalState -> SavedGameSummary
nsSelectedSummary ns = nsSummaries ns ! nsSelectedIndex ns | 113 | nsSelectedSummary ns = nsSummaries ns ! nsSelectedIndex ns | 58 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
ctford/Idris-Elba-dev | src/Idris/Core/TT.hs | bsd-3-clause | -- | Like 'bindAll', but the 'Binder's are 'TT' terms instead.
-- The first argument is a function to map @TT@ terms to @Binder@s.
-- This function might often be something like 'Lam', which directly
-- constructs a @Binder@ from a @TT@ term.
bindTyArgs :: (TT n -> Binder (TT n)) -> [(n, TT n)] -> TT n -> TT n
bindTyAr... | 371 | bindTyArgs :: (TT n -> Binder (TT n)) -> [(n, TT n)] -> TT n -> TT n
bindTyArgs b xs = bindAll (map (\ (n, ty) -> (n, b ty)) xs) | 128 | bindTyArgs b xs = bindAll (map (\ (n, ty) -> (n, b ty)) xs) | 59 | true | true | 0 | 11 | 74 | 108 | 56 | 52 | null | null |
audreyt/line2pdf | src/Text/LineToPDF/Internals.hs | mit | writeLocations :: M ()
writeLocations = do
locs <- IM.elems <$> readRef __LOC__
pr$ concatMap fmt locs
where
fmt x = pad ++ x ++ " 00000 n \r"
where
pad = replicate (10-l) '0'
l = length x | 229 | writeLocations :: M ()
writeLocations = do
locs <- IM.elems <$> readRef __LOC__
pr$ concatMap fmt locs
where
fmt x = pad ++ x ++ " 00000 n \r"
where
pad = replicate (10-l) '0'
l = length x | 229 | writeLocations = do
locs <- IM.elems <$> readRef __LOC__
pr$ concatMap fmt locs
where
fmt x = pad ++ x ++ " 00000 n \r"
where
pad = replicate (10-l) '0'
l = length x | 206 | false | true | 0 | 9 | 79 | 90 | 43 | 47 | null | null |
brendanhay/amqp-bark | bark/src/Bark/Options.hs | bsd-3-clause | addHostName :: Raw -> IO Raw
addHostName raw@Raw{..} =
addHost <$> map f <$> getHostName
where
f '.' = '_'
f c = c
addHost h | null rawHost = raw { rawHost = h }
| otherwise = raw | 216 | addHostName :: Raw -> IO Raw
addHostName raw@Raw{..} =
addHost <$> map f <$> getHostName
where
f '.' = '_'
f c = c
addHost h | null rawHost = raw { rawHost = h }
| otherwise = raw | 216 | addHostName raw@Raw{..} =
addHost <$> map f <$> getHostName
where
f '.' = '_'
f c = c
addHost h | null rawHost = raw { rawHost = h }
| otherwise = raw | 187 | false | true | 0 | 8 | 76 | 94 | 45 | 49 | null | null |
binesiyu/ifl | examples/ch04/EfficientList.hs | mit | {-- /snippet myDumbExample --}
{-- snippet mySmartExample --}
mySmartExample xs = if not (null xs)
then head xs
else 'Z' | 161 | mySmartExample xs = if not (null xs)
then head xs
else 'Z' | 98 | mySmartExample xs = if not (null xs)
then head xs
else 'Z' | 98 | true | false | 0 | 8 | 60 | 31 | 16 | 15 | null | null |
matthiasgoergens/redgrep | src/Final.hs | bsd-3-clause | run (NotX x) = not (run x) | 31 | run (NotX x) = not (run x) | 31 | run (NotX x) = not (run x) | 31 | false | false | 0 | 7 | 11 | 25 | 11 | 14 | null | null |
rueshyna/gogol | gogol-datastore/gen/Network/Google/Datastore/Types/Product.hs | mpl-2.0 | -- | The name of the entity. A name matching regex \`__.*__\` is
-- reserved\/read-only. A name must not be more than 1500 bytes when UTF-8
-- encoded. Cannot be \`\"\"\`.
peName :: Lens' PathElement (Maybe Text)
peName = lens _peName (\ s a -> s{_peName = a}) | 260 | peName :: Lens' PathElement (Maybe Text)
peName = lens _peName (\ s a -> s{_peName = a}) | 88 | peName = lens _peName (\ s a -> s{_peName = a}) | 47 | true | true | 0 | 9 | 47 | 48 | 27 | 21 | null | null |
DanielSchuessler/hstri | Triangulation/GlueMap.hs | gpl-3.0 | -- | Doesn't check the invariant.
unsafeMkGlueMap = UnsafeGM | 60 | unsafeMkGlueMap = UnsafeGM | 26 | unsafeMkGlueMap = UnsafeGM | 26 | true | false | 1 | 5 | 8 | 11 | 4 | 7 | null | null |
r-raymond/purple-muon | src/Server/Frames.hs | gpl-3.0 | manageFps :: STY.Server ()
manageFps = do
start <- fmap (CLE.view STY.frameBegin) get
void $ PUF.manageFps minFrameTime start | 133 | manageFps :: STY.Server ()
manageFps = do
start <- fmap (CLE.view STY.frameBegin) get
void $ PUF.manageFps minFrameTime start | 133 | manageFps = do
start <- fmap (CLE.view STY.frameBegin) get
void $ PUF.manageFps minFrameTime start | 106 | false | true | 0 | 11 | 25 | 54 | 25 | 29 | null | null |
jsavatgy/hatupist | code/settingsDialog.hs | gpl-2.0 | secondsFrom startPt endPt =
a - b
where
a = ptToDouble endPt
b = ptToDouble startPt | 95 | secondsFrom startPt endPt =
a - b
where
a = ptToDouble endPt
b = ptToDouble startPt | 95 | secondsFrom startPt endPt =
a - b
where
a = ptToDouble endPt
b = ptToDouble startPt | 95 | false | false | 3 | 5 | 27 | 46 | 16 | 30 | null | null |
siddhanathan/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | tcEqType :: TcType -> TcType -> Bool
-- tcEqType is a proper, sensible type-equality function, that does
-- just what you'd expect The function Type.eqType (currently) has a
-- grotesque hack that makes OpenKind = *, and that is NOT what we
-- want in the type checker! Otherwise, for example, TcCanonical.reOrient
-- t... | 2,169 | tcEqType :: TcType -> TcType -> Bool
tcEqType ty1 ty2
= go init_env ty1 ty2
where
init_env = mkRnEnv2 (mkInScopeSet (tyVarsOfType ty1 `unionVarSet` tyVarsOfType ty2))
go env t1 t2 | Just t1' <- tcView t1 = go env t1' t2
| Just t2' <- tcView t2 = go env t1 t2'
go env (TyVarTy tv1) ... | 1,765 | tcEqType ty1 ty2
= go init_env ty1 ty2
where
init_env = mkRnEnv2 (mkInScopeSet (tyVarsOfType ty1 `unionVarSet` tyVarsOfType ty2))
go env t1 t2 | Just t1' <- tcView t1 = go env t1' t2
| Just t2' <- tcView t2 = go env t1 t2'
go env (TyVarTy tv1) (TyVarTy tv2) = rnOccL env tv1 ==... | 1,728 | true | true | 11 | 9 | 588 | 531 | 239 | 292 | null | null |
bitemyapp/haskell-vcache | hsrc_lib/Database/VCache/Refct.hs | bsd-2-clause | riteRefctBytes :: Ptr Word8 -> Refct -> IO MDB_val
writeRefctBytes p0 = wrcb p0 0 . toRefctBytes where
wrcb _ n [] = return $! MDB_val { mv_data = p0, mv_size = n }
wrcb p n (b:bs) = do { poke p b ; wrcb (p `plusPtr` 1) (n + 1) bs }
| 241 | writeRefctBytes :: Ptr Word8 -> Refct -> IO MDB_val
writeRefctBytes p0 = wrcb p0 0 . toRefctBytes where
wrcb _ n [] = return $! MDB_val { mv_data = p0, mv_size = n }
wrcb p n (b:bs) = do { poke p b ; wrcb (p `plusPtr` 1) (n + 1) bs } | 241 | writeRefctBytes p0 = wrcb p0 0 . toRefctBytes where
wrcb _ n [] = return $! MDB_val { mv_data = p0, mv_size = n }
wrcb p n (b:bs) = do { poke p b ; wrcb (p `plusPtr` 1) (n + 1) bs } | 189 | false | true | 3 | 9 | 62 | 136 | 67 | 69 | null | null |
okue/Haskyapi | src/Web/Haskyapi/Header.hs | mit | toCType "png" = Cpng | 22 | toCType "png" = Cpng | 22 | toCType "png" = Cpng | 22 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
urbanslug/ghc | compiler/main/DynFlags.hs | bsd-3-clause | intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix fn = IntSuffix (\n -> upd (fn n)) | 117 | intSuffix :: (Int -> DynFlags -> DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffix fn = IntSuffix (\n -> upd (fn n)) | 117 | intSuffix fn = IntSuffix (\n -> upd (fn n)) | 43 | false | true | 0 | 10 | 19 | 62 | 30 | 32 | null | null |
nightscape/platform | node/src/Unison/Runtime/Stream.hs | mit | uncons :: Stream f a r -> Free f (Either r (a, Stream f a r))
uncons s = case s of
Free.Pure r -> pure (Left r)
Free.Bind (Effect fx) k -> Free.eval fx >>= (uncons . k)
Free.Bind (Emit a) k -> pure (Right (a, k ())) | 221 | uncons :: Stream f a r -> Free f (Either r (a, Stream f a r))
uncons s = case s of
Free.Pure r -> pure (Left r)
Free.Bind (Effect fx) k -> Free.eval fx >>= (uncons . k)
Free.Bind (Emit a) k -> pure (Right (a, k ())) | 221 | uncons s = case s of
Free.Pure r -> pure (Left r)
Free.Bind (Effect fx) k -> Free.eval fx >>= (uncons . k)
Free.Bind (Emit a) k -> pure (Right (a, k ())) | 159 | false | true | 0 | 13 | 54 | 153 | 73 | 80 | null | null |
Soostone/uri-bytestring | src/URI/ByteString/Internal.hs | bsd-3-clause | -- | Like 'parseURI', but do not parse scheme.
parseRelativeRef :: URIParserOptions -> ByteString -> Either URIParseError (URIRef Relative)
parseRelativeRef opts = parseOnly' OtherError (relativeRefParser' opts) | 211 | parseRelativeRef :: URIParserOptions -> ByteString -> Either URIParseError (URIRef Relative)
parseRelativeRef opts = parseOnly' OtherError (relativeRefParser' opts) | 164 | parseRelativeRef opts = parseOnly' OtherError (relativeRefParser' opts) | 71 | true | true | 0 | 9 | 25 | 45 | 22 | 23 | null | null |
vladfi1/hs-misc | Bug.hs | mit | do_step :: (Numerical num) => num -> Box a -> Box a
do_step number Box{..} = Box{ obj = func number obj, .. } | 109 | do_step :: (Numerical num) => num -> Box a -> Box a
do_step number Box{..} = Box{ obj = func number obj, .. } | 109 | do_step number Box{..} = Box{ obj = func number obj, .. } | 57 | false | true | 0 | 8 | 23 | 61 | 31 | 30 | null | null |
ekmett/reactor | Reactor/Observable.hs | bsd-3-clause | safe :: Observable a -> Observable a
safe p = Observable $ \o -> do
alive <- atomic (1 :: Int)
subscribe_ p
(\a -> given alive $ o ! a)
(\e -> clearing alive $ handle o e)
(clearing alive $ complete o) | 223 | safe :: Observable a -> Observable a
safe p = Observable $ \o -> do
alive <- atomic (1 :: Int)
subscribe_ p
(\a -> given alive $ o ! a)
(\e -> clearing alive $ handle o e)
(clearing alive $ complete o) | 222 | safe p = Observable $ \o -> do
alive <- atomic (1 :: Int)
subscribe_ p
(\a -> given alive $ o ! a)
(\e -> clearing alive $ handle o e)
(clearing alive $ complete o) | 185 | false | true | 2 | 14 | 65 | 119 | 56 | 63 | null | null |
EdisonCodeKeeper/hacker-rank | practice/fp/ds/kmp-fp/kmp-fp.hs | mit | matchFold :: Eq a => Automaton a -> [a] -> ([a] -> b -> b) -> ([a] -> b -> b) -> b -> b
matchFold _ [] _ _ identity = identity | 126 | matchFold :: Eq a => Automaton a -> [a] -> ([a] -> b -> b) -> ([a] -> b -> b) -> b -> b
matchFold _ [] _ _ identity = identity | 126 | matchFold _ [] _ _ identity = identity | 38 | false | true | 0 | 12 | 32 | 85 | 44 | 41 | null | null |
jameysharp/lotos | LOTOS/Simplify.hs | gpl-2.0 | hideB' :: [Gate] -> Behavior -> FreshM Behavior
hideB' gs b = return $ case Set.toList $ Set.fromList gs `gatesFreeIn` b of
[] -> b
gs' -> Hide $ bind gs' b | 164 | hideB' :: [Gate] -> Behavior -> FreshM Behavior
hideB' gs b = return $ case Set.toList $ Set.fromList gs `gatesFreeIn` b of
[] -> b
gs' -> Hide $ bind gs' b | 164 | hideB' gs b = return $ case Set.toList $ Set.fromList gs `gatesFreeIn` b of
[] -> b
gs' -> Hide $ bind gs' b | 116 | false | true | 2 | 10 | 39 | 81 | 39 | 42 | null | null |
spacekitteh/compdata | src/Data/Comp/Thunk.hs | bsd-3-clause | -- | This combinator runs a monadic catamorphism on a term with thunks
cataTM :: forall m f a . (Traversable f, Monad m) => AlgM m f a -> TermT m f -> m a
cataTM alg = run where
-- implemented directly, otherwise Traversable m constraint needed
run :: TermT m f -> m a
run (Term (Inl m)) = m >>= run
run ... | 421 | cataTM :: forall m f a . (Traversable f, Monad m) => AlgM m f a -> TermT m f -> m a
cataTM alg = run where
-- implemented directly, otherwise Traversable m constraint needed
run :: TermT m f -> m a
run (Term (Inl m)) = m >>= run
run (Term (Inr t)) = mapM run t >>= alg
-- | This combinator runs a catam... | 350 | cataTM alg = run where
-- implemented directly, otherwise Traversable m constraint needed
run :: TermT m f -> m a
run (Term (Inl m)) = m >>= run
run (Term (Inr t)) = mapM run t >>= alg
-- | This combinator runs a catamorphism on a term with thunks. | 266 | true | true | 0 | 11 | 104 | 134 | 68 | 66 | null | null |
emmanueltouzery/imprint | src/Main.hs | mit | prepareErrorsTreeView :: TreeView -> IO (ListStore ErrorInfo)
prepareErrorsTreeView errorsTreeview = do
treeViewGetColumns errorsTreeview >>= mapM_ (treeViewRemoveColumn errorsTreeview)
errorsStore <- listStoreNew [ ErrorInfo "-" $ __ "Started the processing..."]
treeViewSetModel errorsTreeview errorsStore
... | 561 | prepareErrorsTreeView :: TreeView -> IO (ListStore ErrorInfo)
prepareErrorsTreeView errorsTreeview = do
treeViewGetColumns errorsTreeview >>= mapM_ (treeViewRemoveColumn errorsTreeview)
errorsStore <- listStoreNew [ ErrorInfo "-" $ __ "Started the processing..."]
treeViewSetModel errorsTreeview errorsStore
... | 561 | prepareErrorsTreeView errorsTreeview = do
treeViewGetColumns errorsTreeview >>= mapM_ (treeViewRemoveColumn errorsTreeview)
errorsStore <- listStoreNew [ ErrorInfo "-" $ __ "Started the processing..."]
treeViewSetModel errorsTreeview errorsStore
treeViewSetFixedHeightMode errorsTreeview False
treeVi... | 499 | false | true | 0 | 11 | 83 | 145 | 65 | 80 | null | null |
mwu-tow/cuda | Setup.hs | bsd-3-clause | ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppC2hs bi lbi
= PreProcessor {
platformIndependent = False,
runPreProcessor = \(inBaseDir, inRelativeFile)
(outBaseDir, outRelativeFile) verbosity ->
rawSystemProgramConf verbosity c2hsProgram (withPro... | 693 | ppC2hs :: BuildInfo -> LocalBuildInfo -> PreProcessor
ppC2hs bi lbi
= PreProcessor {
platformIndependent = False,
runPreProcessor = \(inBaseDir, inRelativeFile)
(outBaseDir, outRelativeFile) verbosity ->
rawSystemProgramConf verbosity c2hsProgram (withPro... | 693 | ppC2hs bi lbi
= PreProcessor {
platformIndependent = False,
runPreProcessor = \(inBaseDir, inRelativeFile)
(outBaseDir, outRelativeFile) verbosity ->
rawSystemProgramConf verbosity c2hsProgram (withPrograms lbi) . filter (not . null) $
maybe [... | 639 | false | true | 0 | 17 | 217 | 182 | 94 | 88 | null | null |
fhsjaagshs/niagra | src/Data/Niagra/Selector/Combinators.hs | mit | -- |Selects the current active element.
target :: Selector
target = pseudoClass' "target" | 89 | target :: Selector
target = pseudoClass' "target" | 49 | target = pseudoClass' "target" | 30 | true | true | 0 | 5 | 12 | 15 | 8 | 7 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 4100 = 4099 | 11 | 4100 = 4099 | 11 | 4100 = 4099 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.