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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
polar-engine/polar-configfile | src/Polar/ConfigFile/Lexer.hs | bsd-3-clause | comment_chars :: CharParser st Char
comment_chars = oneOf "#;" | 62 | comment_chars :: CharParser st Char
comment_chars = oneOf "#;" | 62 | comment_chars = oneOf "#;" | 26 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
ezyang/ghc | compiler/backpack/RnModIface.hs | bsd-3-clause | rnIfaceExpr :: Rename IfaceExpr
rnIfaceExpr (IfaceLcl name) = pure (IfaceLcl name) | 82 | rnIfaceExpr :: Rename IfaceExpr
rnIfaceExpr (IfaceLcl name) = pure (IfaceLcl name) | 82 | rnIfaceExpr (IfaceLcl name) = pure (IfaceLcl name) | 50 | false | true | 0 | 7 | 10 | 32 | 15 | 17 | null | null |
Hrothen/scripts | src/convertPNG/ConvertImage.hs | mit | parsePhases :: String -> [Phase]
parsePhases "" = [] | 55 | parsePhases :: String -> [Phase]
parsePhases "" = [] | 55 | parsePhases "" = [] | 22 | false | true | 0 | 8 | 11 | 29 | 13 | 16 | null | null |
jozefg/ds-kanren | test/QuickCheckHelper.hs | mit | mkTerm :: [Term] -> Gen Term
mkTerm vars = frequency $
case vars of
[] -> closedConstructs
_ -> (20, elements vars) : closedConstructs
where closedConstructs = [ (50, Atom <$> (listOf . elements $ ['a' .. 'z']))
, (5, Pair <$> mkTerm vars <*> mkTerm vars)] | 294 | mkTerm :: [Term] -> Gen Term
mkTerm vars = frequency $
case vars of
[] -> closedConstructs
_ -> (20, elements vars) : closedConstructs
where closedConstructs = [ (50, Atom <$> (listOf . elements $ ['a' .. 'z']))
, (5, Pair <$> mkTerm vars <*> mkTerm vars)] | 294 | mkTerm vars = frequency $
case vars of
[] -> closedConstructs
_ -> (20, elements vars) : closedConstructs
where closedConstructs = [ (50, Atom <$> (listOf . elements $ ['a' .. 'z']))
, (5, Pair <$> mkTerm vars <*> mkTerm vars)] | 265 | false | true | 0 | 11 | 84 | 120 | 64 | 56 | null | null |
bredelings/BAli-Phy | haskell/Probability/Distribution/Tree.hs | gpl-2.0 | uniform_topology_edges [l1, l2] _ = return [(l1, l2)] | 60 | uniform_topology_edges [l1, l2] _ = return [(l1, l2)] | 60 | uniform_topology_edges [l1, l2] _ = return [(l1, l2)] | 60 | false | false | 0 | 7 | 14 | 29 | 16 | 13 | null | null |
kazu-yamamoto/http2 | Network/HPACK/Token.hs | bsd-3-clause | tokenIfMatch = Token 29 True False "If-Match" | 63 | tokenIfMatch = Token 29 True False "If-Match" | 63 | tokenIfMatch = Token 29 True False "If-Match" | 63 | false | false | 0 | 5 | 24 | 15 | 7 | 8 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Text.Read.hs | bsd-3-clause | hexadecimal txt
| h == "0x" || h == "0X" = hex t
| otherwise = hex txt
where (h,t) = T.splitAt 2 txt | 122 | hexadecimal txt
| h == "0x" || h == "0X" = hex t
| otherwise = hex txt
where (h,t) = T.splitAt 2 txt | 122 | hexadecimal txt
| h == "0x" || h == "0X" = hex t
| otherwise = hex txt
where (h,t) = T.splitAt 2 txt | 122 | false | false | 1 | 10 | 45 | 61 | 29 | 32 | null | null |
mightymoose/liquidhaskell | tests/neg/deppair0.hs | bsd-3-clause | baz x = (x, incr x) | 19 | baz x = (x, incr x) | 19 | baz x = (x, incr x) | 19 | false | false | 0 | 6 | 5 | 18 | 9 | 9 | null | null |
kaoskorobase/mescaline | lib/mescaline-database/Mescaline/Database.hs | gpl-3.0 | transformFeatureP ::
(MonadControlIO m) =>
Transformation
-> [DescriptorId]
-> Analysis.Descriptor
-> SqlPersist m ()
transformFeatureP (Transformation func) srcFeatures dstFeature = do
-- fs <- liftM L.transpose $ mapM (\d -> E.run_ $ DB.select [DB.FeatureDescriptorEq d] [DB.FeatureUnitAsc] 0 0 $$ E.con... | 953 | transformFeatureP ::
(MonadControlIO m) =>
Transformation
-> [DescriptorId]
-> Analysis.Descriptor
-> SqlPersist m ()
transformFeatureP (Transformation func) srcFeatures dstFeature = do
-- fs <- liftM L.transpose $ mapM (\d -> E.run_ $ DB.select [DB.FeatureDescriptorEq d] [DB.FeatureUnitAsc] 0 0 $$ E.con... | 953 | transformFeatureP (Transformation func) srcFeatures dstFeature = do
-- fs <- liftM L.transpose $ mapM (\d -> E.run_ $ DB.select [DB.FeatureDescriptorEq d] [DB.FeatureUnitAsc] 0 0 $$ E.consume) srcFeatures
-- liftIO $ print fs
(d, _) <- getDescriptor (Analysis.name dstFeature) (Analysis.degree dstFeature)
... | 824 | false | true | 0 | 19 | 191 | 213 | 106 | 107 | null | null |
keera-studios/hsQt | Qtc/Gui/QFileDialog.hs | bsd-2-clause | fileMode :: QFileDialog a -> (()) -> IO (FileMode)
fileMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QFileDialog_fileMode cobj_x0 | 159 | fileMode :: QFileDialog a -> (()) -> IO (FileMode)
fileMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QFileDialog_fileMode cobj_x0 | 159 | fileMode x0 ()
= withQEnumResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QFileDialog_fileMode cobj_x0 | 108 | false | true | 0 | 8 | 31 | 59 | 29 | 30 | null | null |
ml9951/ghc | compiler/main/GhcMake.hs | bsd-3-clause | -- | If there are {-# SOURCE #-} imports between strongly connected
-- components in the topological sort, then those imports can
-- definitely be replaced by ordinary non-SOURCE imports: if SOURCE
-- were necessary, then the edge would be part of a cycle.
warnUnnecessarySourceImports :: GhcMonad m => [SCC ModSummary] ... | 973 | warnUnnecessarySourceImports :: GhcMonad m => [SCC ModSummary] -> m ()
warnUnnecessarySourceImports sccs = do
dflags <- getDynFlags
when (wopt Opt_WarnUnusedImports dflags)
(logWarnings (listToBag (concatMap (check dflags . flattenSCC) sccs)))
where check dflags ms =
let mods_in_this_cycle = map ms... | 716 | warnUnnecessarySourceImports sccs = do
dflags <- getDynFlags
when (wopt Opt_WarnUnusedImports dflags)
(logWarnings (listToBag (concatMap (check dflags . flattenSCC) sccs)))
where check dflags ms =
let mods_in_this_cycle = map ms_mod_name ms in
[ warn dflags i | m <- ms, i <- ms_home_srci... | 645 | true | true | 2 | 16 | 256 | 228 | 111 | 117 | null | null |
ulricha/dsh | src/Database/DSH/VSL/Opt/Rewrite/Redundant.hs | bsd-3-clause | distLiftProjectRight ::VSLRule TExpr TExpr ()
distLiftProjectRight q =
$(dagPatMatch 'q "R1 ((q1) ReplicateSeg (Project e (q2)))"
[| do
return $ do
logRewrite "Redundant.ReplicateSeg.Project.Right" q
let e' = appExprSnd $(v "e")
distNode <- insert $ BinOp ReplicateSeg $(v "q1... | 445 | distLiftProjectRight ::VSLRule TExpr TExpr ()
distLiftProjectRight q =
$(dagPatMatch 'q "R1 ((q1) ReplicateSeg (Project e (q2)))"
[| do
return $ do
logRewrite "Redundant.ReplicateSeg.Project.Right" q
let e' = appExprSnd $(v "e")
distNode <- insert $ BinOp ReplicateSeg $(v "q1... | 445 | distLiftProjectRight q =
$(dagPatMatch 'q "R1 ((q1) ReplicateSeg (Project e (q2)))"
[| do
return $ do
logRewrite "Redundant.ReplicateSeg.Project.Right" q
let e' = appExprSnd $(v "e")
distNode <- insert $ BinOp ReplicateSeg $(v "q1") $(v "q2")
r1Node <- insert $ Un... | 399 | false | true | 0 | 7 | 122 | 38 | 20 | 18 | null | null |
uduki/hsQt | Qtc/Core/QUuid.hs | bsd-2-clause | data3 :: QUuid a -> (()) -> IO (Int)
data3 x0 ()
= withUnsignedShortResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QUuid_data3 cobj_x0 | 141 | data3 :: QUuid a -> (()) -> IO (Int)
data3 x0 ()
= withUnsignedShortResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QUuid_data3 cobj_x0 | 141 | data3 x0 ()
= withUnsignedShortResult $
withObjectPtr x0 $ \cobj_x0 ->
qtc_QUuid_data3 cobj_x0 | 104 | false | true | 0 | 8 | 31 | 59 | 29 | 30 | null | null |
ozgurakgun/Idris-dev | src/Idris/REPL/Parser.hs | bsd-3-clause | namespaceArg :: ([String] -> Command) -> String -> P.IdrisParser (Either String Command)
namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "." | 187 | namespaceArg :: ([String] -> Command) -> String -> P.IdrisParser (Either String Command)
namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "." | 187 | namespaceArg = genArg "namespace" (fmap (toNS . fst) P.identifier)
where
toNS = splitOn "." | 98 | false | true | 0 | 9 | 32 | 75 | 38 | 37 | null | null |
homam/fsm-conversational-ui | src/Test2.hs | bsd-3-clause | getTwoNumbersEdge = Edge {
node = getANumber,
link = \ (InInt i) (StInts s) -> (if length s < 2 then getTwoNumbersEdge else getAnOperationLink, InAny (), StInts (i:s))
} | 173 | getTwoNumbersEdge = Edge {
node = getANumber,
link = \ (InInt i) (StInts s) -> (if length s < 2 then getTwoNumbersEdge else getAnOperationLink, InAny (), StInts (i:s))
} | 173 | getTwoNumbersEdge = Edge {
node = getANumber,
link = \ (InInt i) (StInts s) -> (if length s < 2 then getTwoNumbersEdge else getAnOperationLink, InAny (), StInts (i:s))
} | 173 | false | false | 1 | 12 | 32 | 82 | 43 | 39 | null | null |
eklavya/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTTName t = fail ("Unknown reflection term name: " ++ show t) | 65 | reifyTTName t = fail ("Unknown reflection term name: " ++ show t) | 65 | reifyTTName t = fail ("Unknown reflection term name: " ++ show t) | 65 | false | false | 0 | 8 | 11 | 22 | 10 | 12 | null | null |
afcowie/vaultaire | src/DemoWave.hs | bsd-3-clause | -- | Command line option parsing
helpfulParser :: ParserInfo Options
helpfulParser = info (helper <*> optionsParser) fullDesc | 126 | helpfulParser :: ParserInfo Options
helpfulParser = info (helper <*> optionsParser) fullDesc | 92 | helpfulParser = info (helper <*> optionsParser) fullDesc | 56 | true | true | 0 | 7 | 17 | 27 | 14 | 13 | null | null |
jyp/ling | Ling/Print.hs | bsd-3-clause | -- the top-level printing method
printTree :: Print a => a -> String
printTree = render . prt 0 | 95 | printTree :: Print a => a -> String
printTree = render . prt 0 | 62 | printTree = render . prt 0 | 26 | true | true | 0 | 6 | 18 | 30 | 15 | 15 | null | null |
dongarerahul/edx-haskell | chapter-9.hs | apache-2.0 | balanced (Node' l r) = abs (leaves' l - leaves' r) <= 1 &&
balanced l &&
balanced r | 131 | balanced (Node' l r) = abs (leaves' l - leaves' r) <= 1 &&
balanced l &&
balanced r | 131 | balanced (Node' l r) = abs (leaves' l - leaves' r) <= 1 &&
balanced l &&
balanced r | 131 | false | false | 0 | 11 | 66 | 51 | 23 | 28 | null | null |
knupfer/ninety-nine | test/Main.hs | gpl-2.0 | p31 :: Int -> Bool
p31 n = (==) n . head . dropWhile (<n) $ primes | 66 | p31 :: Int -> Bool
p31 n = (==) n . head . dropWhile (<n) $ primes | 66 | p31 n = (==) n . head . dropWhile (<n) $ primes | 47 | false | true | 4 | 7 | 16 | 51 | 23 | 28 | null | null |
rodrigofegui/UnB | 2017.2/Linguagens de Programação/Trab 2/F6LAE.hs | gpl-3.0 | reduzir clo@(Closure argFor corpo sbsP) _ = clo | 47 | reduzir clo@(Closure argFor corpo sbsP) _ = clo | 47 | reduzir clo@(Closure argFor corpo sbsP) _ = clo | 47 | false | false | 0 | 8 | 7 | 24 | 12 | 12 | null | null |
peterokagey/haskellOEIS | src/Graham/A328045.hs | apache-2.0 | raiseUp :: [Integer] -> [[Integer]]
raiseUp = foldr (\a -> concatMap (\ts -> [a^1 : ts, a^2 : ts, a^3 : ts])) [[]] | 114 | raiseUp :: [Integer] -> [[Integer]]
raiseUp = foldr (\a -> concatMap (\ts -> [a^1 : ts, a^2 : ts, a^3 : ts])) [[]] | 114 | raiseUp = foldr (\a -> concatMap (\ts -> [a^1 : ts, a^2 : ts, a^3 : ts])) [[]] | 78 | false | true | 0 | 13 | 22 | 86 | 48 | 38 | null | null |
mzini/termlib | Termlib/Problem/TpdbParser.hs | gpl-3.0 | whitespace :: TPDBParser Char
whitespace = space <|> newline <|> tab <|> char '\r' | 82 | whitespace :: TPDBParser Char
whitespace = space <|> newline <|> tab <|> char '\r' | 82 | whitespace = space <|> newline <|> tab <|> char '\r' | 52 | false | true | 1 | 7 | 13 | 32 | 14 | 18 | null | null |
vito/atomo | src/Atomo/Types.hs | bsd-3-clause | objectFrom ids (Expression _) = idExpression ids | 48 | objectFrom ids (Expression _) = idExpression ids | 48 | objectFrom ids (Expression _) = idExpression ids | 48 | false | false | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
roberth/uu-helium | src/Helium/StaticAnalysis/Heuristics/RepairSystem.hs | gpl-3.0 | repairSystem :: Heuristic ConstraintInfo
repairSystem = Heuristic (Filter "Repair System" handleList)
where
handleList :: HasTypeGraph m ConstraintInfo => [(EdgeId, ConstraintInfo)] -> m [(EdgeId, ConstraintInfo)]
handleList xs =
do aexprs <- recList xs
printMessage "\n========== Begin of Repair ... | 1,391 | repairSystem :: Heuristic ConstraintInfo
repairSystem = Heuristic (Filter "Repair System" handleList)
where
handleList :: HasTypeGraph m ConstraintInfo => [(EdgeId, ConstraintInfo)] -> m [(EdgeId, ConstraintInfo)]
handleList xs =
do aexprs <- recList xs
printMessage "\n========== Begin of Repair ... | 1,391 | repairSystem = Heuristic (Filter "Repair System" handleList)
where
handleList :: HasTypeGraph m ConstraintInfo => [(EdgeId, ConstraintInfo)] -> m [(EdgeId, ConstraintInfo)]
handleList xs =
do aexprs <- recList xs
printMessage "\n========== Begin of Repair System ===========\n"
printMessa... | 1,350 | false | true | 23 | 14 | 408 | 419 | 217 | 202 | null | null |
uuhan/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | updateDef :: Name -> (a -> a) -> Ctxt a -> Ctxt a
updateDef n f ctxt
= case lookupCtxtExact n ctxt of
Just t -> addDef n (f t) ctxt
Nothing -> ctxt | 167 | updateDef :: Name -> (a -> a) -> Ctxt a -> Ctxt a
updateDef n f ctxt
= case lookupCtxtExact n ctxt of
Just t -> addDef n (f t) ctxt
Nothing -> ctxt | 167 | updateDef n f ctxt
= case lookupCtxtExact n ctxt of
Just t -> addDef n (f t) ctxt
Nothing -> ctxt | 117 | false | true | 0 | 10 | 53 | 80 | 38 | 42 | null | null |
kkdg/haskell-jogging | 01/0118/main.hs | apache-2.0 | d = 5:[1,2,3,4,5] | 17 | d = 5:[1,2,3,4,5] | 17 | d = 5:[1,2,3,4,5] | 17 | false | false | 1 | 6 | 2 | 28 | 15 | 13 | null | null |
blt/core_erlang | Language/Erlang/Lexer.hs | mit | -- natural = Tok.natural lexer
-- naturalOrFloat = Tok.naturalOrFloat lexer
-- octal = Tok.octal lexer
-- operator = Tok.operator lexer
-- parens = Tok.parens lexer
-- reserved = Tok.reserved lexer
-- reservedOp = Tok.reservedOp lexer
-- semi = Tok.semi lexer
-- semiSep... | 464 | symbol = Tok.symbol lexer | 33 | symbol = Tok.symbol lexer | 33 | true | false | 0 | 6 | 130 | 22 | 16 | 6 | null | null |
sourcegraph/srclib-haskell | src/Locations.hs | mit | mkMaybe True x = Just x | 23 | mkMaybe True x = Just x | 23 | mkMaybe True x = Just x | 23 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
ScrambledEggsOnToast/kdt | lib-src/Data/KdMap/Static.hs | mit | -- | Builds a 'KdMap' with a single point-value pair.
singleton :: Real a => PointAsListFn a p -> (p, v) -> KdMap a p v
singleton p2l (p, v) = singletonWithDist p2l (defaultSqrDist p2l) (p, v) | 192 | singleton :: Real a => PointAsListFn a p -> (p, v) -> KdMap a p v
singleton p2l (p, v) = singletonWithDist p2l (defaultSqrDist p2l) (p, v) | 138 | singleton p2l (p, v) = singletonWithDist p2l (defaultSqrDist p2l) (p, v) | 72 | true | true | 0 | 8 | 36 | 75 | 39 | 36 | null | null |
hackern/network-hans | src/Hans/Socket/Handle.hs | bsd-3-clause | makeHansHandle :: Socket -> IOMode -> IO Handle
makeHansHandle socket mode =
do buffSocket <- newBufferedSocket socket
mkFileHandle buffSocket "<socket>" mode Nothing noNewlineTranslation | 194 | makeHansHandle :: Socket -> IOMode -> IO Handle
makeHansHandle socket mode =
do buffSocket <- newBufferedSocket socket
mkFileHandle buffSocket "<socket>" mode Nothing noNewlineTranslation | 194 | makeHansHandle socket mode =
do buffSocket <- newBufferedSocket socket
mkFileHandle buffSocket "<socket>" mode Nothing noNewlineTranslation | 146 | false | true | 0 | 9 | 29 | 56 | 24 | 32 | null | null |
chemist/highlighter | src/Text/Highlighter/Lexers/Groff.hs | bsd-3-clause | lexer :: Lexer
lexer = Lexer
{ lName = "Groff"
, lAliases = ["groff", "nroff", "man"]
, lExtensions = [".[1234567]", ".man"]
, lMimetypes = ["application/x-troff", "text/troff"]
, lStart = root'
, lFlags = [multiline]
} | 247 | lexer :: Lexer
lexer = Lexer
{ lName = "Groff"
, lAliases = ["groff", "nroff", "man"]
, lExtensions = [".[1234567]", ".man"]
, lMimetypes = ["application/x-troff", "text/troff"]
, lStart = root'
, lFlags = [multiline]
} | 247 | lexer = Lexer
{ lName = "Groff"
, lAliases = ["groff", "nroff", "man"]
, lExtensions = [".[1234567]", ".man"]
, lMimetypes = ["application/x-troff", "text/troff"]
, lStart = root'
, lFlags = [multiline]
} | 232 | false | true | 0 | 8 | 62 | 83 | 49 | 34 | null | null |
tuturto/space-privateers | GameDefinition/Content/ModeKind.hs | bsd-3-clause | battle = ModeKind
{ msymbol = 'b'
, mname = "battle"
, mfreq = [("battle", 1)]
, mroster = rosterBattle
, mcaves = cavesBattle
, mdesc = "(This mode is intended solely for automated testing.)"
} | 215 | battle = ModeKind
{ msymbol = 'b'
, mname = "battle"
, mfreq = [("battle", 1)]
, mroster = rosterBattle
, mcaves = cavesBattle
, mdesc = "(This mode is intended solely for automated testing.)"
} | 215 | battle = ModeKind
{ msymbol = 'b'
, mname = "battle"
, mfreq = [("battle", 1)]
, mroster = rosterBattle
, mcaves = cavesBattle
, mdesc = "(This mode is intended solely for automated testing.)"
} | 215 | false | false | 0 | 9 | 56 | 57 | 35 | 22 | null | null |
vituscze/norri | src/Compiler/Pretty.hs | bsd-3-clause | -- | Pretty print a type given a precedence level of the surrounding context.
prettyTypePrec :: Int -> Type -> ShowS
prettyTypePrec = go
where
-- Precendence levels.
[apP, arP] = [10, 1] :: [Int]
go _ (TyData d) = str d
go _ (TyGen i) = str "g" . shows i
go _ (TyVar v) = str v
go p (TyAp... | 661 | prettyTypePrec :: Int -> Type -> ShowS
prettyTypePrec = go
where
-- Precendence levels.
[apP, arP] = [10, 1] :: [Int]
go _ (TyData d) = str d
go _ (TyGen i) = str "g" . shows i
go _ (TyVar v) = str v
go p (TyApp t u) = showParen (p > apP) . concatD $
[ go apP t
, str " "
... | 583 | prettyTypePrec = go
where
-- Precendence levels.
[apP, arP] = [10, 1] :: [Int]
go _ (TyData d) = str d
go _ (TyGen i) = str "g" . shows i
go _ (TyVar v) = str v
go p (TyApp t u) = showParen (p > apP) . concatD $
[ go apP t
, str " "
, go (apP + 1) u
]
... | 544 | true | true | 2 | 10 | 237 | 265 | 130 | 135 | null | null |
ml9951/ghc | compiler/main/DynFlags.hs | bsd-3-clause | -- | Define a new flag invisible to CLI completion.
flagHiddenSpec :: String -> flag -> FlagSpec flag
flagHiddenSpec name flag = flagHiddenSpec' name flag nop | 158 | flagHiddenSpec :: String -> flag -> FlagSpec flag
flagHiddenSpec name flag = flagHiddenSpec' name flag nop | 106 | flagHiddenSpec name flag = flagHiddenSpec' name flag nop | 56 | true | true | 0 | 7 | 25 | 35 | 17 | 18 | null | null |
mgold/Elm | src/Parse/Helpers.hs | bsd-3-clause | glSource :: String -> Either ParseError L.GLShaderTipe
glSource src =
case GLP.parse src of
Left e -> Left e
Right (GLS.TranslationUnit decls) ->
map extractGLinputs decls
|> join
|> foldr addGLinput emptyDecls
|> Right
where
(|>) = flip ($)
emptyDecls = L.GLShaderTipe... | 1,749 | glSource :: String -> Either ParseError L.GLShaderTipe
glSource src =
case GLP.parse src of
Left e -> Left e
Right (GLS.TranslationUnit decls) ->
map extractGLinputs decls
|> join
|> foldr addGLinput emptyDecls
|> Right
where
(|>) = flip ($)
emptyDecls = L.GLShaderTipe... | 1,749 | glSource src =
case GLP.parse src of
Left e -> Left e
Right (GLS.TranslationUnit decls) ->
map extractGLinputs decls
|> join
|> foldr addGLinput emptyDecls
|> Right
where
(|>) = flip ($)
emptyDecls = L.GLShaderTipe Map.empty Map.empty Map.empty
addGLinput (qual,ti... | 1,694 | false | true | 4 | 19 | 658 | 581 | 289 | 292 | null | null |
sharpjs/haskell-learning | src/Aex/Types.hs | gpl-3.0 | isSized (FloatT (Just _)) = True | 32 | isSized (FloatT (Just _)) = True | 32 | isSized (FloatT (Just _)) = True | 32 | false | false | 0 | 8 | 5 | 22 | 10 | 12 | null | null |
meditans/haskell-webapps | doc/hakyll/site.hs | mit | postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext | 97 | postCtx :: Context String
postCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext | 97 | postCtx =
dateField "date" "%B %e, %Y" `mappend`
defaultContext | 71 | false | true | 0 | 6 | 20 | 31 | 14 | 17 | null | null |
jmct/IterativeCompiler | frontend/Heap.hs | mit | showAddr :: Int -> String
showAddr a = "#" ++ show a | 52 | showAddr :: Int -> String
showAddr a = "#" ++ show a | 52 | showAddr a = "#" ++ show a | 26 | false | true | 0 | 7 | 11 | 30 | 13 | 17 | null | null |
pmlodawski/signal | src/System/Signal.hs | mit | -- | SIGINT - CTRL+C signal
sigINT :: Signal
sigINT = 2 | 55 | sigINT :: Signal
sigINT = 2 | 27 | sigINT = 2 | 10 | true | true | 0 | 6 | 11 | 19 | 8 | 11 | null | null |
IanConnolly/aws-sdk-fork | AWS/Lib/Query.hs | bsd-3-clause | checkStatus' ::
H.Status -> H.ResponseHeaders -> HTTP.CookieJar -> Maybe SomeException
checkStatus' = \s@(H.Status sci _) hs cookie ->
if 200 <= sci && sci < 300 || 400 <= sci
then Nothing
else Just $ toException $ HTTP.StatusCodeException s hs cookie | 275 | checkStatus' ::
H.Status -> H.ResponseHeaders -> HTTP.CookieJar -> Maybe SomeException
checkStatus' = \s@(H.Status sci _) hs cookie ->
if 200 <= sci && sci < 300 || 400 <= sci
then Nothing
else Just $ toException $ HTTP.StatusCodeException s hs cookie | 275 | checkStatus' = \s@(H.Status sci _) hs cookie ->
if 200 <= sci && sci < 300 || 400 <= sci
then Nothing
else Just $ toException $ HTTP.StatusCodeException s hs cookie | 184 | false | true | 0 | 11 | 64 | 99 | 51 | 48 | null | null |
siddhanathan/ghc | testsuite/tests/rename/should_compile/timing001.hs | bsd-3-clause | a454 = a455 | 11 | a454 = a455 | 11 | a454 = a455 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
junjihashimoto/yesod-raml | yesod-raml-mock-server/Application.hs | mit | -- | Run DB queries
db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a
db = handler . runDB | 93 | db :: ReaderT SqlBackend (HandlerT App IO) a -> IO a
db = handler . runDB | 73 | db = handler . runDB | 20 | true | true | 0 | 9 | 20 | 44 | 20 | 24 | null | null |
danidiaz/pianola | src/Pianola/Protocol/IO.hs | mit | runFree:: (MonadIO m, MonadReader r m) => (r -> Endpoint) -> Free ProtocolF a -> ErrorT RunInIOError m a
runFree lens ( Free (Compose (b,parser)) ) = do
endpoint <- lift $ asks lens
let rpcCall :: Endpoint -> (Handle -> IO b) -> IO b
rpcCall endpointoint what2do = withSocketsDo $ do
brac... | 896 | runFree:: (MonadIO m, MonadReader r m) => (r -> Endpoint) -> Free ProtocolF a -> ErrorT RunInIOError m a
runFree lens ( Free (Compose (b,parser)) ) = do
endpoint <- lift $ asks lens
let rpcCall :: Endpoint -> (Handle -> IO b) -> IO b
rpcCall endpointoint what2do = withSocketsDo $ do
bracke... | 894 | runFree lens ( Free (Compose (b,parser)) ) = do
endpoint <- lift $ asks lens
let rpcCall :: Endpoint -> (Handle -> IO b) -> IO b
rpcCall endpointoint what2do = withSocketsDo $ do
bracket (connectTo (hostName endpointoint) (portID endpointoint))
hClose
... | 789 | false | true | 0 | 17 | 303 | 311 | 150 | 161 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/tests/test-bugs.hs | mit | issue60 :: Assertion
issue60 = build_issue 60 | 45 | issue60 :: Assertion
issue60 = build_issue 60 | 45 | issue60 = build_issue 60 | 24 | false | true | 0 | 6 | 6 | 21 | 8 | 13 | null | null |
abau/bildpunkt | Bildpunkt/Renderer.hs | gpl-3.0 | evaluateAOSamples :: Config -> Acc (Array DIM2 Ray) -> Acc (Array DIM2 Float)
evaluateAOSamples config rays =
A.map (\s -> 1 - (constant (aoIntensity config) * s))
$ A.fold1 (+)
$ A.zipWith eval genAOSamples
$ A.replicate (lift $ Z:.All:.All:.n) rays
where
n = constant $ numAOSamples config
... | 895 | evaluateAOSamples :: Config -> Acc (Array DIM2 Ray) -> Acc (Array DIM2 Float)
evaluateAOSamples config rays =
A.map (\s -> 1 - (constant (aoIntensity config) * s))
$ A.fold1 (+)
$ A.zipWith eval genAOSamples
$ A.replicate (lift $ Z:.All:.All:.n) rays
where
n = constant $ numAOSamples config
... | 895 | evaluateAOSamples config rays =
A.map (\s -> 1 - (constant (aoIntensity config) * s))
$ A.fold1 (+)
$ A.zipWith eval genAOSamples
$ A.replicate (lift $ Z:.All:.All:.n) rays
where
n = constant $ numAOSamples config
delta = constant $ aoDistance config
eval i ray = (t - d) / (2 ** i... | 817 | false | true | 9 | 17 | 316 | 374 | 185 | 189 | null | null |
AndrewRademacher/gdax | lib/Network/GDAX/Core.hs | mit | gdaxGetWith g path opts' = do
res <- liftIO $ getWith opts (g ^. restEndpoint <> path)
decodeResult res
where
opts = opts' & manager .~ Right (g ^. networkManager) | 183 | gdaxGetWith g path opts' = do
res <- liftIO $ getWith opts (g ^. restEndpoint <> path)
decodeResult res
where
opts = opts' & manager .~ Right (g ^. networkManager) | 183 | gdaxGetWith g path opts' = do
res <- liftIO $ getWith opts (g ^. restEndpoint <> path)
decodeResult res
where
opts = opts' & manager .~ Right (g ^. networkManager) | 183 | false | false | 0 | 12 | 49 | 72 | 34 | 38 | null | null |
tkonolige/haskell-cci | examples/registration-benchmark.hs | bsd-3-clause | main :: IO ()
main = do
[szLogArg] <- getArgs
let sz = 2 ^ (read szLogArg :: Int)
iters :: Int
iters = 100
measureAndReport label action = do
start <- getCurrentTime
res <- action
end <- getCurrentTime
let t = toRational (diffUTCTime end start) *... | 2,317 | main :: IO ()
main = do
[szLogArg] <- getArgs
let sz = 2 ^ (read szLogArg :: Int)
iters :: Int
iters = 100
measureAndReport label action = do
start <- getCurrentTime
res <- action
end <- getCurrentTime
let t = toRational (diffUTCTime end start) *... | 2,317 | main = do
[szLogArg] <- getArgs
let sz = 2 ^ (read szLogArg :: Int)
iters :: Int
iters = 100
measureAndReport label action = do
start <- getCurrentTime
res <- action
end <- getCurrentTime
let t = toRational (diffUTCTime end start) * 1000000 / toR... | 2,303 | false | true | 0 | 19 | 764 | 723 | 330 | 393 | null | null |
AlexanderPankiv/ghc | compiler/prelude/THNames.hs | bsd-3-clause | classDName = libFun (fsLit "classD") classDIdKey | 69 | classDName = libFun (fsLit "classD") classDIdKey | 69 | classDName = libFun (fsLit "classD") classDIdKey | 69 | false | false | 1 | 7 | 26 | 20 | 8 | 12 | null | null |
jeffreyrosenbluth/Halgorithms | src/Sorting/Insertion.hs | bsd-3-clause | -- | Insertion sort for mutable vectors
sortBy' :: (PrimMonad m, MVector v a)
=> Comparing a-> v (PrimState m) a -> m ()
sortBy' cmp vec =
forM_ [0 .. length vec - 1] $ \i ->
forM_ [i, i - 1 .. 1] $ \j -> do
vj0 <- unsafeRead vec (j - 1)
vj1 <- unsafeRead vec j
when (vj1 `cmp` vj0 == LT)... | 390 | sortBy' :: (PrimMonad m, MVector v a)
=> Comparing a-> v (PrimState m) a -> m ()
sortBy' cmp vec =
forM_ [0 .. length vec - 1] $ \i ->
forM_ [i, i - 1 .. 1] $ \j -> do
vj0 <- unsafeRead vec (j - 1)
vj1 <- unsafeRead vec j
when (vj1 `cmp` vj0 == LT) (unsafeSwap vec j (j - 1))
-- | Insert... | 350 | sortBy' cmp vec =
forM_ [0 .. length vec - 1] $ \i ->
forM_ [i, i - 1 .. 1] $ \j -> do
vj0 <- unsafeRead vec (j - 1)
vj1 <- unsafeRead vec j
when (vj1 `cmp` vj0 == LT) (unsafeSwap vec j (j - 1))
-- | Insertion sort for mutable vectors. | 261 | true | true | 4 | 13 | 113 | 188 | 93 | 95 | null | null |
reflex-frp/reflex | src/Reflex/EventWriter/Base.hs | bsd-3-clause | -- | Run a 'EventWriterT' action.
runEventWriterT :: forall t m w a. (Reflex t, Monad m, Semigroup w) => EventWriterT t w m a -> m (a, Event t w)
runEventWriterT (EventWriterT a) = do
(result, requests) <- runStateT a $ EventWriterState (-1) []
let combineResults :: DMap (TellId w) Identity -> w
combineResult... | 920 | runEventWriterT :: forall t m w a. (Reflex t, Monad m, Semigroup w) => EventWriterT t w m a -> m (a, Event t w)
runEventWriterT (EventWriterT a) = do
(result, requests) <- runStateT a $ EventWriterState (-1) []
let combineResults :: DMap (TellId w) Identity -> w
combineResults = sconcat
. (\(h : t) ->... | 886 | runEventWriterT (EventWriterT a) = do
(result, requests) <- runStateT a $ EventWriterState (-1) []
let combineResults :: DMap (TellId w) Identity -> w
combineResults = sconcat
. (\(h : t) -> h :| t) -- Unconditional; 'merge' guarantees that it will only fire with non-empty DMaps
. DMap.foldlWi... | 774 | true | true | 0 | 16 | 178 | 238 | 123 | 115 | null | null |
neothemachine/monadiccp | src/Control/CP/FD/Solvers.hs | bsd-3-clause | bb :: NewBound s -> CBranchBoundST s a
bb = CBBST | 49 | bb :: NewBound s -> CBranchBoundST s a
bb = CBBST | 49 | bb = CBBST | 10 | false | true | 0 | 7 | 10 | 29 | 12 | 17 | null | null |
juhp/stack | src/Stack/Types/Config/Build.hs | bsd-3-clause | buildMonoidReconfigureArgName :: Text
buildMonoidReconfigureArgName = "reconfigure" | 83 | buildMonoidReconfigureArgName :: Text
buildMonoidReconfigureArgName = "reconfigure" | 83 | buildMonoidReconfigureArgName = "reconfigure" | 45 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
keithodulaigh/Hets | Common/Lexer.hs | gpl-2.0 | -- a single semicolon
semiT :: CharParser st Token
semiT = pToken $ string ";" << notFollowedBy (char ';') | 106 | semiT :: CharParser st Token
semiT = pToken $ string ";" << notFollowedBy (char ';') | 84 | semiT = pToken $ string ";" << notFollowedBy (char ';') | 55 | true | true | 3 | 8 | 18 | 41 | 18 | 23 | null | null |
siddhanathan/ghc | testsuite/tests/programs/joao-circular/Funcs_Lexer.hs | bsd-3-clause | lexer ('|':'|':cs) = Tand : lexer cs | 36 | lexer ('|':'|':cs) = Tand : lexer cs | 36 | lexer ('|':'|':cs) = Tand : lexer cs | 36 | false | false | 2 | 7 | 6 | 30 | 13 | 17 | null | null |
romanb/amazonka | amazonka-codedeploy/gen/Network/AWS/CodeDeploy/AddTagsToOnPremisesInstances.hs | mpl-2.0 | -- | The tag key-value pairs to add to the on-premises instances.
--
-- Keys and values are both required. Keys cannot be nulls or empty strings.
-- Value-only tags are not allowed.
attopiTags :: Lens' AddTagsToOnPremisesInstances [Tag]
attopiTags = lens _attopiTags (\s a -> s { _attopiTags = a }) . _List | 306 | attopiTags :: Lens' AddTagsToOnPremisesInstances [Tag]
attopiTags = lens _attopiTags (\s a -> s { _attopiTags = a }) . _List | 124 | attopiTags = lens _attopiTags (\s a -> s { _attopiTags = a }) . _List | 69 | true | true | 1 | 10 | 52 | 56 | 29 | 27 | null | null |
DanielSchuessler/hstri | scratch7.hs | gpl-3.0 | --main = print . maybeToList $ solve V.empty (V.empty :: V.Vector Rational)
main = print (fromJust $ solve
(V.fromList [V.fromList [1,1], V.fromList [0,1]])
(V.fromList [0,1] :: V.Vector Rational)) | 233 | main = print (fromJust $ solve
(V.fromList [V.fromList [1,1], V.fromList [0,1]])
(V.fromList [0,1] :: V.Vector Rational)) | 156 | main = print (fromJust $ solve
(V.fromList [V.fromList [1,1], V.fromList [0,1]])
(V.fromList [0,1] :: V.Vector Rational)) | 156 | true | false | 0 | 13 | 63 | 80 | 43 | 37 | null | null |
runebak/wcc | Source/WCCTest.hs | bsd-3-clause | main = verboseCheck $ (withData prop_sameDimension testParams) .&&. (withData prop_isSimilar testParams) | 104 | main = verboseCheck $ (withData prop_sameDimension testParams) .&&. (withData prop_isSimilar testParams) | 104 | main = verboseCheck $ (withData prop_sameDimension testParams) .&&. (withData prop_isSimilar testParams) | 104 | false | false | 0 | 8 | 10 | 30 | 15 | 15 | null | null |
noamz/linlam-gos | src/LamTri.hs | mit | k4C :: ULT
k4C = L 0 (L 1 (L 2 (A (A (V 0) (V 2)) (V 1)))) | 58 | k4C :: ULT
k4C = L 0 (L 1 (L 2 (A (A (V 0) (V 2)) (V 1)))) | 58 | k4C = L 0 (L 1 (L 2 (A (A (V 0) (V 2)) (V 1)))) | 47 | false | true | 0 | 14 | 18 | 73 | 34 | 39 | null | null |
jozefg/f2js | src/Language/F2JS/CodeGen.hs | mit | pushCont :: J.Expr -> J.Stmt
pushCont = pushStack (jname "CONT_STACK") | 70 | pushCont :: J.Expr -> J.Stmt
pushCont = pushStack (jname "CONT_STACK") | 70 | pushCont = pushStack (jname "CONT_STACK") | 41 | false | true | 0 | 8 | 9 | 35 | 15 | 20 | null | null |
ekmett/text | Data/Text/Lazy.hs | bsd-2-clause | -- | /O(n)/ 'takeEnd' @n@ @t@ returns the suffix remaining after
-- taking @n@ characters from the end of @t@.
--
-- Examples:
--
-- > takeEnd 3 "foobar" == "bar"
takeEnd :: Int64 -> Text -> Text
takeEnd n t0
| n <= 0 = empty
| otherwise = takeChunk n empty . L.reverse . toChunks $ t0
where takeChunk _ acc... | 733 | takeEnd :: Int64 -> Text -> Text
takeEnd n t0
| n <= 0 = empty
| otherwise = takeChunk n empty . L.reverse . toChunks $ t0
where takeChunk _ acc [] = acc
takeChunk i acc (t:ts)
| i <= l = chunk (T.takeEnd (fromIntegral i) t) acc
| otherwise = takeChunk (i-l) (Chunk t acc) ts
... | 570 | takeEnd n t0
| n <= 0 = empty
| otherwise = takeChunk n empty . L.reverse . toChunks $ t0
where takeChunk _ acc [] = acc
takeChunk i acc (t:ts)
| i <= l = chunk (T.takeEnd (fromIntegral i) t) acc
| otherwise = takeChunk (i-l) (Chunk t acc) ts
where l = fromIntegral ... | 537 | true | true | 3 | 11 | 189 | 186 | 94 | 92 | null | null |
siddhanathan/ghc | compiler/nativeGen/RegAlloc/Graph/Stats.hs | bsd-3-clause | pprStats
:: [RegAllocStats statics instr]
-> Color.Graph VirtualReg RegClass RealReg
-> SDoc
pprStats stats graph
= let outSpills = pprStatsSpills stats
outLife = pprStatsLifetimes stats
outConflict = pprStatsConflict stats
outScatter = pprSt... | 407 | pprStats
:: [RegAllocStats statics instr]
-> Color.Graph VirtualReg RegClass RealReg
-> SDoc
pprStats stats graph
= let outSpills = pprStatsSpills stats
outLife = pprStatsLifetimes stats
outConflict = pprStatsConflict stats
outScatter = pprSta... | 406 | pprStats stats graph
= let outSpills = pprStatsSpills stats
outLife = pprStatsLifetimes stats
outConflict = pprStatsConflict stats
outScatter = pprStatsLifeConflict stats graph
in vcat [outSpills, outLife, outConflict, outScatter] | 289 | false | true | 0 | 9 | 123 | 96 | 48 | 48 | null | null |
lenguyenthedat/aws-redshift-to-rds | src/Options.hs | mit | convertToFullOptions ConfigFileOptions{from, to, fromTable, toTable, cascade} = do
config <- load [Required "./config/aws-redshift-to-rds.config"]
fromType <- require config (cs from <> ".type")
fromConnectionString <- require config (cs from <> ".connection")
toType <- require config (cs to <> ".type")
toCon... | 620 | convertToFullOptions ConfigFileOptions{from, to, fromTable, toTable, cascade} = do
config <- load [Required "./config/aws-redshift-to-rds.config"]
fromType <- require config (cs from <> ".type")
fromConnectionString <- require config (cs from <> ".connection")
toType <- require config (cs to <> ".type")
toCon... | 620 | convertToFullOptions ConfigFileOptions{from, to, fromTable, toTable, cascade} = do
config <- load [Required "./config/aws-redshift-to-rds.config"]
fromType <- require config (cs from <> ".type")
fromConnectionString <- require config (cs from <> ".connection")
toType <- require config (cs to <> ".type")
toCon... | 620 | false | false | 0 | 11 | 115 | 182 | 94 | 88 | null | null |
fumieval/jugendstil | src/Jugendstil/Doc/Layout.hs | bsd-3-clause | matchLayout f (Extend _ a) (Extend g b) = Extend g <$> f (Just a) b | 67 | matchLayout f (Extend _ a) (Extend g b) = Extend g <$> f (Just a) b | 67 | matchLayout f (Extend _ a) (Extend g b) = Extend g <$> f (Just a) b | 67 | false | false | 0 | 8 | 15 | 51 | 23 | 28 | null | null |
ghorn/dynobud | dynobud/tests/UnitTests.hs | lgpl-3.0 | -- this uses test-framework to run all the tests
main :: IO ()
main = do
defaultMainWithOpts
[ testGroup "the dummy tests" dummyTests
, testGroup "ocp tests" ocpTests
, mempty { topt_maximum_generated_tests = Just 3000
, topt_maximum_unsuitable_generated_tests = Just 10000
} `plu... | 423 | main :: IO ()
main = do
defaultMainWithOpts
[ testGroup "the dummy tests" dummyTests
, testGroup "ocp tests" ocpTests
, mempty { topt_maximum_generated_tests = Just 3000
, topt_maximum_unsuitable_generated_tests = Just 10000
} `plusTestOptions`
testGroup "lps/qps" lpTests
... | 374 | main = do
defaultMainWithOpts
[ testGroup "the dummy tests" dummyTests
, testGroup "ocp tests" ocpTests
, mempty { topt_maximum_generated_tests = Just 3000
, topt_maximum_unsuitable_generated_tests = Just 10000
} `plusTestOptions`
testGroup "lps/qps" lpTests
]
mempt... | 360 | true | true | 0 | 13 | 106 | 92 | 46 | 46 | null | null |
urbanslug/ghc | compiler/deSugar/DsBinds.hs | bsd-3-clause | dsEvTerm (EvCallStack cs) = dsEvCallStack cs | 44 | dsEvTerm (EvCallStack cs) = dsEvCallStack cs | 44 | dsEvTerm (EvCallStack cs) = dsEvCallStack cs | 44 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap4/main.hs | mit | showVal :: LispVal -> String
showVal (String contents) = "\"" ++ contents ++ "\"" | 81 | showVal :: LispVal -> String
showVal (String contents) = "\"" ++ contents ++ "\"" | 81 | showVal (String contents) = "\"" ++ contents ++ "\"" | 52 | false | true | 0 | 7 | 13 | 32 | 16 | 16 | null | null |
frontrowed/wai | warp/test/ResponseHeaderSpec.hs | mit | headers :: H.ResponseHeaders
headers = [
("Date", "Mon, 13 Aug 2012 04:22:55 GMT")
, ("Content-Lenght", "151")
, ("Server", "Mighttpd/2.5.8")
, ("Last-Modified", "Fri, 22 Jun 2012 01:18:08 GMT")
, ("Content-Type", "text/html")
] | 242 | headers :: H.ResponseHeaders
headers = [
("Date", "Mon, 13 Aug 2012 04:22:55 GMT")
, ("Content-Lenght", "151")
, ("Server", "Mighttpd/2.5.8")
, ("Last-Modified", "Fri, 22 Jun 2012 01:18:08 GMT")
, ("Content-Type", "text/html")
] | 242 | headers = [
("Date", "Mon, 13 Aug 2012 04:22:55 GMT")
, ("Content-Lenght", "151")
, ("Server", "Mighttpd/2.5.8")
, ("Last-Modified", "Fri, 22 Jun 2012 01:18:08 GMT")
, ("Content-Type", "text/html")
] | 213 | false | true | 0 | 6 | 44 | 58 | 37 | 21 | null | null |
juhp/leksah | src/IDE/Pane/PackageFlags.hs | gpl-2.0 | escapeQuotes = foldr (\c s -> if c == '"' then '\\':c:s else c:s) "" | 68 | escapeQuotes = foldr (\c s -> if c == '"' then '\\':c:s else c:s) "" | 68 | escapeQuotes = foldr (\c s -> if c == '"' then '\\':c:s else c:s) "" | 68 | false | false | 0 | 10 | 14 | 45 | 24 | 21 | null | null |
stmfunk/laughing-dangerzone | practise.hs | gpl-2.0 | myReverse = foldl (flip (:)) [] | 31 | myReverse = foldl (flip (:)) [] | 31 | myReverse = foldl (flip (:)) [] | 31 | false | false | 0 | 7 | 5 | 21 | 11 | 10 | null | null |
garetxe/cabal | Cabal/Distribution/Simple/GHC/Internal.hs | bsd-3-clause | showOsString other = display other | 36 | showOsString other = display other | 36 | showOsString other = display other | 36 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
lexml/lexml-linker | src/main/haskell/LexML/Linker/ParserBase.hs | gpl-2.0 | constantesI' :: [String] -> LinkerParserMonad ((Int,Int,Int),String)
constantesI' l = lToken constante'
where
s = S.fromList [map toLower s | s <- l]
constante' (Palavra p)
| map toLower p `S.member` s = return (map toLower p)
constante' _ = fail $ "Expected " ++ show s | 292 | constantesI' :: [String] -> LinkerParserMonad ((Int,Int,Int),String)
constantesI' l = lToken constante'
where
s = S.fromList [map toLower s | s <- l]
constante' (Palavra p)
| map toLower p `S.member` s = return (map toLower p)
constante' _ = fail $ "Expected " ++ show s | 292 | constantesI' l = lToken constante'
where
s = S.fromList [map toLower s | s <- l]
constante' (Palavra p)
| map toLower p `S.member` s = return (map toLower p)
constante' _ = fail $ "Expected " ++ show s | 223 | false | true | 0 | 9 | 67 | 134 | 67 | 67 | null | null |
substack/lambdascape | Simulation.hs | bsd-3-clause | renderGrid :: Terrain -> IO ()
renderGrid (Terrain trx zr) = renderPrimitive Triangles $ mapM_ triM trx where
triM (v1,v2,v3) = ptM v1 >> ptM v2 >> ptM v3
ptM (Vertex3 x y z) = do
let c = (z - fst zr) / (snd zr - fst zr)
color $ Color4 c c c 1
vertex $ Vertex3 x y (z * 5) | 304 | renderGrid :: Terrain -> IO ()
renderGrid (Terrain trx zr) = renderPrimitive Triangles $ mapM_ triM trx where
triM (v1,v2,v3) = ptM v1 >> ptM v2 >> ptM v3
ptM (Vertex3 x y z) = do
let c = (z - fst zr) / (snd zr - fst zr)
color $ Color4 c c c 1
vertex $ Vertex3 x y (z * 5) | 304 | renderGrid (Terrain trx zr) = renderPrimitive Triangles $ mapM_ triM trx where
triM (v1,v2,v3) = ptM v1 >> ptM v2 >> ptM v3
ptM (Vertex3 x y z) = do
let c = (z - fst zr) / (snd zr - fst zr)
color $ Color4 c c c 1
vertex $ Vertex3 x y (z * 5) | 273 | false | true | 0 | 13 | 95 | 169 | 81 | 88 | null | null |
amar47shah/socket-server | app/Main.hs | bsd-3-clause | receive :: Client -> IO a
receive c = forever $
hGetLine (clientHandle c) >>=
atomically . sendMessage c . Command | 120 | receive :: Client -> IO a
receive c = forever $
hGetLine (clientHandle c) >>=
atomically . sendMessage c . Command | 120 | receive c = forever $
hGetLine (clientHandle c) >>=
atomically . sendMessage c . Command | 94 | false | true | 6 | 7 | 26 | 59 | 25 | 34 | null | null |
nomeata/ghc | compiler/codeGen/CgForeignCall.hs | bsd-3-clause | maybe_assign_temp :: CmmExpr -> FCode CmmExpr
maybe_assign_temp e
| hasNoGlobalRegs e = return e
| otherwise = do
-- don't use assignTemp, it uses its own notion of "trivial"
-- expressions, which are wrong here.
-- this is a NonPtr because it only duplicates an existing
reg... | 712 | maybe_assign_temp :: CmmExpr -> FCode CmmExpr
maybe_assign_temp e
| hasNoGlobalRegs e = return e
| otherwise = do
-- don't use assignTemp, it uses its own notion of "trivial"
-- expressions, which are wrong here.
-- this is a NonPtr because it only duplicates an existing
reg... | 712 | maybe_assign_temp e
| hasNoGlobalRegs e = return e
| otherwise = do
-- don't use assignTemp, it uses its own notion of "trivial"
-- expressions, which are wrong here.
-- this is a NonPtr because it only duplicates an existing
reg <- newTemp (cmmExprType e) --TODO FIXME NOW
... | 666 | false | true | 1 | 12 | 157 | 103 | 50 | 53 | null | null |
jragonfyre/TRPG | src/English/Parser.hs | bsd-3-clause | satisfy :: (MonadParsec e s m, Token s ~ InflectedToken) => (InflectedEntry -> Bool) -> m InflectedEntry
satisfy f = token testT Nothing
where
testT x =
if f (snd x)
then Right (snd x)
else Left (Set.singleton (Tokens (x:| [])), Set.empty, Set.empty) | 274 | satisfy :: (MonadParsec e s m, Token s ~ InflectedToken) => (InflectedEntry -> Bool) -> m InflectedEntry
satisfy f = token testT Nothing
where
testT x =
if f (snd x)
then Right (snd x)
else Left (Set.singleton (Tokens (x:| [])), Set.empty, Set.empty) | 274 | satisfy f = token testT Nothing
where
testT x =
if f (snd x)
then Right (snd x)
else Left (Set.singleton (Tokens (x:| [])), Set.empty, Set.empty) | 169 | false | true | 0 | 13 | 66 | 129 | 65 | 64 | null | null |
wilbowma/accelerate | Data/Array/Accelerate/Pretty/Traverse.hs | bsd-3-clause | travAcc :: forall m b aenv a. Monad m => Labels -> (String -> String -> [m b] -> m b)
-> (String -> String -> m b) -> OpenAcc aenv a -> m b
travAcc f c l (OpenAcc openAcc) = travAcc' openAcc
where
combine = c (accFormat f)
leaf = l (accFormat f)
travAcc' :: PreOpenAcc OpenAcc aenv a -> m b
t... | 3,488 | travAcc :: forall m b aenv a. Monad m => Labels -> (String -> String -> [m b] -> m b)
-> (String -> String -> m b) -> OpenAcc aenv a -> m b
travAcc f c l (OpenAcc openAcc) = travAcc' openAcc
where
combine = c (accFormat f)
leaf = l (accFormat f)
travAcc' :: PreOpenAcc OpenAcc aenv a -> m b
t... | 3,488 | travAcc f c l (OpenAcc openAcc) = travAcc' openAcc
where
combine = c (accFormat f)
leaf = l (accFormat f)
travAcc' :: PreOpenAcc OpenAcc aenv a -> m b
travAcc' (Let acc1 acc2) = combine "Let" [travAcc f c l acc1, travAcc f c l acc2]
travAcc' (Let2 acc1 acc2) = combine "Let2" [ travAcc f c l ac... | 3,341 | false | true | 2 | 15 | 1,120 | 1,656 | 794 | 862 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M10/D30/Solution.hs | mit | extractSpecialChars :: BodyContext -> [(SpecialChars, Line)]
extractSpecialChars [] = [] | 88 | extractSpecialChars :: BodyContext -> [(SpecialChars, Line)]
extractSpecialChars [] = [] | 88 | extractSpecialChars [] = [] | 27 | false | true | 0 | 7 | 9 | 31 | 17 | 14 | null | null |
Icelandjack/lens | src/Control/Lens/Internal/Magma.hs | bsd-3-clause | -- | Generate a 'Magma' with leaves only while the predicate holds from left to right.
runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a)
runTakingWhile (TakingWhile _ _ k) = k True | 198 | runTakingWhile :: TakingWhile p f a b t -> Magma () t b (Corep p a)
runTakingWhile (TakingWhile _ _ k) = k True | 111 | runTakingWhile (TakingWhile _ _ k) = k True | 43 | true | true | 0 | 8 | 39 | 62 | 30 | 32 | null | null |
capital-match/hdo | main/hdo.hs | mit | parseCommandOptions e = fail $ "I don't know how to interpret commands " ++ unwords e ++ "\n" ++ usage | 127 | parseCommandOptions e = fail $ "I don't know how to interpret commands " ++ unwords e ++ "\n" ++ usage | 127 | parseCommandOptions e = fail $ "I don't know how to interpret commands " ++ unwords e ++ "\n" ++ usage | 127 | false | false | 0 | 8 | 44 | 28 | 13 | 15 | null | null |
Axure/elm-compiler | src/Parse/Helpers.hs | bsd-3-clause | freshLine :: IParser [[String]]
freshLine =
try (many1 newline >> many space_nl) <|> try (many1 space_nl) <?> Syntax.freshLine
where
space_nl = try $ spaces >> many1 newline | 183 | freshLine :: IParser [[String]]
freshLine =
try (many1 newline >> many space_nl) <|> try (many1 space_nl) <?> Syntax.freshLine
where
space_nl = try $ spaces >> many1 newline | 183 | freshLine =
try (many1 newline >> many space_nl) <|> try (many1 space_nl) <?> Syntax.freshLine
where
space_nl = try $ spaces >> many1 newline | 151 | false | true | 0 | 10 | 36 | 74 | 36 | 38 | null | null |
cheng81/schemish | src/PrimitiveFunc.hs | bsd-3-clause | cons :: [LispVal] -> ThrowsError LispVal
cons [x1, List []] = return $ List [x1] | 80 | cons :: [LispVal] -> ThrowsError LispVal
cons [x1, List []] = return $ List [x1] | 80 | cons [x1, List []] = return $ List [x1] | 39 | false | true | 0 | 10 | 14 | 49 | 24 | 25 | null | null |
k0001/gtk2hs | tools/apiGen/src/ModuleScan.hs | gpl-3.0 | scanCopyright :: [String] -> Line
scanCopyright (from:"..":to:name) = Copyright (Right (from, to)) (map unwords $ splitBy "," name) | 139 | scanCopyright :: [String] -> Line
scanCopyright (from:"..":to:name) = Copyright (Right (from, to)) (map unwords $ splitBy "," name) | 139 | scanCopyright (from:"..":to:name) = Copyright (Right (from, to)) (map unwords $ splitBy "," name) | 105 | false | true | 0 | 9 | 25 | 68 | 35 | 33 | null | null |
dblia/nosql-ganeti | src/Ganeti/Query/Filter.hs | gpl-2.0 | tryGetter _ _ _ FieldUnknown = Just $
ResultEntry RSUnknown Nothing | 126 | tryGetter _ _ _ FieldUnknown = Just $
ResultEntry RSUnknown Nothing | 126 | tryGetter _ _ _ FieldUnknown = Just $
ResultEntry RSUnknown Nothing | 126 | false | false | 0 | 6 | 69 | 24 | 11 | 13 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/BatchJobDefinitionTimeout.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-batch-jobdefinition-timeout.html#cfn-batch-jobdefinition-timeout-attemptdurationseconds
bjdtAttemptDurationSeconds :: Lens' BatchJobDefinitionTimeout (Maybe (Val Integer))
bjdtAttemptDurationSeconds = lens _batchJobDefinitionTimeoutAttemp... | 405 | bjdtAttemptDurationSeconds :: Lens' BatchJobDefinitionTimeout (Maybe (Val Integer))
bjdtAttemptDurationSeconds = lens _batchJobDefinitionTimeoutAttemptDurationSeconds (\s a -> s { _batchJobDefinitionTimeoutAttemptDurationSeconds = a }) | 235 | bjdtAttemptDurationSeconds = lens _batchJobDefinitionTimeoutAttemptDurationSeconds (\s a -> s { _batchJobDefinitionTimeoutAttemptDurationSeconds = a }) | 151 | true | true | 1 | 9 | 22 | 55 | 28 | 27 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | The localized strings for playlist\'s title.
pllTitle :: Lens' PlayListLocalization (Maybe Text)
pllTitle = lens _pllTitle (\ s a -> s{_pllTitle = a}) | 155 | pllTitle :: Lens' PlayListLocalization (Maybe Text)
pllTitle = lens _pllTitle (\ s a -> s{_pllTitle = a}) | 105 | pllTitle = lens _pllTitle (\ s a -> s{_pllTitle = a}) | 53 | true | true | 0 | 9 | 24 | 46 | 25 | 21 | null | null |
shlevy/ghc | compiler/cmm/PprC.hs | bsd-3-clause | signedOp (MO_S_Ge _) = True | 32 | signedOp (MO_S_Ge _) = True | 32 | signedOp (MO_S_Ge _) = True | 32 | false | false | 0 | 6 | 9 | 16 | 7 | 9 | null | null |
bens/libmpd-haskell | tests/CommandSpec.hs | lgpl-2.1 | testNext = cmd_ [("next", Right "OK")] next | 43 | testNext = cmd_ [("next", Right "OK")] next | 43 | testNext = cmd_ [("next", Right "OK")] next | 43 | false | false | 0 | 8 | 6 | 23 | 12 | 11 | null | null |
tonicebrian/TAPL | src/Main.hs | gpl-3.0 | main = do
args <- getArgs
content <- readFile $ head args
let result = case parseLang content of
Left _ -> error "Error parsing the file"
Right a -> map eval a
mapM_ (putStrLn.show) result | 235 | main = do
args <- getArgs
content <- readFile $ head args
let result = case parseLang content of
Left _ -> error "Error parsing the file"
Right a -> map eval a
mapM_ (putStrLn.show) result | 235 | main = do
args <- getArgs
content <- readFile $ head args
let result = case parseLang content of
Left _ -> error "Error parsing the file"
Right a -> map eval a
mapM_ (putStrLn.show) result | 235 | false | false | 0 | 13 | 82 | 82 | 36 | 46 | null | null |
travitch/foreign-inference | src/Foreign/Inference/Analysis/ErrorHandling/Features.hs | bsd-3-clause | computeBlockFeatures :: BasicFacts
-> Bool
-> Map Value Feature
-> BasicBlock
-> Map Value Feature
computeBlockFeatures bf isComplex m bb
| Just baseFact <- M.lookup bb bf =
F.foldl' (calleeInContext baseFact) m (basicBlockInstruc... | 411 | computeBlockFeatures :: BasicFacts
-> Bool
-> Map Value Feature
-> BasicBlock
-> Map Value Feature
computeBlockFeatures bf isComplex m bb
| Just baseFact <- M.lookup bb bf =
F.foldl' (calleeInContext baseFact) m (basicBlockInstruc... | 411 | computeBlockFeatures bf isComplex m bb
| Just baseFact <- M.lookup bb bf =
F.foldl' (calleeInContext baseFact) m (basicBlockInstructions bb)
| otherwise = F.foldl' (calleeNotError isComplex) m (basicBlockInstructions bb) | 228 | false | true | 1 | 10 | 134 | 115 | 54 | 61 | null | null |
antalsz/hs-to-coq | examples/ghc/gen-files/Lexer.hs | mit | layout = 3 | 10 | layout = 3 | 10 | layout = 3 | 10 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
fmthoma/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | pcDataConWithFixity' :: Bool -> Name -> Unique -> [TyVar] -> [Type] -> TyCon -> DataCon
-- The Name should be in the DataName name space; it's the name
-- of the DataCon itself.
pcDataConWithFixity' declared_infix dc_name wrk_key tyvars arg_tys tycon
= data_con
where
data_con = mkDataCon dc_name declared_infix... | 1,407 | pcDataConWithFixity' :: Bool -> Name -> Unique -> [TyVar] -> [Type] -> TyCon -> DataCon
pcDataConWithFixity' declared_infix dc_name wrk_key tyvars arg_tys tycon
= data_con
where
data_con = mkDataCon dc_name declared_infix
(map (const HsNoBang) arg_tys)
[] -- No labelled fiel... | 1,316 | pcDataConWithFixity' declared_infix dc_name wrk_key tyvars arg_tys tycon
= data_con
where
data_con = mkDataCon dc_name declared_infix
(map (const HsNoBang) arg_tys)
[] -- No labelled fields
tyvars
[] -- No existential type variables
... | 1,228 | true | true | 0 | 10 | 548 | 206 | 108 | 98 | null | null |
ababkin/railoscopy | src/Haste/Perch.hs | mit | nelem :: String -> Perch
nelem s= Perch $ \e ->do
e' <- newElem s
addChild e' e
return e' | 113 | nelem :: String -> Perch
nelem s= Perch $ \e ->do
e' <- newElem s
addChild e' e
return e' | 113 | nelem s= Perch $ \e ->do
e' <- newElem s
addChild e' e
return e' | 88 | false | true | 0 | 10 | 43 | 51 | 23 | 28 | null | null |
graninas/Andromeda | src/Andromeda/Utils/Parsing.hs | bsd-3-clause | trueSpace = char ' ' <|> tab | 28 | trueSpace = char ' ' <|> tab | 28 | trueSpace = char ' ' <|> tab | 28 | false | false | 0 | 6 | 6 | 13 | 6 | 7 | null | null |
termite2/tsl | Frontend/ExprOps.hs | bsd-3-clause | isConstExpr (EStruct _ _ (Left fs)) = and $ map (isConstExpr . snd) fs | 71 | isConstExpr (EStruct _ _ (Left fs)) = and $ map (isConstExpr . snd) fs | 71 | isConstExpr (EStruct _ _ (Left fs)) = and $ map (isConstExpr . snd) fs | 71 | false | false | 0 | 9 | 14 | 41 | 20 | 21 | null | null |
brendanhay/gogol | gogol-youtube-reporting/gen/Network/Google/YouTubeReporting/Types/Product.hs | mpl-2.0 | -- | gdata
gddvrObjectVersion :: Lens' GDataDiffVersionResponse (Maybe Text)
gddvrObjectVersion
= lens _gddvrObjectVersion
(\ s a -> s{_gddvrObjectVersion = a}) | 168 | gddvrObjectVersion :: Lens' GDataDiffVersionResponse (Maybe Text)
gddvrObjectVersion
= lens _gddvrObjectVersion
(\ s a -> s{_gddvrObjectVersion = a}) | 157 | gddvrObjectVersion
= lens _gddvrObjectVersion
(\ s a -> s{_gddvrObjectVersion = a}) | 91 | true | true | 0 | 8 | 27 | 49 | 25 | 24 | null | null |
Bodigrim/exp-pairs | Math/ExpPairs/LinearForm.hs | gpl-3.0 | -- |Evaluate a rational form (a*k + b*l + c*m) \/ (a'*k + b'*l + c'*m)
-- for given k, l and m.
evalRF :: Real t => (Integer, Integer, Integer) -> RationalForm t -> RationalInf
evalRF (k, l, m) (num :/: den) = if denom==0 then InfPlus else Finite (numer / denom) where
klm = mapTriple fromInteger (k, l, m)
numer = t... | 442 | evalRF :: Real t => (Integer, Integer, Integer) -> RationalForm t -> RationalInf
evalRF (k, l, m) (num :/: den) = if denom==0 then InfPlus else Finite (numer / denom) where
klm = mapTriple fromInteger (k, l, m)
numer = toRational $ evalLF klm num
denom = toRational $ evalLF klm den
-- |Constants to specify the s... | 346 | evalRF (k, l, m) (num :/: den) = if denom==0 then InfPlus else Finite (numer / denom) where
klm = mapTriple fromInteger (k, l, m)
numer = toRational $ evalLF klm num
denom = toRational $ evalLF klm den
-- |Constants to specify the strictness of 'Constraint'. | 265 | true | true | 0 | 8 | 89 | 133 | 73 | 60 | null | null |
supki/libstackexchange | src/Network/StackExchange/API.hs | mit | --------------------------
-- Top Tags
--------------------------
-- $topAnswerTagsOnUsers
-- >>> checkLengthM $ askSE (topAnswerTagsOnUsers 1097181 <> s <> k <> q)
-- True
-- | <https://api.stackexchange.com/docs/top-answer-tags-on-users>
topAnswerTagsOnUsers ∷ Int → Request a "topAnswerTagsOnUsers" [SE TopTag]
topA... | 472 | topAnswerTagsOnUsers ∷ Int → Request a "topAnswerTagsOnUsers" [SE TopTag]
topAnswerTagsOnUsers (toLazyText . decimal → i) =
path ("users/" <> i <> "/top-answer-tags") <>
parse (attoparsec items ".users/{id}/top-answer-tags: ") | 230 | topAnswerTagsOnUsers (toLazyText . decimal → i) =
path ("users/" <> i <> "/top-answer-tags") <>
parse (attoparsec items ".users/{id}/top-answer-tags: ") | 156 | true | true | 0 | 9 | 58 | 78 | 42 | 36 | null | null |
jwaldmann/haskell-obdd | examples/Sort.hs | gpl-2.0 | refine :: Poset -> M.Map Int Type -> M.Map Int Type
refine p t = M.fromList $ do
x <- S.toList $ elements p
return (x, Type ( list $ sort $ map (t M.!) $ inputs p x )
( list $ sort $ map (t M.!) $ outputs p x ) ) | 237 | refine :: Poset -> M.Map Int Type -> M.Map Int Type
refine p t = M.fromList $ do
x <- S.toList $ elements p
return (x, Type ( list $ sort $ map (t M.!) $ inputs p x )
( list $ sort $ map (t M.!) $ outputs p x ) ) | 237 | refine p t = M.fromList $ do
x <- S.toList $ elements p
return (x, Type ( list $ sort $ map (t M.!) $ inputs p x )
( list $ sort $ map (t M.!) $ outputs p x ) ) | 183 | false | true | 0 | 15 | 78 | 135 | 66 | 69 | null | null |
pseudonom/persistent | persistent-test/src/UniqueTest.hs | mit | cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend TestNonNull ~ backend) => ReaderT backend m ()
cleanDB = do
deleteWhere ([] :: [Filter TestNonNull])
deleteWhere ([] :: [Filter TestNull]) | 208 | cleanDB :: (MonadIO m, PersistQuery backend, PersistEntityBackend TestNonNull ~ backend) => ReaderT backend m ()
cleanDB = do
deleteWhere ([] :: [Filter TestNonNull])
deleteWhere ([] :: [Filter TestNull]) | 208 | cleanDB = do
deleteWhere ([] :: [Filter TestNonNull])
deleteWhere ([] :: [Filter TestNull]) | 95 | false | true | 0 | 11 | 31 | 92 | 44 | 48 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.