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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
timjs/spl-compiler | src/Language/SPL/Data/Program.hs | bsd-3-clause | isMain :: Construct -> Bool
isMain (Definition _ Main _ _ _) = True | 67 | isMain :: Construct -> Bool
isMain (Definition _ Main _ _ _) = True | 67 | isMain (Definition _ Main _ _ _) = True | 39 | false | true | 0 | 7 | 13 | 32 | 16 | 16 | null | null |
phischu/haxl-neo4j | src/Haxl/Neo4j.hs | bsd-3-clause | nodeId :: Node -> Neo4j NodeId
nodeId = Neo4j . return . (:[]) . Internal.nodeId | 80 | nodeId :: Node -> Neo4j NodeId
nodeId = Neo4j . return . (:[]) . Internal.nodeId | 80 | nodeId = Neo4j . return . (:[]) . Internal.nodeId | 49 | false | true | 0 | 8 | 14 | 38 | 20 | 18 | null | null |
snapframework/heist | src/Heist/Internal/Types.hs | bsd-3-clause | hcNamespace
:: Functor f
=> (Text -> f Text)
-> HeistConfig m -> f (HeistConfig m)
hcNamespace = lens _hcNamespace setter
where
setter hc v = hc { _hcNamespace = v }
------------------------------------------------------------------------------
-- | Lens for the namespace error flag
-- :: Simple Lens (HeistConfig m) Bool | 342 | hcNamespace
:: Functor f
=> (Text -> f Text)
-> HeistConfig m -> f (HeistConfig m)
hcNamespace = lens _hcNamespace setter
where
setter hc v = hc { _hcNamespace = v }
------------------------------------------------------------------------------
-- | Lens for the namespace error flag
-- :: Simple Lens (HeistConfig m) Bool | 342 | hcNamespace = lens _hcNamespace setter
where
setter hc v = hc { _hcNamespace = v }
------------------------------------------------------------------------------
-- | Lens for the namespace error flag
-- :: Simple Lens (HeistConfig m) Bool | 247 | false | true | 0 | 11 | 67 | 84 | 41 | 43 | null | null |
takenobu-hs/processor-creative-kit | Language/Pck/Tool/Assembler.hs | bsd-3-clause | mem :: Parser GReg
mem = do string strMemBeg >> skipSpaces
a <- greg
skipSpaces >> string strMemEnd
return a
-- converter utility | 158 | mem :: Parser GReg
mem = do string strMemBeg >> skipSpaces
a <- greg
skipSpaces >> string strMemEnd
return a
-- converter utility | 158 | mem = do string strMemBeg >> skipSpaces
a <- greg
skipSpaces >> string strMemEnd
return a
-- converter utility | 139 | false | true | 0 | 9 | 51 | 54 | 22 | 32 | null | null |
CloudI/CloudI | src/api/haskell/external/bytestring-0.10.10.0/Data/ByteString/Builder/Prim/ASCII.hs | mit | int64Dec :: BoundedPrim Int64
int64Dec = boudedPrim 20 $ c_long_long_int_dec . fromIntegral | 91 | int64Dec :: BoundedPrim Int64
int64Dec = boudedPrim 20 $ c_long_long_int_dec . fromIntegral | 91 | int64Dec = boudedPrim 20 $ c_long_long_int_dec . fromIntegral | 61 | false | true | 2 | 6 | 11 | 31 | 13 | 18 | null | null |
li-zhirui/EoplLangs | test/MutablePairs/Suites.hs | bsd-3-clause | tests = TestList [ EvalTest.tests, ParseTest.tests ] | 52 | tests = TestList [ EvalTest.tests, ParseTest.tests ] | 52 | tests = TestList [ EvalTest.tests, ParseTest.tests ] | 52 | false | false | 1 | 7 | 6 | 22 | 10 | 12 | null | null |
castaway/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | pBlank :: TagParser ()
pBlank = try $ do
(TagText str) <- pSatisfy isTagText
guard $ all isSpace str | 104 | pBlank :: TagParser ()
pBlank = try $ do
(TagText str) <- pSatisfy isTagText
guard $ all isSpace str | 104 | pBlank = try $ do
(TagText str) <- pSatisfy isTagText
guard $ all isSpace str | 81 | false | true | 0 | 10 | 22 | 48 | 22 | 26 | null | null |
sdiehl/haskell-picosat | src/Picosat.hs | mit | addBaseClauses :: [[Int]] -> PS ()
addBaseClauses clauses = do
pico <- gets psPicosat
liftIO $ addClauses pico clauses | 122 | addBaseClauses :: [[Int]] -> PS ()
addBaseClauses clauses = do
pico <- gets psPicosat
liftIO $ addClauses pico clauses | 122 | addBaseClauses clauses = do
pico <- gets psPicosat
liftIO $ addClauses pico clauses | 87 | false | true | 0 | 8 | 22 | 51 | 24 | 27 | null | null |
chpatrick/language-glsl | Language/GLSL/Parser.hs | bsd-3-clause | forInitStatement :: P (Either (Maybe Expr) Declaration)
forInitStatement = (expressionStatement >>= return . Left)
<|> (declarationStatement >>= return . Right) | 162 | forInitStatement :: P (Either (Maybe Expr) Declaration)
forInitStatement = (expressionStatement >>= return . Left)
<|> (declarationStatement >>= return . Right) | 162 | forInitStatement = (expressionStatement >>= return . Left)
<|> (declarationStatement >>= return . Right) | 106 | false | true | 3 | 9 | 21 | 58 | 30 | 28 | null | null |
nevrenato/Hets_Fork | CASL/MixfixParser.hs | gpl-2.0 | mkIdSets :: Set.Set Id -> Set.Set Id -> Set.Set Id -> IdSets
mkIdSets consts ops preds = ((consts, ops), preds) | 111 | mkIdSets :: Set.Set Id -> Set.Set Id -> Set.Set Id -> IdSets
mkIdSets consts ops preds = ((consts, ops), preds) | 111 | mkIdSets consts ops preds = ((consts, ops), preds) | 50 | false | true | 0 | 9 | 19 | 57 | 29 | 28 | null | null |
ptitfred/slidecoding | src/Slidecoding/Presentation.hs | gpl-3.0 | loadYaml :: FilePath -> IO (Either ValidationMessage Metadata)
loadYaml p = either handleError Right <$> loadMetadata p
where handleError e = Left ("Invalid Metadata: " ++ show e :: ValidationMessage) | 202 | loadYaml :: FilePath -> IO (Either ValidationMessage Metadata)
loadYaml p = either handleError Right <$> loadMetadata p
where handleError e = Left ("Invalid Metadata: " ++ show e :: ValidationMessage) | 202 | loadYaml p = either handleError Right <$> loadMetadata p
where handleError e = Left ("Invalid Metadata: " ++ show e :: ValidationMessage) | 139 | false | true | 0 | 8 | 31 | 67 | 32 | 35 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp FloatDivOp = _ILIT(121) | 36 | tagOf_PrimOp FloatDivOp = _ILIT(121) | 36 | tagOf_PrimOp FloatDivOp = _ILIT(121) | 36 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | -- A utility function
(<<) :: Int -> Int -> Int
x << i = shift x i | 66 | (<<) :: Int -> Int -> Int
x << i = shift x i | 44 | x << i = shift x i | 18 | true | true | 0 | 9 | 17 | 34 | 17 | 17 | null | null |
d0kt0r0/estuary | client/src/Estuary/Widgets/Terminal.hs | gpl-3.0 | doCommands _ irc (Terminal.SetCC n v) = setCC n v irc >> return Nothing | 71 | doCommands _ irc (Terminal.SetCC n v) = setCC n v irc >> return Nothing | 71 | doCommands _ irc (Terminal.SetCC n v) = setCC n v irc >> return Nothing | 71 | false | false | 0 | 8 | 13 | 37 | 17 | 20 | null | null |
PavelClaudiuStefan/FMI | An_3_Semestru_1/ProgramareDeclarativa/Laboratoare/Laborator1Optional/labweekchess.hs | cc0-1.0 | -- d)
whiteRow :: Picture
whiteRow = undefined | 47 | whiteRow :: Picture
whiteRow = undefined | 40 | whiteRow = undefined | 20 | true | true | 0 | 4 | 8 | 12 | 7 | 5 | null | null |
tokiwoousaka/egison4 | hs-src/Language/Egison/Parser.hs | mit | keywordDo = reserved "do" | 33 | keywordDo = reserved "do" | 33 | keywordDo = reserved "do" | 33 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
Numberartificial/workflow | snipets/src/Craft/RPS.hs | mit | -- Echo the previous move; also have to supply starting Move.
echo :: Move -> Strategy
echo start moves
= case moves of
[] -> start
(last:_) -> last
-- Echo a move that would have lost the last play;
-- also have to supply starting Move. | 274 | echo :: Move -> Strategy
echo start moves
= case moves of
[] -> start
(last:_) -> last
-- Echo a move that would have lost the last play;
-- also have to supply starting Move. | 210 | echo start moves
= case moves of
[] -> start
(last:_) -> last
-- Echo a move that would have lost the last play;
-- also have to supply starting Move. | 185 | true | true | 0 | 9 | 83 | 54 | 27 | 27 | null | null |
stevely/AutoStorable | test/AutoStorableTests.hs | mit | testS2aaMarshalTest :: Char -> Property
testS2aaMarshalTest c = monadicIO $ do
testData' <- run (with testData peek)
assert (testData == testData')
where
testData = TestS2aa c | 189 | testS2aaMarshalTest :: Char -> Property
testS2aaMarshalTest c = monadicIO $ do
testData' <- run (with testData peek)
assert (testData == testData')
where
testData = TestS2aa c | 189 | testS2aaMarshalTest c = monadicIO $ do
testData' <- run (with testData peek)
assert (testData == testData')
where
testData = TestS2aa c | 149 | false | true | 0 | 11 | 39 | 64 | 30 | 34 | null | null |
mettekou/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprInstr (SUBFE reg1 reg2 reg3) = pprLogic (sLit "subfe") reg1 reg2 (RIReg reg3) | 80 | pprInstr (SUBFE reg1 reg2 reg3) = pprLogic (sLit "subfe") reg1 reg2 (RIReg reg3) | 80 | pprInstr (SUBFE reg1 reg2 reg3) = pprLogic (sLit "subfe") reg1 reg2 (RIReg reg3) | 80 | false | false | 0 | 7 | 12 | 41 | 19 | 22 | null | null |
ndmitchell/extra | benchmark/Main.hs | bsd-3-clause | intFew :: [Int]
intFew = take inputSize (cycle [1..100000]) | 59 | intFew :: [Int]
intFew = take inputSize (cycle [1..100000]) | 59 | intFew = take inputSize (cycle [1..100000]) | 43 | false | true | 0 | 8 | 8 | 30 | 16 | 14 | null | null |
rahulmutt/ghcvm | compiler/Eta/Core/TrieMap.hs | bsd-3-clause | xtE env (Case e b ty as) f m
| null as = m { cm_ecase = cm_ecase m |> xtE env e |>> xtT env ty f }
| otherwise = m { cm_case = cm_case m |> xtE env e
|>> let env1 = extendCME env b
in xtList (xtA env1) as f } | 358 | xtE env (Case e b ty as) f m
| null as = m { cm_ecase = cm_ecase m |> xtE env e |>> xtT env ty f }
| otherwise = m { cm_case = cm_case m |> xtE env e
|>> let env1 = extendCME env b
in xtList (xtA env1) as f } | 358 | xtE env (Case e b ty as) f m
| null as = m { cm_ecase = cm_ecase m |> xtE env e |>> xtT env ty f }
| otherwise = m { cm_case = cm_case m |> xtE env e
|>> let env1 = extendCME env b
in xtList (xtA env1) as f } | 358 | false | false | 0 | 13 | 205 | 130 | 60 | 70 | null | null |
brendanhay/gogol | gogol-run/gen/Network/Google/Resource/Run/Projects/Locations/Routes/Get.hs | mpl-2.0 | -- | V1 error format.
plrgXgafv :: Lens' ProjectsLocationsRoutesGet (Maybe Xgafv)
plrgXgafv
= lens _plrgXgafv (\ s a -> s{_plrgXgafv = a}) | 140 | plrgXgafv :: Lens' ProjectsLocationsRoutesGet (Maybe Xgafv)
plrgXgafv
= lens _plrgXgafv (\ s a -> s{_plrgXgafv = a}) | 118 | plrgXgafv
= lens _plrgXgafv (\ s a -> s{_plrgXgafv = a}) | 58 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
k0001/gtk2hs | tools/apiGen/src/ModuleScan.hs | gpl-3.0 | scanLine line ("{#":"import":moduleName)= scanImport line moduleName | 68 | scanLine line ("{#":"import":moduleName)= scanImport line moduleName | 68 | scanLine line ("{#":"import":moduleName)= scanImport line moduleName | 68 | false | false | 0 | 8 | 5 | 27 | 13 | 14 | null | null |
ntc2/cryptol | src/Cryptol/TypeCheck/Solver/Numeric/Simplify.hs | bsd-3-clause | cryNoInf :: Expr -> IfExpr Expr
cryNoInf expr =
case expr of
-- These are the interesting cases where we have to branch
x :* y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return zero) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero) (return inf)
_ -> return (x' :* y')
x :^^ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return one) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero)
$ mkIf (x' :==: one) (return one)
$ return inf
_ -> return (x' :^^ y')
-- The rest just propagates
K _ -> return expr
Var _ -> return expr
x :+ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (x' :+ y')
x :- y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(_, K Inf) -> Impossible
(K Inf, _) -> return inf
_ -> mkIf (x' :==: y)
(return zero)
(mkIf (x' :>: y) (return (x' :- y'))
Impossible)
Div x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> Impossible
(_, K Inf) -> return zero
_ -> mkIf (y' :>: zero) (return (Div x' y')) Impossible
Mod x y ->
do x' <- cryNoInf x
-- `Mod x y` is finite, even if `y` is `inf`, so first check
-- for finiteness.
mkIf (Fin y)
(do y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> Impossible
(_, K Inf) -> Impossible
_ -> mkIf (y' :>: zero) (return (Mod x' y')) Impossible
)
(return x')
Min x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> return y'
(_, K Inf) -> return x'
_ -> return (Min x' y')
Max x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (Max x' y')
Width x ->
do x' <- cryNoInf x
case x' of
K Inf -> return inf
_ -> return (Width x')
LenFromThen x y w -> fun3 LenFromThen x y w
LenFromThenTo x y z -> fun3 LenFromThenTo x y z
where
fun3 f x y z =
do x' <- cryNoInf x
y' <- cryNoInf y
z' <- cryNoInf z
case (x',y',z') of
(K Inf, _, _) -> Impossible
(_, K Inf, _) -> Impossible
(_, _, K Inf) -> Impossible
_ -> mkIf (x' :==: y') Impossible
(return (f x' y' z'))
mkIf p t e = case crySimplify p of
PTrue -> t
PFalse -> e
p' -> If p' t e
-- | Make an expression that should work ONLY on natural nubers.
-- Eliminates occurances of @inf@.
-- Assumes that the two input expressions are well-formed and finite.
-- The expression is constructed by the given function. | 3,629 | cryNoInf :: Expr -> IfExpr Expr
cryNoInf expr =
case expr of
-- These are the interesting cases where we have to branch
x :* y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return zero) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero) (return inf)
_ -> return (x' :* y')
x :^^ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return one) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero)
$ mkIf (x' :==: one) (return one)
$ return inf
_ -> return (x' :^^ y')
-- The rest just propagates
K _ -> return expr
Var _ -> return expr
x :+ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (x' :+ y')
x :- y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(_, K Inf) -> Impossible
(K Inf, _) -> return inf
_ -> mkIf (x' :==: y)
(return zero)
(mkIf (x' :>: y) (return (x' :- y'))
Impossible)
Div x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> Impossible
(_, K Inf) -> return zero
_ -> mkIf (y' :>: zero) (return (Div x' y')) Impossible
Mod x y ->
do x' <- cryNoInf x
-- `Mod x y` is finite, even if `y` is `inf`, so first check
-- for finiteness.
mkIf (Fin y)
(do y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> Impossible
(_, K Inf) -> Impossible
_ -> mkIf (y' :>: zero) (return (Mod x' y')) Impossible
)
(return x')
Min x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> return y'
(_, K Inf) -> return x'
_ -> return (Min x' y')
Max x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (Max x' y')
Width x ->
do x' <- cryNoInf x
case x' of
K Inf -> return inf
_ -> return (Width x')
LenFromThen x y w -> fun3 LenFromThen x y w
LenFromThenTo x y z -> fun3 LenFromThenTo x y z
where
fun3 f x y z =
do x' <- cryNoInf x
y' <- cryNoInf y
z' <- cryNoInf z
case (x',y',z') of
(K Inf, _, _) -> Impossible
(_, K Inf, _) -> Impossible
(_, _, K Inf) -> Impossible
_ -> mkIf (x' :==: y') Impossible
(return (f x' y' z'))
mkIf p t e = case crySimplify p of
PTrue -> t
PFalse -> e
p' -> If p' t e
-- | Make an expression that should work ONLY on natural nubers.
-- Eliminates occurances of @inf@.
-- Assumes that the two input expressions are well-formed and finite.
-- The expression is constructed by the given function. | 3,629 | cryNoInf expr =
case expr of
-- These are the interesting cases where we have to branch
x :* y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return zero) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero) (return inf)
_ -> return (x' :* y')
x :^^ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, K Inf) -> return inf
(K Inf, _) -> mkIf (y' :==: zero) (return one) (return inf)
(_, K Inf) -> mkIf (x' :==: zero) (return zero)
$ mkIf (x' :==: one) (return one)
$ return inf
_ -> return (x' :^^ y')
-- The rest just propagates
K _ -> return expr
Var _ -> return expr
x :+ y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (x' :+ y')
x :- y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(_, K Inf) -> Impossible
(K Inf, _) -> return inf
_ -> mkIf (x' :==: y)
(return zero)
(mkIf (x' :>: y) (return (x' :- y'))
Impossible)
Div x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> Impossible
(_, K Inf) -> return zero
_ -> mkIf (y' :>: zero) (return (Div x' y')) Impossible
Mod x y ->
do x' <- cryNoInf x
-- `Mod x y` is finite, even if `y` is `inf`, so first check
-- for finiteness.
mkIf (Fin y)
(do y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> Impossible
(_, K Inf) -> Impossible
_ -> mkIf (y' :>: zero) (return (Mod x' y')) Impossible
)
(return x')
Min x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x',y') of
(K Inf, _) -> return y'
(_, K Inf) -> return x'
_ -> return (Min x' y')
Max x y ->
do x' <- cryNoInf x
y' <- cryNoInf y
case (x', y') of
(K Inf, _) -> return inf
(_, K Inf) -> return inf
_ -> return (Max x' y')
Width x ->
do x' <- cryNoInf x
case x' of
K Inf -> return inf
_ -> return (Width x')
LenFromThen x y w -> fun3 LenFromThen x y w
LenFromThenTo x y z -> fun3 LenFromThenTo x y z
where
fun3 f x y z =
do x' <- cryNoInf x
y' <- cryNoInf y
z' <- cryNoInf z
case (x',y',z') of
(K Inf, _, _) -> Impossible
(_, K Inf, _) -> Impossible
(_, _, K Inf) -> Impossible
_ -> mkIf (x' :==: y') Impossible
(return (f x' y' z'))
mkIf p t e = case crySimplify p of
PTrue -> t
PFalse -> e
p' -> If p' t e
-- | Make an expression that should work ONLY on natural nubers.
-- Eliminates occurances of @inf@.
-- Assumes that the two input expressions are well-formed and finite.
-- The expression is constructed by the given function. | 3,597 | false | true | 13 | 18 | 1,710 | 1,362 | 664 | 698 | null | null |
ant1441/haskell-statsd | src/Statsd/Config.hs | bsd-3-clause | parseArgs func = execParser opts >>= func
where
opts = info (helper <*> optParser)
( fullDesc
<> progDesc "Haskell clone of etsy's statsd"
<> header "statsd header" ) | 214 | parseArgs func = execParser opts >>= func
where
opts = info (helper <*> optParser)
( fullDesc
<> progDesc "Haskell clone of etsy's statsd"
<> header "statsd header" ) | 214 | parseArgs func = execParser opts >>= func
where
opts = info (helper <*> optParser)
( fullDesc
<> progDesc "Haskell clone of etsy's statsd"
<> header "statsd header" ) | 214 | false | false | 0 | 9 | 75 | 53 | 25 | 28 | null | null |
tolysz/prepare-ghcjs | spec-lts8/base/Data/Semigroup.hs | bsd-3-clause | stimesIdempotent :: Integral b => b -> a -> a
stimesIdempotent n x
| n <= 0 = errorWithoutStackTrace "stimesIdempotent: positive multiplier expected"
| otherwise = x | 169 | stimesIdempotent :: Integral b => b -> a -> a
stimesIdempotent n x
| n <= 0 = errorWithoutStackTrace "stimesIdempotent: positive multiplier expected"
| otherwise = x | 169 | stimesIdempotent n x
| n <= 0 = errorWithoutStackTrace "stimesIdempotent: positive multiplier expected"
| otherwise = x | 123 | false | true | 1 | 8 | 30 | 52 | 24 | 28 | null | null |
robx/puzzle-draw | src/Draw/Draw.hs | mit | withConfig :: (Config -> QDrawing b v n m) -> QDrawing b v n m
withConfig f = Drawing $ \cfg -> diagram cfg (f cfg) | 115 | withConfig :: (Config -> QDrawing b v n m) -> QDrawing b v n m
withConfig f = Drawing $ \cfg -> diagram cfg (f cfg) | 115 | withConfig f = Drawing $ \cfg -> diagram cfg (f cfg) | 52 | false | true | 0 | 9 | 25 | 63 | 31 | 32 | null | null |
bumptech/riak-haskell-client | src/Network/Riak/Value.hs | apache-2.0 | convert :: IsContent v => Bucket -> Seq.Seq Content -> IO [v]
convert bucket = go [] [] . toList . C.sortContent
where go cs vs (x:xs) = case fromContent bucket y of
Just v -> go cs (v:vs) xs
_ -> go (y:cs) vs xs
where y = unescapeLinks x
go [] vs _ = return (reverse vs)
go cs _ _ = typeError "Network.Riak.Value" "convert" $
show (length cs) ++ " values failed conversion: " ++
show cs | 557 | convert :: IsContent v => Bucket -> Seq.Seq Content -> IO [v]
convert bucket = go [] [] . toList . C.sortContent
where go cs vs (x:xs) = case fromContent bucket y of
Just v -> go cs (v:vs) xs
_ -> go (y:cs) vs xs
where y = unescapeLinks x
go [] vs _ = return (reverse vs)
go cs _ _ = typeError "Network.Riak.Value" "convert" $
show (length cs) ++ " values failed conversion: " ++
show cs | 557 | convert bucket = go [] [] . toList . C.sortContent
where go cs vs (x:xs) = case fromContent bucket y of
Just v -> go cs (v:vs) xs
_ -> go (y:cs) vs xs
where y = unescapeLinks x
go [] vs _ = return (reverse vs)
go cs _ _ = typeError "Network.Riak.Value" "convert" $
show (length cs) ++ " values failed conversion: " ++
show cs | 495 | false | true | 1 | 10 | 249 | 217 | 100 | 117 | null | null |
isomorphism/csound-expression | src/Csound/Control/Gui.hs | bsd-3-clause | -- | Monadic apply with vertical concatenation of visuals.
vapply :: (a -> Source b) -> Source a -> Source b
vapply = flip $ genBind (\a b -> ver [b, a]) | 153 | vapply :: (a -> Source b) -> Source a -> Source b
vapply = flip $ genBind (\a b -> ver [b, a]) | 94 | vapply = flip $ genBind (\a b -> ver [b, a]) | 44 | true | true | 0 | 10 | 31 | 62 | 32 | 30 | null | null |
yigitozkavci/ivy | src/Cenary/Codegen.hs | mit | codegenGlobalStmt :: CodegenM m => GlobalStmt -> m ()
codegenGlobalStmt (GlobalFunc funStmt) = codegenFunDef funStmt | 116 | codegenGlobalStmt :: CodegenM m => GlobalStmt -> m ()
codegenGlobalStmt (GlobalFunc funStmt) = codegenFunDef funStmt | 116 | codegenGlobalStmt (GlobalFunc funStmt) = codegenFunDef funStmt | 62 | false | true | 0 | 8 | 14 | 43 | 19 | 24 | null | null |
mrmonday/Idris-dev | src/Idris/REPLParser.hs | bsd-3-clause | nameArg, fnNameArg :: (Name -> Command) -> String -> P.IdrisParser (Either String Command)
nameArg = genArg "name" $ fst <$> P.name | 131 | nameArg, fnNameArg :: (Name -> Command) -> String -> P.IdrisParser (Either String Command)
nameArg = genArg "name" $ fst <$> P.name | 131 | nameArg = genArg "name" $ fst <$> P.name | 40 | false | true | 4 | 10 | 20 | 65 | 29 | 36 | null | null |
Southern-Exposure-Seed-Exchange/southernexposure.com | server/src/Models/PersistJSON.hs | gpl-3.0 | fromPersistValueParseError :: (Show a)
=> Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"
-> a -- ^ Received value
-> Text -- ^ Additional error
-> Text -- ^ Error message
fromPersistValueParseError haskellType received err = T.concat
[ "Failed to parse Haskell type `"
, haskellType
, "`, but received "
, T.pack (show received)
, " | with error: "
, err
] | 517 | fromPersistValueParseError :: (Show a)
=> Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"
-> a -- ^ Received value
-> Text -- ^ Additional error
-> Text
fromPersistValueParseError haskellType received err = T.concat
[ "Failed to parse Haskell type `"
, haskellType
, "`, but received "
, T.pack (show received)
, " | with error: "
, err
] | 498 | fromPersistValueParseError haskellType received err = T.concat
[ "Failed to parse Haskell type `"
, haskellType
, "`, but received "
, T.pack (show received)
, " | with error: "
, err
] | 213 | true | true | 0 | 10 | 203 | 83 | 44 | 39 | null | null |
ThoughtLeadr/Riak-Haskell-HTTP-Client | src/Network/Riak/HTTP/MapReduce.hs | bsd-3-clause | functionJSONAttrs :: MRFunction -> [Pair]
functionJSONAttrs func = case func of
ErlangNamed m n -> ["language" .= e, "module" .= m, "function" .= n]
JSObject b k -> ["language" .= j, "bucket" .= b, "key" .= k]
JSNamed m n -> ["language" .= j, "module" .= m, "function" .= n]
JSCode code -> ["language" .= j, "source" .= code]
where
e = "erlang" :: String
j = "javascript" :: String
-- | Because it's possible to pattern-match in Erlang on @none@ on the
-- argument parameter with the expectation that no @arg@ parameter has
-- been passed in, even though that's probably the wrong thing to do. For
-- safety, only put @arg@ in the JSON if we passed in @Just x@. | 698 | functionJSONAttrs :: MRFunction -> [Pair]
functionJSONAttrs func = case func of
ErlangNamed m n -> ["language" .= e, "module" .= m, "function" .= n]
JSObject b k -> ["language" .= j, "bucket" .= b, "key" .= k]
JSNamed m n -> ["language" .= j, "module" .= m, "function" .= n]
JSCode code -> ["language" .= j, "source" .= code]
where
e = "erlang" :: String
j = "javascript" :: String
-- | Because it's possible to pattern-match in Erlang on @none@ on the
-- argument parameter with the expectation that no @arg@ parameter has
-- been passed in, even though that's probably the wrong thing to do. For
-- safety, only put @arg@ in the JSON if we passed in @Just x@. | 698 | functionJSONAttrs func = case func of
ErlangNamed m n -> ["language" .= e, "module" .= m, "function" .= n]
JSObject b k -> ["language" .= j, "bucket" .= b, "key" .= k]
JSNamed m n -> ["language" .= j, "module" .= m, "function" .= n]
JSCode code -> ["language" .= j, "source" .= code]
where
e = "erlang" :: String
j = "javascript" :: String
-- | Because it's possible to pattern-match in Erlang on @none@ on the
-- argument parameter with the expectation that no @arg@ parameter has
-- been passed in, even though that's probably the wrong thing to do. For
-- safety, only put @arg@ in the JSON if we passed in @Just x@. | 656 | false | true | 22 | 11 | 158 | 176 | 89 | 87 | null | null |
nevrenato/Hets_Fork | Common/IRI.hs | gpl-2.0 | {- | Turn a string containing an IRI or a CURIE into an 'IRI'.
Returns 'Nothing' if the string is not a valid IRI;
(an absolute IRI enclosed in '<' and '>' with optional fragment identifier
or a CURIE). -}
parseIRICurie :: String -> Maybe IRI
parseIRICurie = parseIRIAny iriCurie | 279 | parseIRICurie :: String -> Maybe IRI
parseIRICurie = parseIRIAny iriCurie | 73 | parseIRICurie = parseIRIAny iriCurie | 36 | true | true | 0 | 6 | 49 | 22 | 11 | 11 | null | null |
jBugman/fun-lang | src/Fun/Go/Printer.hs | mit | pprint (L [ KW "interface" , n@(ID _ _) ]) = do
n' <- pprint n
pure $ kwType <+> n' <+> text "interface" <> emptyBraces | 128 | pprint (L [ KW "interface" , n@(ID _ _) ]) = do
n' <- pprint n
pure $ kwType <+> n' <+> text "interface" <> emptyBraces | 128 | pprint (L [ KW "interface" , n@(ID _ _) ]) = do
n' <- pprint n
pure $ kwType <+> n' <+> text "interface" <> emptyBraces | 128 | false | false | 0 | 11 | 34 | 67 | 32 | 35 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrelNames.hs | bsd-3-clause | emptyCallStackKey, pushCallStackKey :: Unique
emptyCallStackKey = mkPreludeMiscIdUnique 551 | 91 | emptyCallStackKey, pushCallStackKey :: Unique
emptyCallStackKey = mkPreludeMiscIdUnique 551 | 91 | emptyCallStackKey = mkPreludeMiscIdUnique 551 | 45 | false | true | 0 | 5 | 7 | 16 | 9 | 7 | null | null |
beni55/attoparsec | benchmarks/warp-3.0.1.1/Network/Wai/Handler/Warp/RequestHeader.hs | bsd-3-clause | parseHeaderLines (firstLine:otherLines) = do
(method, path', query, httpversion) <- parseRequestLine firstLine
let path = H.extractPath path'
hdr = map parseHeader otherLines
return (method, path', path, query, httpversion, hdr)
----------------------------------------------------------------
-- |
--
-- >>> parseRequestLine "GET / HTTP/1.1"
-- ("GET","/","",HTTP/1.1)
-- >>> parseRequestLine "POST /cgi/search.cgi?key=foo HTTP/1.0"
-- ("POST","/cgi/search.cgi","?key=foo",HTTP/1.0)
-- >>> parseRequestLine "GET "
-- *** Exception: Warp: Invalid first line of request: "GET "
-- >>> parseRequestLine "GET /NotHTTP UNKNOWN/1.1"
-- *** Exception: Warp: Request line specified a non-HTTP request | 715 | parseHeaderLines (firstLine:otherLines) = do
(method, path', query, httpversion) <- parseRequestLine firstLine
let path = H.extractPath path'
hdr = map parseHeader otherLines
return (method, path', path, query, httpversion, hdr)
----------------------------------------------------------------
-- |
--
-- >>> parseRequestLine "GET / HTTP/1.1"
-- ("GET","/","",HTTP/1.1)
-- >>> parseRequestLine "POST /cgi/search.cgi?key=foo HTTP/1.0"
-- ("POST","/cgi/search.cgi","?key=foo",HTTP/1.0)
-- >>> parseRequestLine "GET "
-- *** Exception: Warp: Invalid first line of request: "GET "
-- >>> parseRequestLine "GET /NotHTTP UNKNOWN/1.1"
-- *** Exception: Warp: Request line specified a non-HTTP request | 715 | parseHeaderLines (firstLine:otherLines) = do
(method, path', query, httpversion) <- parseRequestLine firstLine
let path = H.extractPath path'
hdr = map parseHeader otherLines
return (method, path', path, query, httpversion, hdr)
----------------------------------------------------------------
-- |
--
-- >>> parseRequestLine "GET / HTTP/1.1"
-- ("GET","/","",HTTP/1.1)
-- >>> parseRequestLine "POST /cgi/search.cgi?key=foo HTTP/1.0"
-- ("POST","/cgi/search.cgi","?key=foo",HTTP/1.0)
-- >>> parseRequestLine "GET "
-- *** Exception: Warp: Invalid first line of request: "GET "
-- >>> parseRequestLine "GET /NotHTTP UNKNOWN/1.1"
-- *** Exception: Warp: Request line specified a non-HTTP request | 715 | false | false | 0 | 11 | 101 | 97 | 56 | 41 | null | null |
zeekay/lambdabot | IRCBase.hs | mit | -- | 'channels' extracts the channels a IrcMessage operate on.
channels :: IrcMessage -> [Nick]
channels msg
= let cstr = head $ msgParams msg
in map (Nick (msgServer msg)) $
map (\(x:xs) -> if x == ':' then xs else x:xs) (split "," cstr) | 251 | channels :: IrcMessage -> [Nick]
channels msg
= let cstr = head $ msgParams msg
in map (Nick (msgServer msg)) $
map (\(x:xs) -> if x == ':' then xs else x:xs) (split "," cstr) | 188 | channels msg
= let cstr = head $ msgParams msg
in map (Nick (msgServer msg)) $
map (\(x:xs) -> if x == ':' then xs else x:xs) (split "," cstr) | 155 | true | true | 0 | 12 | 57 | 103 | 53 | 50 | null | null |
vincenthz/cryptonite | tests/KAT_PubKey/Rabin.hs | bsd-3-clause | basicRabinEncryptionVectors =
[ EncryptionVector
{ plainText = "\x75\x0c\x40\x47\xf5\x47\xe8\xe4\x14\x11\x85\x65\x23\x29\x8a\xc9\xba\xe2\x45\xef\xaf\x13\x97\xfb\xe5\x6f\x9d\xd5"
, seed = "\x0c\xc7\x42\xce\x4a\x9b\x7f\x32\xf9\x51\xbc\xb2\x51\xef\xd9\x25\xfe\x4f\xe3\x5f"
, cipherText = "\xaf\xc7\x03\xe3\x9d\x2f\x81\xc6\x3a\x80\x2a\xd1\x44\x26\x3f\x17\x0c\x0a\xe6\x48\x68\x98\x23\x14\x8f\x95\xd2\xce\xbb\xe7\x3f\x49\x34\x76\x1d\x99\x30\x7b\xeb\x84\xe5\x2a\x10\xd2\x1e\x11\x7e\x65\xe8\x88\x24\xc1\x12\xeb\x19\x0d\x97\xcd\x12\x25\x6b\x1f\x9b\x0c\x40\x40\xa3\x47\x00\xb7\x11\xf8\x50\x08\x51\x79\xe8\x1b\xd1\x77\xe0\x99\xa7\xe1\x5c\x63\xda\x29\xc7\xde\x28\x5d\x60\xed\x8e\xb2\x12\xd4\xfe\xb8\x1a\x5d\x17\x65\x80\x62\x6e\x65\x5c\x37\x07\x1c\xfa\xff\xe6\x21\xa5\x9f\xcd\x6a\x6a\xce\xa6\x96\xb2\xc5\x08\xe6"
}
] | 846 | basicRabinEncryptionVectors =
[ EncryptionVector
{ plainText = "\x75\x0c\x40\x47\xf5\x47\xe8\xe4\x14\x11\x85\x65\x23\x29\x8a\xc9\xba\xe2\x45\xef\xaf\x13\x97\xfb\xe5\x6f\x9d\xd5"
, seed = "\x0c\xc7\x42\xce\x4a\x9b\x7f\x32\xf9\x51\xbc\xb2\x51\xef\xd9\x25\xfe\x4f\xe3\x5f"
, cipherText = "\xaf\xc7\x03\xe3\x9d\x2f\x81\xc6\x3a\x80\x2a\xd1\x44\x26\x3f\x17\x0c\x0a\xe6\x48\x68\x98\x23\x14\x8f\x95\xd2\xce\xbb\xe7\x3f\x49\x34\x76\x1d\x99\x30\x7b\xeb\x84\xe5\x2a\x10\xd2\x1e\x11\x7e\x65\xe8\x88\x24\xc1\x12\xeb\x19\x0d\x97\xcd\x12\x25\x6b\x1f\x9b\x0c\x40\x40\xa3\x47\x00\xb7\x11\xf8\x50\x08\x51\x79\xe8\x1b\xd1\x77\xe0\x99\xa7\xe1\x5c\x63\xda\x29\xc7\xde\x28\x5d\x60\xed\x8e\xb2\x12\xd4\xfe\xb8\x1a\x5d\x17\x65\x80\x62\x6e\x65\x5c\x37\x07\x1c\xfa\xff\xe6\x21\xa5\x9f\xcd\x6a\x6a\xce\xa6\x96\xb2\xc5\x08\xe6"
}
] | 846 | basicRabinEncryptionVectors =
[ EncryptionVector
{ plainText = "\x75\x0c\x40\x47\xf5\x47\xe8\xe4\x14\x11\x85\x65\x23\x29\x8a\xc9\xba\xe2\x45\xef\xaf\x13\x97\xfb\xe5\x6f\x9d\xd5"
, seed = "\x0c\xc7\x42\xce\x4a\x9b\x7f\x32\xf9\x51\xbc\xb2\x51\xef\xd9\x25\xfe\x4f\xe3\x5f"
, cipherText = "\xaf\xc7\x03\xe3\x9d\x2f\x81\xc6\x3a\x80\x2a\xd1\x44\x26\x3f\x17\x0c\x0a\xe6\x48\x68\x98\x23\x14\x8f\x95\xd2\xce\xbb\xe7\x3f\x49\x34\x76\x1d\x99\x30\x7b\xeb\x84\xe5\x2a\x10\xd2\x1e\x11\x7e\x65\xe8\x88\x24\xc1\x12\xeb\x19\x0d\x97\xcd\x12\x25\x6b\x1f\x9b\x0c\x40\x40\xa3\x47\x00\xb7\x11\xf8\x50\x08\x51\x79\xe8\x1b\xd1\x77\xe0\x99\xa7\xe1\x5c\x63\xda\x29\xc7\xde\x28\x5d\x60\xed\x8e\xb2\x12\xd4\xfe\xb8\x1a\x5d\x17\x65\x80\x62\x6e\x65\x5c\x37\x07\x1c\xfa\xff\xe6\x21\xa5\x9f\xcd\x6a\x6a\xce\xa6\x96\xb2\xc5\x08\xe6"
}
] | 846 | false | false | 0 | 7 | 60 | 29 | 18 | 11 | null | null |
shlevy/ghc | compiler/nativeGen/X86/Regs.hs | bsd-3-clause | xmm8 = regSingle 32 | 20 | xmm8 = regSingle 32 | 20 | xmm8 = regSingle 32 | 20 | false | false | 1 | 5 | 4 | 12 | 4 | 8 | null | null |
seereason/ghcjs-jquery | JavaScript/JQuery.hs | mit | beforeJQuery :: JQuery -> JQuery -> IO JQuery
beforeJQuery j jq = jq_before_jq j jq | 83 | beforeJQuery :: JQuery -> JQuery -> IO JQuery
beforeJQuery j jq = jq_before_jq j jq | 83 | beforeJQuery j jq = jq_before_jq j jq | 37 | false | true | 0 | 7 | 14 | 32 | 15 | 17 | null | null |
MicheleCastrovilli/EuPhBot | Library/Euphs/Commands.hs | bsd-3-clause | inPair :: EuphCommand -> [(T.Text, J.Value)]
inPair (Nick nickname) =
[
("type" , "nick" ),
("data" , J.object [ "name" J..= nickname])
] | 150 | inPair :: EuphCommand -> [(T.Text, J.Value)]
inPair (Nick nickname) =
[
("type" , "nick" ),
("data" , J.object [ "name" J..= nickname])
] | 150 | inPair (Nick nickname) =
[
("type" , "nick" ),
("data" , J.object [ "name" J..= nickname])
] | 105 | false | true | 0 | 10 | 35 | 75 | 40 | 35 | null | null |
schell/odin | odin-engine/src/Odin/Engine/New.hs | mit | loadAtlasInto
:: MonadIO m
=> TVar FontMap
-> FontDescriptor
-> String
-> m (Maybe Atlas)
loadAtlasInto tvFontMap desc@(FontDescriptor font sz) chars = do
atlases <- liftIO $ readTVarIO tvFontMap
case M.lookup desc atlases of
Nothing -> liftIO (allocAtlas font sz chars) >>= \case
Nothing -> return Nothing
Just atlas -> do saveAtlasInto tvFontMap atlas
return $ Just atlas
Just atlas -> return $ Just atlas | 467 | loadAtlasInto
:: MonadIO m
=> TVar FontMap
-> FontDescriptor
-> String
-> m (Maybe Atlas)
loadAtlasInto tvFontMap desc@(FontDescriptor font sz) chars = do
atlases <- liftIO $ readTVarIO tvFontMap
case M.lookup desc atlases of
Nothing -> liftIO (allocAtlas font sz chars) >>= \case
Nothing -> return Nothing
Just atlas -> do saveAtlasInto tvFontMap atlas
return $ Just atlas
Just atlas -> return $ Just atlas | 467 | loadAtlasInto tvFontMap desc@(FontDescriptor font sz) chars = do
atlases <- liftIO $ readTVarIO tvFontMap
case M.lookup desc atlases of
Nothing -> liftIO (allocAtlas font sz chars) >>= \case
Nothing -> return Nothing
Just atlas -> do saveAtlasInto tvFontMap atlas
return $ Just atlas
Just atlas -> return $ Just atlas | 367 | false | true | 17 | 7 | 124 | 148 | 76 | 72 | null | null |
skogsbaer/HTF | Test/Framework/HUnitWrapper.hs | lgpl-2.1 | -- | Fail if evaluating the expression of type @a@ does not
-- throw any exception, supplying an additional error message.
assertThrowsSomeVerbose :: HasCallStack => String -> a -> IO ()
assertThrowsSomeVerbose = assertThrowsSome_ "assertThrowsSomeVerbose" | 256 | assertThrowsSomeVerbose :: HasCallStack => String -> a -> IO ()
assertThrowsSomeVerbose = assertThrowsSome_ "assertThrowsSomeVerbose" | 133 | assertThrowsSomeVerbose = assertThrowsSome_ "assertThrowsSomeVerbose" | 69 | true | true | 0 | 9 | 34 | 34 | 17 | 17 | null | null |
romanb/amazonka | amazonka-cloudwatch-logs/gen/Network/AWS/CloudWatchLogs/Types.hs | mpl-2.0 | rleiTooOldLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)
rleiTooOldLogEventEndIndex =
lens _rleiTooOldLogEventEndIndex
(\s a -> s { _rleiTooOldLogEventEndIndex = a }) | 191 | rleiTooOldLogEventEndIndex :: Lens' RejectedLogEventsInfo (Maybe Int)
rleiTooOldLogEventEndIndex =
lens _rleiTooOldLogEventEndIndex
(\s a -> s { _rleiTooOldLogEventEndIndex = a }) | 191 | rleiTooOldLogEventEndIndex =
lens _rleiTooOldLogEventEndIndex
(\s a -> s { _rleiTooOldLogEventEndIndex = a }) | 121 | false | true | 1 | 9 | 30 | 50 | 24 | 26 | null | null |
ArnoVanLumig/chesshs | Chess.hs | bsd-3-clause | posToStr (x,y) = [chr (x + 97), chr (y + 49)] | 45 | posToStr (x,y) = [chr (x + 97), chr (y + 49)] | 45 | posToStr (x,y) = [chr (x + 97), chr (y + 49)] | 45 | false | false | 0 | 8 | 10 | 42 | 22 | 20 | null | null |
siddhanathan/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | -- | lowerise word under the cursor
lowercaseWordB :: BufferM ()
lowercaseWordB = transformB (R.withText T.toLower) unitWord Forward | 132 | lowercaseWordB :: BufferM ()
lowercaseWordB = transformB (R.withText T.toLower) unitWord Forward | 96 | lowercaseWordB = transformB (R.withText T.toLower) unitWord Forward | 67 | true | true | 0 | 8 | 17 | 34 | 17 | 17 | null | null |
ucam-cl-dtg/naps-camfort | Extensions/Units.hs | mit | inferStmtUnits (NullStmt _ _) = return () | 41 | inferStmtUnits (NullStmt _ _) = return () | 41 | inferStmtUnits (NullStmt _ _) = return () | 41 | false | false | 0 | 7 | 6 | 22 | 10 | 12 | null | null |
beni55/hscurses | UI/HSCurses/Widgets.hs | lgpl-2.1 | findFirstActiveCell :: [Row] -> TableWidgetOptions -> Maybe Pos
findFirstActiveCell rows opts =
let nrows = length rows
firstActiveCells = map (\y -> findNextActiveCell opts nrows
(y, -1) DirRight)
[0..nrows-1]
in case catMaybes firstActiveCells of
[] -> Nothing
(x:_) -> Just x | 412 | findFirstActiveCell :: [Row] -> TableWidgetOptions -> Maybe Pos
findFirstActiveCell rows opts =
let nrows = length rows
firstActiveCells = map (\y -> findNextActiveCell opts nrows
(y, -1) DirRight)
[0..nrows-1]
in case catMaybes firstActiveCells of
[] -> Nothing
(x:_) -> Just x | 412 | findFirstActiveCell rows opts =
let nrows = length rows
firstActiveCells = map (\y -> findNextActiveCell opts nrows
(y, -1) DirRight)
[0..nrows-1]
in case catMaybes firstActiveCells of
[] -> Nothing
(x:_) -> Just x | 348 | false | true | 0 | 14 | 174 | 119 | 60 | 59 | null | null |
bitemyapp/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | isSymOcc (OccName TvName s) = isLexSym s | 43 | isSymOcc (OccName TvName s) = isLexSym s | 43 | isSymOcc (OccName TvName s) = isLexSym s | 43 | false | false | 0 | 7 | 9 | 20 | 9 | 11 | null | null |
raimohanska/reactive-bacon | src/Reactive/Bacon/EventStream.hs | bsd-3-clause | mapE :: EventSource s => (a -> b) -> s a -> IO (EventStream b)
mapE f = return . (fmap f) . obs | 95 | mapE :: EventSource s => (a -> b) -> s a -> IO (EventStream b)
mapE f = return . (fmap f) . obs | 95 | mapE f = return . (fmap f) . obs | 32 | false | true | 0 | 10 | 23 | 62 | 30 | 32 | null | null |
frontrowed/stratosphere | library-gen/Stratosphere/ResourceProperties/ApiGatewayMethodMethodResponse.hs | mit | -- | http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apitgateway-method-methodresponse.html#cfn-apigateway-method-methodresponse-statuscode
agmmrStatusCode :: Lens' ApiGatewayMethodMethodResponse (Val Text)
agmmrStatusCode = lens _apiGatewayMethodMethodResponseStatusCode (\s a -> s { _apiGatewayMethodMethodResponseStatusCode = a }) | 362 | agmmrStatusCode :: Lens' ApiGatewayMethodMethodResponse (Val Text)
agmmrStatusCode = lens _apiGatewayMethodMethodResponseStatusCode (\s a -> s { _apiGatewayMethodMethodResponseStatusCode = a }) | 193 | agmmrStatusCode = lens _apiGatewayMethodMethodResponseStatusCode (\s a -> s { _apiGatewayMethodMethodResponseStatusCode = a }) | 126 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
energyflowanalysis/efa-2.1 | src/EFA/IO/Reference.hs | bsd-3-clause | writeTest :: DirPath Abs -> DirPath Rel -> Ref.Test -> IO()
writeTest root group (Ref.Test p m) = do
let path = root +++ group +++ p
createDir (nc " writeTest") path
mapM_ (\ (name,x) -> writeRef (path +++ name) x) $ Map.toList m | 236 | writeTest :: DirPath Abs -> DirPath Rel -> Ref.Test -> IO()
writeTest root group (Ref.Test p m) = do
let path = root +++ group +++ p
createDir (nc " writeTest") path
mapM_ (\ (name,x) -> writeRef (path +++ name) x) $ Map.toList m | 236 | writeTest root group (Ref.Test p m) = do
let path = root +++ group +++ p
createDir (nc " writeTest") path
mapM_ (\ (name,x) -> writeRef (path +++ name) x) $ Map.toList m | 176 | false | true | 0 | 14 | 50 | 131 | 61 | 70 | null | null |
fhaust/kdtree | src/Data/KDTree/Internal/LinSearch.hs | mit | elect :: (KD.KDCompare b, V.Vector v b)
=> KD.Dim b -> Ordering -> b -> v b -> v b
select dim ord q = fst . partition dim ord q
| 135 | select :: (KD.KDCompare b, V.Vector v b)
=> KD.Dim b -> Ordering -> b -> v b -> v b
select dim ord q = fst . partition dim ord q | 135 | select dim ord q = fst . partition dim ord q | 44 | false | true | 0 | 10 | 38 | 77 | 37 | 40 | null | null |
amulcahy/LambdaMC | src/LambdaMC.hs | mit | onBtnClk1 :: JNIEnv
-> JObject
-> JObject
-> IO ()
onBtnClk1 env activity view = runJNI env $ do
logd "onBtnClick1"
activity' <- newGlobalRef activity
updateText activity' "onBtnClick1" -- crashes if this is not executed
setCancel activity' False
pd <- showPrgDlg activity "LambdaMC Dialog" "LambdaMC Dialog Message" activity
pd' <- newGlobalRef pd
-- callVoidMethod pd (jmethodid progressDialogClass "setOnCancelListener" "(Landroid/content/DialogInterface$OnCancelListener;)V") [jv activity']
-- callVoidMethod pd (jmethodid progressDialogClass "show" "()V") []
rate <- doubleFromEditText activity "editTextRate"
volatility <- doubleFromEditText activity "editTextVolatility"
optionParams' <- getOptionParams activity
mcSim' <- getMCSim activity
let resultStr' = pack (prettyPrint $ evalMonteCarlo optionParams' rate volatility mcSim')
resultStr = "onBtnClk1\n" `append` pack (show optionParams') `append` "\n" `append` pack (show mcSim') `append` "\n" `append` resultStr'
mst <- liftIO newEmptyMVar
tId <- liftIO $ forkWorker' resultStr mst
forkJNI $ watcher activity' (dismissAndDeletePrgDlg pd') False True tId mst
logd "onBtnClick1-2"
return () | 1,224 | onBtnClk1 :: JNIEnv
-> JObject
-> JObject
-> IO ()
onBtnClk1 env activity view = runJNI env $ do
logd "onBtnClick1"
activity' <- newGlobalRef activity
updateText activity' "onBtnClick1" -- crashes if this is not executed
setCancel activity' False
pd <- showPrgDlg activity "LambdaMC Dialog" "LambdaMC Dialog Message" activity
pd' <- newGlobalRef pd
-- callVoidMethod pd (jmethodid progressDialogClass "setOnCancelListener" "(Landroid/content/DialogInterface$OnCancelListener;)V") [jv activity']
-- callVoidMethod pd (jmethodid progressDialogClass "show" "()V") []
rate <- doubleFromEditText activity "editTextRate"
volatility <- doubleFromEditText activity "editTextVolatility"
optionParams' <- getOptionParams activity
mcSim' <- getMCSim activity
let resultStr' = pack (prettyPrint $ evalMonteCarlo optionParams' rate volatility mcSim')
resultStr = "onBtnClk1\n" `append` pack (show optionParams') `append` "\n" `append` pack (show mcSim') `append` "\n" `append` resultStr'
mst <- liftIO newEmptyMVar
tId <- liftIO $ forkWorker' resultStr mst
forkJNI $ watcher activity' (dismissAndDeletePrgDlg pd') False True tId mst
logd "onBtnClick1-2"
return () | 1,224 | onBtnClk1 env activity view = runJNI env $ do
logd "onBtnClick1"
activity' <- newGlobalRef activity
updateText activity' "onBtnClick1" -- crashes if this is not executed
setCancel activity' False
pd <- showPrgDlg activity "LambdaMC Dialog" "LambdaMC Dialog Message" activity
pd' <- newGlobalRef pd
-- callVoidMethod pd (jmethodid progressDialogClass "setOnCancelListener" "(Landroid/content/DialogInterface$OnCancelListener;)V") [jv activity']
-- callVoidMethod pd (jmethodid progressDialogClass "show" "()V") []
rate <- doubleFromEditText activity "editTextRate"
volatility <- doubleFromEditText activity "editTextVolatility"
optionParams' <- getOptionParams activity
mcSim' <- getMCSim activity
let resultStr' = pack (prettyPrint $ evalMonteCarlo optionParams' rate volatility mcSim')
resultStr = "onBtnClk1\n" `append` pack (show optionParams') `append` "\n" `append` pack (show mcSim') `append` "\n" `append` resultStr'
mst <- liftIO newEmptyMVar
tId <- liftIO $ forkWorker' resultStr mst
forkJNI $ watcher activity' (dismissAndDeletePrgDlg pd') False True tId mst
logd "onBtnClick1-2"
return () | 1,143 | false | true | 0 | 19 | 213 | 299 | 137 | 162 | null | null |
dylanmc/cryptol | src/Cryptol/Eval/Value.hs | bsd-3-clause | integerToChar :: Integer -> Char
integerToChar = toEnum . fromInteger | 69 | integerToChar :: Integer -> Char
integerToChar = toEnum . fromInteger | 69 | integerToChar = toEnum . fromInteger | 36 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
GaloisInc/halvm-ghc | compiler/utils/Util.hs | bsd-3-clause | mapAndUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])
mapAndUnzip _ [] = ([], []) | 78 | mapAndUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])
mapAndUnzip _ [] = ([], []) | 77 | mapAndUnzip _ [] = ([], []) | 27 | false | true | 0 | 8 | 17 | 64 | 37 | 27 | null | null |
meiersi/blaze-binary | src/Codec/MsgPack/Encoder.hs | bsd-3-clause | int64 :: Encoder Int64
int64 = OutStream . OInt64 | 49 | int64 :: Encoder Int64
int64 = OutStream . OInt64 | 49 | int64 = OutStream . OInt64 | 26 | false | true | 1 | 6 | 8 | 25 | 10 | 15 | null | null |
byteally/webapi | webapi-reflex-dom/src/Reflex/Dom/Contrib/MonadRouted.hs | bsd-3-clause | --makeLenses ''LocationInfo
------------------------------------------------------------------------------
-- | Constructs an app's top-level LocationInfo from URL text.
mkLocationInfo
:: T.Text
-- ^ The path initial segments not used for dynamic routing
-> URIRef Absolute
-- ^ Full Url of target to route to
-> LocationInfo
mkLocationInfo ctx r = LocationInfo r routeSegs (uriQueryText r) ctxSegs ctx
where
ctxSegs = contextPathParts ctx
-- TODO: What should happen if the route fails to prefix-match the
-- static path segment? Throw at error? Here we just return [] for
-- dynamic segments
routeSegs = fromMaybe [] .
L.stripPrefix (contextPathParts ctx) $
uriPathParts r
uriQueryText = fmap (\(a, b) -> (decodeUtf8 a, decodeUtf8 b)) . queryPairs . uriQuery
-------------------------------------------------------------------------------
-- Enter a route by one segment; one routing segment is popped and moved
-- to the dynamic context | 1,018 | mkLocationInfo
:: T.Text
-- ^ The path initial segments not used for dynamic routing
-> URIRef Absolute
-- ^ Full Url of target to route to
-> LocationInfo
mkLocationInfo ctx r = LocationInfo r routeSegs (uriQueryText r) ctxSegs ctx
where
ctxSegs = contextPathParts ctx
-- TODO: What should happen if the route fails to prefix-match the
-- static path segment? Throw at error? Here we just return [] for
-- dynamic segments
routeSegs = fromMaybe [] .
L.stripPrefix (contextPathParts ctx) $
uriPathParts r
uriQueryText = fmap (\(a, b) -> (decodeUtf8 a, decodeUtf8 b)) . queryPairs . uriQuery
-------------------------------------------------------------------------------
-- Enter a route by one segment; one routing segment is popped and moved
-- to the dynamic context | 846 | mkLocationInfo ctx r = LocationInfo r routeSegs (uriQueryText r) ctxSegs ctx
where
ctxSegs = contextPathParts ctx
-- TODO: What should happen if the route fails to prefix-match the
-- static path segment? Throw at error? Here we just return [] for
-- dynamic segments
routeSegs = fromMaybe [] .
L.stripPrefix (contextPathParts ctx) $
uriPathParts r
uriQueryText = fmap (\(a, b) -> (decodeUtf8 a, decodeUtf8 b)) . queryPairs . uriQuery
-------------------------------------------------------------------------------
-- Enter a route by one segment; one routing segment is popped and moved
-- to the dynamic context | 674 | true | true | 4 | 10 | 208 | 160 | 77 | 83 | null | null |
Minoru/split-bill-hs | src/SplitBill.hs | bsd-3-clause | withBuffering :: IO a -> IO a
withBuffering = withBufferMode LineBuffering | 74 | withBuffering :: IO a -> IO a
withBuffering = withBufferMode LineBuffering | 74 | withBuffering = withBufferMode LineBuffering | 44 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
rueshyna/gogol | gogol-storage/gen/Network/Google/Resource/Storage/Buckets/Update.hs | mpl-2.0 | -- | Apply a predefined set of default object access controls to this bucket.
buPredefinedDefaultObjectACL :: Lens' BucketsUpdate (Maybe BucketsUpdatePredefinedDefaultObjectACL)
buPredefinedDefaultObjectACL
= lens _buPredefinedDefaultObjectACL
(\ s a -> s{_buPredefinedDefaultObjectACL = a}) | 299 | buPredefinedDefaultObjectACL :: Lens' BucketsUpdate (Maybe BucketsUpdatePredefinedDefaultObjectACL)
buPredefinedDefaultObjectACL
= lens _buPredefinedDefaultObjectACL
(\ s a -> s{_buPredefinedDefaultObjectACL = a}) | 221 | buPredefinedDefaultObjectACL
= lens _buPredefinedDefaultObjectACL
(\ s a -> s{_buPredefinedDefaultObjectACL = a}) | 121 | true | true | 0 | 9 | 38 | 48 | 25 | 23 | null | null |
cchalmers/geometry | src/Geometry/Trail.hs | bsd-3-clause | -- | Create a linear trail between two given points.
--
-- <<diagrams/src_Geometry_Trail_twiddleEx.svg#diagram=twiddleEx&width=300>>
--
-- > twiddleEx
-- > = mconcat ((~~) <$> hexagon 1 <*> hexagon 1)
-- > # centerXY # pad 1.1
(~~) :: (InSpace v n t, Metric v, OrderedField n, FromTrail t) => Point v n -> Point v n -> t
a ~~ b = fromVertices [a,b] | 360 | (~~) :: (InSpace v n t, Metric v, OrderedField n, FromTrail t) => Point v n -> Point v n -> t
a ~~ b = fromVertices [a,b] | 121 | a ~~ b = fromVertices [a,b] | 27 | true | true | 0 | 10 | 74 | 85 | 46 | 39 | null | null |
avsm/Idris | Idris/RunIO.hs | bsd-3-clause | exec :: Context -> Term -> IO ()
exec ctxt wurzel = do res <- runIO ctxt (view (whnf ctxt wurzel))
putStrLn $ show res | 140 | exec :: Context -> Term -> IO ()
exec ctxt wurzel = do res <- runIO ctxt (view (whnf ctxt wurzel))
putStrLn $ show res | 140 | exec ctxt wurzel = do res <- runIO ctxt (view (whnf ctxt wurzel))
putStrLn $ show res | 107 | false | true | 0 | 12 | 46 | 65 | 30 | 35 | null | null |
Tehnix/HsCMS | Handler/Articles.hs | bsd-2-clause | getArchivesR :: Handler Html
getArchivesR = do
allContent <- pullArticles
defaultLayout $ do
setTitle "Archives"
$(widgetFile "front/archives")
-- | Display all articles from a specific author | 217 | getArchivesR :: Handler Html
getArchivesR = do
allContent <- pullArticles
defaultLayout $ do
setTitle "Archives"
$(widgetFile "front/archives")
-- | Display all articles from a specific author | 217 | getArchivesR = do
allContent <- pullArticles
defaultLayout $ do
setTitle "Archives"
$(widgetFile "front/archives")
-- | Display all articles from a specific author | 188 | false | true | 0 | 12 | 50 | 45 | 20 | 25 | null | null |
ZjMNZHgG5jMXw/smallcaps | src/smallcaps/Text/SmallCaps/TeXParser.hs | bsd-3-clause | -- ** Macro
macro :: Parser TeXElement
macro = fmap Macro $ do
b <- macroBegin
n <- macroName
return (cons b n) | 118 | macro :: Parser TeXElement
macro = fmap Macro $ do
b <- macroBegin
n <- macroName
return (cons b n) | 105 | macro = fmap Macro $ do
b <- macroBegin
n <- macroName
return (cons b n) | 78 | true | true | 1 | 11 | 29 | 54 | 23 | 31 | null | null |
sdiehl/ghc | libraries/base/Data/OldList.hs | bsd-3-clause | -- See Note [INLINE unfoldr]
unfoldr f b0 = build (\c n ->
let go b = case f b of
Just (a, new_b) -> a `c` go new_b
Nothing -> n
in go b0) | 180 | unfoldr f b0 = build (\c n ->
let go b = case f b of
Just (a, new_b) -> a `c` go new_b
Nothing -> n
in go b0) | 151 | unfoldr f b0 = build (\c n ->
let go b = case f b of
Just (a, new_b) -> a `c` go new_b
Nothing -> n
in go b0) | 151 | true | false | 0 | 16 | 76 | 79 | 39 | 40 | null | null |
AccelerateHS/accelerate-cuda | Data/Array/Accelerate/CUDA/CodeGen/Arithmetic.hs | bsd-3-clause | shiftL :: Exp -> Exp -> Exp
shiftL x i = [cexp| $exp:x << $exp:i |] | 67 | shiftL :: Exp -> Exp -> Exp
shiftL x i = [cexp| $exp:x << $exp:i |] | 67 | shiftL x i = [cexp| $exp:x << $exp:i |] | 39 | false | true | 0 | 8 | 15 | 34 | 17 | 17 | null | null |
mfine/ghc | compiler/main/DriverPhases.hs | bsd-3-clause | startPhase "lhsig" = Unlit HsigFile | 38 | startPhase "lhsig" = Unlit HsigFile | 38 | startPhase "lhsig" = Unlit HsigFile | 38 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Attrs/Globals.hs | bsd-3-clause | rImg = attrSetRole (RoleA Rimg) | 44 | rImg = attrSetRole (RoleA Rimg) | 44 | rImg = attrSetRole (RoleA Rimg) | 44 | false | false | 0 | 7 | 17 | 15 | 7 | 8 | null | null |
spechub/Hets | Persistence/Reasoning/PremiseSelectionSInE.hs | gpl-2.0 | saveToDatabase :: MonadIO m
=> HetcatsOpts
-> G_SInEResult
-> Entity LocIdBase
-> SinePremiseSelectionId
-> DBMonad m ()
saveToDatabase opts G_SInEResult{..} omsEntity sinePremiseSelectionKey = do
saveSymbolPremiseTriggers
saveSymbolCommonnesses
return ()
where
saveSymbolPremiseTriggers =
mapM_ (\ (symbol, triggers) -> do
symbolKey <- fetchSymbolId symbol
mapM_ (\ (minimalTolerance, namedSentence) -> do
premiseKey <- fetchSentenceId namedSentence
insert SineSymbolPremiseTrigger
{ sineSymbolPremiseTriggerSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolPremiseTriggerPremiseId = premiseKey
, sineSymbolPremiseTriggerSymbolId = symbolKey
, sineSymbolPremiseTriggerMinTolerance = minimalTolerance
}
) triggers
) $ Map.toList premiseTriggers
saveSymbolCommonnesses =
mapM_ (\ (symbol, commonness) -> do
symbolKey <- fetchSymbolId symbol
insert SineSymbolCommonness
{ sineSymbolCommonnessSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolCommonnessSymbolId = symbolKey
, sineSymbolCommonnessCommonness = commonness
}
) $ Map.toList symbolCommonnesses
fetchSymbolId symbol =
let (locId, _, _, _) = symbolDetails omsEntity gSineLogic symbol
in fetchLocId locId "Symbol"
fetchSentenceId namedSentence =
let name = senAttr namedSentence
locId = locIdOfSentence omsEntity name
in fetchLocId locId "Sentence"
fetchLocId locId kind = do
sentenceL <- select $ from $ \ loc_id_bases -> do
where_ (loc_id_bases ^. LocIdBaseLocId ==. val locId)
limit 1
return loc_id_bases
case sentenceL of
[] -> fail ("Persistence.Reasoning.saveToDatabase: Could not find " ++ kind ++ " " ++ locId)
Entity key _ : _ -> return key | 2,162 | saveToDatabase :: MonadIO m
=> HetcatsOpts
-> G_SInEResult
-> Entity LocIdBase
-> SinePremiseSelectionId
-> DBMonad m ()
saveToDatabase opts G_SInEResult{..} omsEntity sinePremiseSelectionKey = do
saveSymbolPremiseTriggers
saveSymbolCommonnesses
return ()
where
saveSymbolPremiseTriggers =
mapM_ (\ (symbol, triggers) -> do
symbolKey <- fetchSymbolId symbol
mapM_ (\ (minimalTolerance, namedSentence) -> do
premiseKey <- fetchSentenceId namedSentence
insert SineSymbolPremiseTrigger
{ sineSymbolPremiseTriggerSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolPremiseTriggerPremiseId = premiseKey
, sineSymbolPremiseTriggerSymbolId = symbolKey
, sineSymbolPremiseTriggerMinTolerance = minimalTolerance
}
) triggers
) $ Map.toList premiseTriggers
saveSymbolCommonnesses =
mapM_ (\ (symbol, commonness) -> do
symbolKey <- fetchSymbolId symbol
insert SineSymbolCommonness
{ sineSymbolCommonnessSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolCommonnessSymbolId = symbolKey
, sineSymbolCommonnessCommonness = commonness
}
) $ Map.toList symbolCommonnesses
fetchSymbolId symbol =
let (locId, _, _, _) = symbolDetails omsEntity gSineLogic symbol
in fetchLocId locId "Symbol"
fetchSentenceId namedSentence =
let name = senAttr namedSentence
locId = locIdOfSentence omsEntity name
in fetchLocId locId "Sentence"
fetchLocId locId kind = do
sentenceL <- select $ from $ \ loc_id_bases -> do
where_ (loc_id_bases ^. LocIdBaseLocId ==. val locId)
limit 1
return loc_id_bases
case sentenceL of
[] -> fail ("Persistence.Reasoning.saveToDatabase: Could not find " ++ kind ++ " " ++ locId)
Entity key _ : _ -> return key | 2,162 | saveToDatabase opts G_SInEResult{..} omsEntity sinePremiseSelectionKey = do
saveSymbolPremiseTriggers
saveSymbolCommonnesses
return ()
where
saveSymbolPremiseTriggers =
mapM_ (\ (symbol, triggers) -> do
symbolKey <- fetchSymbolId symbol
mapM_ (\ (minimalTolerance, namedSentence) -> do
premiseKey <- fetchSentenceId namedSentence
insert SineSymbolPremiseTrigger
{ sineSymbolPremiseTriggerSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolPremiseTriggerPremiseId = premiseKey
, sineSymbolPremiseTriggerSymbolId = symbolKey
, sineSymbolPremiseTriggerMinTolerance = minimalTolerance
}
) triggers
) $ Map.toList premiseTriggers
saveSymbolCommonnesses =
mapM_ (\ (symbol, commonness) -> do
symbolKey <- fetchSymbolId symbol
insert SineSymbolCommonness
{ sineSymbolCommonnessSinePremiseSelectionId = sinePremiseSelectionKey
, sineSymbolCommonnessSymbolId = symbolKey
, sineSymbolCommonnessCommonness = commonness
}
) $ Map.toList symbolCommonnesses
fetchSymbolId symbol =
let (locId, _, _, _) = symbolDetails omsEntity gSineLogic symbol
in fetchLocId locId "Symbol"
fetchSentenceId namedSentence =
let name = senAttr namedSentence
locId = locIdOfSentence omsEntity name
in fetchLocId locId "Sentence"
fetchLocId locId kind = do
sentenceL <- select $ from $ \ loc_id_bases -> do
where_ (loc_id_bases ^. LocIdBaseLocId ==. val locId)
limit 1
return loc_id_bases
case sentenceL of
[] -> fail ("Persistence.Reasoning.saveToDatabase: Could not find " ++ kind ++ " " ++ locId)
Entity key _ : _ -> return key | 1,966 | false | true | 0 | 18 | 727 | 442 | 217 | 225 | null | null |
rjwright/js-typeomatic | ResolveSourceFragments.hs | apache-2.0 | sastMakeSourceFragment (AWSS (Statement expr) srcSpan) fileName nextSpan =
AWSF
(WSStatement (exprMakeSourceFragment expr fileName nextSpan))
(makeSourceFragment srcSpan nextSpan fileName)
| 209 | jsastMakeSourceFragment (AWSS (Statement expr) srcSpan) fileName nextSpan =
AWSF
(WSStatement (exprMakeSourceFragment expr fileName nextSpan))
(makeSourceFragment srcSpan nextSpan fileName) | 209 | jsastMakeSourceFragment (AWSS (Statement expr) srcSpan) fileName nextSpan =
AWSF
(WSStatement (exprMakeSourceFragment expr fileName nextSpan))
(makeSourceFragment srcSpan nextSpan fileName) | 209 | false | false | 0 | 9 | 38 | 59 | 28 | 31 | null | null |
mudphone/HaskellBook | src/Nine.hs | mit | myMinimumBy :: (a -> a -> Ordering) -> [a] -> a
myMinimumBy compFun (x:xs) = foldl cc x xs
where cc x y = if compFun y x == LT then y else x | 142 | myMinimumBy :: (a -> a -> Ordering) -> [a] -> a
myMinimumBy compFun (x:xs) = foldl cc x xs
where cc x y = if compFun y x == LT then y else x | 142 | myMinimumBy compFun (x:xs) = foldl cc x xs
where cc x y = if compFun y x == LT then y else x | 94 | false | true | 0 | 8 | 35 | 81 | 42 | 39 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp MkApUpd0_Op = _ILIT(391) | 37 | tagOf_PrimOp MkApUpd0_Op = _ILIT(391) | 37 | tagOf_PrimOp MkApUpd0_Op = _ILIT(391) | 37 | false | false | 0 | 6 | 3 | 16 | 7 | 9 | null | null |
mietek/stack | src/Stack/Package.hs | bsd-3-clause | -- | Generic a @ResolveConditions@ using sensible defaults.
mkResolveConditions :: Version -- ^ GHC version
-> Platform -- ^ installation target platform
-> Map FlagName Bool -- ^ enabled flags
-> ResolveConditions
mkResolveConditions ghcVersion (Platform arch os) flags = ResolveConditions
{ rcFlags = flags
, rcGhcVersion = ghcVersion
, rcOS = os
, rcArch = arch
} | 446 | mkResolveConditions :: Version -- ^ GHC version
-> Platform -- ^ installation target platform
-> Map FlagName Bool -- ^ enabled flags
-> ResolveConditions
mkResolveConditions ghcVersion (Platform arch os) flags = ResolveConditions
{ rcFlags = flags
, rcGhcVersion = ghcVersion
, rcOS = os
, rcArch = arch
} | 386 | mkResolveConditions ghcVersion (Platform arch os) flags = ResolveConditions
{ rcFlags = flags
, rcGhcVersion = ghcVersion
, rcOS = os
, rcArch = arch
} | 171 | true | true | 0 | 11 | 136 | 82 | 44 | 38 | null | null |
judah/tensorflow-haskell | tensorflow-ops/src/TensorFlow/Gradient.hs | apache-2.0 | opGrad "Variable" _ _ _ = [] | 28 | opGrad "Variable" _ _ _ = [] | 28 | opGrad "Variable" _ _ _ = [] | 28 | false | false | 0 | 5 | 6 | 17 | 8 | 9 | null | null |
traeger/fol-solver | Folsolver/Data/BinTree.hs | gpl-3.0 | leaf :: v -> BinTree v
leaf v = empty <# v #> empty | 51 | leaf :: v -> BinTree v
leaf v = empty <# v #> empty | 51 | leaf v = empty <# v #> empty | 28 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
erikd/hs-tls | core/Network/TLS/Util.hs | bsd-3-clause | -- | This is a strict version of and
and' :: [Bool] -> Bool
and' l = foldl' (&&!) True l | 88 | and' :: [Bool] -> Bool
and' l = foldl' (&&!) True l | 51 | and' l = foldl' (&&!) True l | 28 | true | true | 0 | 6 | 20 | 31 | 17 | 14 | null | null |
ehird/reflection | slow/Data/Reflection.hs | bsd-3-clause | byte4 :: p (Stable b0 b1 b2 b3 b4 b5 b6 b7 a) -> Proxy b4
byte4 _ = Proxy | 73 | byte4 :: p (Stable b0 b1 b2 b3 b4 b5 b6 b7 a) -> Proxy b4
byte4 _ = Proxy | 73 | byte4 _ = Proxy | 15 | false | true | 0 | 9 | 19 | 51 | 23 | 28 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.autocapitalize Mozilla HTMLElement.autocapitalize documentation>
setAutocapitalize ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setAutocapitalize self val
= liftDOM
((toHTMLElement self) ^. jss "autocapitalize" (toJSVal val)) | 369 | setAutocapitalize ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setAutocapitalize self val
= liftDOM
((toHTMLElement self) ^. jss "autocapitalize" (toJSVal val)) | 236 | setAutocapitalize self val
= liftDOM
((toHTMLElement self) ^. jss "autocapitalize" (toJSVal val)) | 105 | true | true | 0 | 10 | 79 | 83 | 40 | 43 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/InstanceGroupManagers/DeleteInstances.hs | mpl-2.0 | -- | Creates a value of 'InstanceGroupManagersDeleteInstances' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'igmdiRequestId'
--
-- * 'igmdiProject'
--
-- * 'igmdiInstanceGroupManager'
--
-- * 'igmdiZone'
--
-- * 'igmdiPayload'
instanceGroupManagersDeleteInstances
:: Text -- ^ 'igmdiProject'
-> Text -- ^ 'igmdiInstanceGroupManager'
-> Text -- ^ 'igmdiZone'
-> InstanceGroupManagersDeleteInstancesRequest -- ^ 'igmdiPayload'
-> InstanceGroupManagersDeleteInstances
instanceGroupManagersDeleteInstances pIgmdiProject_ pIgmdiInstanceGroupManager_ pIgmdiZone_ pIgmdiPayload_ =
InstanceGroupManagersDeleteInstances'
{ _igmdiRequestId = Nothing
, _igmdiProject = pIgmdiProject_
, _igmdiInstanceGroupManager = pIgmdiInstanceGroupManager_
, _igmdiZone = pIgmdiZone_
, _igmdiPayload = pIgmdiPayload_
} | 927 | instanceGroupManagersDeleteInstances
:: Text -- ^ 'igmdiProject'
-> Text -- ^ 'igmdiInstanceGroupManager'
-> Text -- ^ 'igmdiZone'
-> InstanceGroupManagersDeleteInstancesRequest -- ^ 'igmdiPayload'
-> InstanceGroupManagersDeleteInstances
instanceGroupManagersDeleteInstances pIgmdiProject_ pIgmdiInstanceGroupManager_ pIgmdiZone_ pIgmdiPayload_ =
InstanceGroupManagersDeleteInstances'
{ _igmdiRequestId = Nothing
, _igmdiProject = pIgmdiProject_
, _igmdiInstanceGroupManager = pIgmdiInstanceGroupManager_
, _igmdiZone = pIgmdiZone_
, _igmdiPayload = pIgmdiPayload_
} | 612 | instanceGroupManagersDeleteInstances pIgmdiProject_ pIgmdiInstanceGroupManager_ pIgmdiZone_ pIgmdiPayload_ =
InstanceGroupManagersDeleteInstances'
{ _igmdiRequestId = Nothing
, _igmdiProject = pIgmdiProject_
, _igmdiInstanceGroupManager = pIgmdiInstanceGroupManager_
, _igmdiZone = pIgmdiZone_
, _igmdiPayload = pIgmdiPayload_
} | 354 | true | true | 0 | 8 | 146 | 85 | 56 | 29 | null | null |
Fuuzetsu/lens | src/Control/Lens/Indexed.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- Indexed Folds with Reified Monoid
-------------------------------------------------------------------------------
ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r
ifoldMapBy f z g = reifyFold f z (ifoldMap (\i a -> M (g i a))) | 348 | ifoldMapBy :: FoldableWithIndex i t => (r -> r -> r) -> r -> (i -> a -> r) -> t a -> r
ifoldMapBy f z g = reifyFold f z (ifoldMap (\i a -> M (g i a))) | 150 | ifoldMapBy f z g = reifyFold f z (ifoldMap (\i a -> M (g i a))) | 63 | true | true | 0 | 12 | 48 | 105 | 54 | 51 | null | null |
ajnsit/vyom | src/Vyom/Data/Pretty.hs | mit | -- UTILITY
-- Basic ops for Pretty
sopString :: String -> Pretty h a
sopString = Pretty . const | 95 | sopString :: String -> Pretty h a
sopString = Pretty . const | 60 | sopString = Pretty . const | 26 | true | true | 0 | 6 | 18 | 26 | 14 | 12 | null | null |
AlbinTheander/oden | src/Oden/Backend/Go.hs | mit | -- | Generates a call to an foreign function.
genRawForeignFnApplication :: Expr Mono.Type -> [Expr Mono.Type] -> Codegen AST.PrimaryExpression
genRawForeignFnApplication f args =
case typeOf f of
Mono.TForeignFn _ True _ _ -> do
let nonVariadicArgs = init args
slice = last args
fc <- genPrimaryExpression f
args' <- map AST.Argument <$> mapM genExpr nonVariadicArgs
variadicArg <- AST.VariadicSliceArgument <$> genExpr slice
return (AST.Application fc (args' ++ [variadicArg]))
_ -> AST.Application <$> genPrimaryExpression f
<*> (map AST.Argument <$> mapM genExpr args) | 647 | genRawForeignFnApplication :: Expr Mono.Type -> [Expr Mono.Type] -> Codegen AST.PrimaryExpression
genRawForeignFnApplication f args =
case typeOf f of
Mono.TForeignFn _ True _ _ -> do
let nonVariadicArgs = init args
slice = last args
fc <- genPrimaryExpression f
args' <- map AST.Argument <$> mapM genExpr nonVariadicArgs
variadicArg <- AST.VariadicSliceArgument <$> genExpr slice
return (AST.Application fc (args' ++ [variadicArg]))
_ -> AST.Application <$> genPrimaryExpression f
<*> (map AST.Argument <$> mapM genExpr args) | 601 | genRawForeignFnApplication f args =
case typeOf f of
Mono.TForeignFn _ True _ _ -> do
let nonVariadicArgs = init args
slice = last args
fc <- genPrimaryExpression f
args' <- map AST.Argument <$> mapM genExpr nonVariadicArgs
variadicArg <- AST.VariadicSliceArgument <$> genExpr slice
return (AST.Application fc (args' ++ [variadicArg]))
_ -> AST.Application <$> genPrimaryExpression f
<*> (map AST.Argument <$> mapM genExpr args) | 503 | true | true | 0 | 15 | 154 | 196 | 91 | 105 | null | null |
tulcod/megaparsec | tests/Prim.hs | bsd-2-clause | prop_label :: NonNegative Int -> NonNegative Int -> NonNegative Int ->
String -> Property
prop_label a' b' c' l = checkParser p r s
where [a,b,c] = getNonNegative <$> [a',b',c']
p = (++) <$> many (char 'a') <*> (many (char 'b') <?> l)
r | null s = Right s
| c > 0 = posErr (a + b) s $ [uneCh 'c', exSpec l, exEof]
++ [exCh 'a' | b == 0]
| otherwise = Right s
s = abcRow a b c | 455 | prop_label :: NonNegative Int -> NonNegative Int -> NonNegative Int ->
String -> Property
prop_label a' b' c' l = checkParser p r s
where [a,b,c] = getNonNegative <$> [a',b',c']
p = (++) <$> many (char 'a') <*> (many (char 'b') <?> l)
r | null s = Right s
| c > 0 = posErr (a + b) s $ [uneCh 'c', exSpec l, exEof]
++ [exCh 'a' | b == 0]
| otherwise = Right s
s = abcRow a b c | 455 | prop_label a' b' c' l = checkParser p r s
where [a,b,c] = getNonNegative <$> [a',b',c']
p = (++) <$> many (char 'a') <*> (many (char 'b') <?> l)
r | null s = Right s
| c > 0 = posErr (a + b) s $ [uneCh 'c', exSpec l, exEof]
++ [exCh 'a' | b == 0]
| otherwise = Right s
s = abcRow a b c | 351 | false | true | 6 | 10 | 163 | 250 | 116 | 134 | null | null |
pjones/xmonad-test | vendor/xmonad/src/XMonad/Core.hs | bsd-2-clause | runQuery :: Query a -> Window -> X a
runQuery (Query m) w = runReaderT m w | 74 | runQuery :: Query a -> Window -> X a
runQuery (Query m) w = runReaderT m w | 74 | runQuery (Query m) w = runReaderT m w | 37 | false | true | 0 | 7 | 16 | 41 | 19 | 22 | null | null |
robstewart57/hdph-rs | src/Control/Parallel/HdpH/Internal/Sparkpool.hs | bsd-3-clause | ----------
-- part of base library in GHC 7.6
-- | Variant of 'writeIORef' with the \"barrier to reordering\" property that
-- 'atomicModifyIORef' has.
atomicWriteIORef :: IORef a -> a -> IO ()
atomicWriteIORef ref a = do
x <- atomicModifyIORef ref (const (a, ()))
x `seq` return () | 291 | atomicWriteIORef :: IORef a -> a -> IO ()
atomicWriteIORef ref a = do
x <- atomicModifyIORef ref (const (a, ()))
x `seq` return () | 138 | atomicWriteIORef ref a = do
x <- atomicModifyIORef ref (const (a, ()))
x `seq` return () | 96 | true | true | 0 | 12 | 57 | 76 | 39 | 37 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/succ_2.hs | mit | primModNatS0 x y MyFalse = Succ x | 33 | primModNatS0 x y MyFalse = Succ x | 33 | primModNatS0 x y MyFalse = Succ x | 33 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
geraldus/yesod | yesod-form-multi/Yesod/Form/MultiInput.hs | mit | amulti :: (site ~ HandlerSite m, MonadHandler m, RenderMessage site FormMessage)
=> Field m a
-> FieldSettings site
-> [a]
-> Int
-> MultiSettings site
-> AForm m [a]
amulti field fs defs minVals ms = formToAForm $
liftM (second return) mform
where
mform = do
(fr, MultiView {..}) <- mmulti field fs defs minVals ms
let (fv : _) = mvFields
widget = do
[whamlet|
$maybe tooltip <- fvTooltip fv
<small .#{msTooltipClass ms}>#{tooltip}
^{fvInput mvCounter}
$forall fv <- mvFields
^{fvInput fv}
^{fvInput mvAddBtn}
|]
view = FieldView
{ fvLabel = fvLabel fv
, fvTooltip = Nothing
, fvId = fvId fv
, fvInput = widget
, fvErrors = fvErrors mvAddBtn
, fvRequired = False
}
return (fr, view)
-- | Converts a form field into a monadic form containing an arbitrary
-- number of the given fields as specified by the user. Returns a list
-- of results, failing if the length of the list is less than the minimum
-- requested values.
--
-- @since 1.6.0 | 1,397 | amulti :: (site ~ HandlerSite m, MonadHandler m, RenderMessage site FormMessage)
=> Field m a
-> FieldSettings site
-> [a]
-> Int
-> MultiSettings site
-> AForm m [a]
amulti field fs defs minVals ms = formToAForm $
liftM (second return) mform
where
mform = do
(fr, MultiView {..}) <- mmulti field fs defs minVals ms
let (fv : _) = mvFields
widget = do
[whamlet|
$maybe tooltip <- fvTooltip fv
<small .#{msTooltipClass ms}>#{tooltip}
^{fvInput mvCounter}
$forall fv <- mvFields
^{fvInput fv}
^{fvInput mvAddBtn}
|]
view = FieldView
{ fvLabel = fvLabel fv
, fvTooltip = Nothing
, fvId = fvId fv
, fvInput = widget
, fvErrors = fvErrors mvAddBtn
, fvRequired = False
}
return (fr, view)
-- | Converts a form field into a monadic form containing an arbitrary
-- number of the given fields as specified by the user. Returns a list
-- of results, failing if the length of the list is less than the minimum
-- requested values.
--
-- @since 1.6.0 | 1,397 | amulti field fs defs minVals ms = formToAForm $
liftM (second return) mform
where
mform = do
(fr, MultiView {..}) <- mmulti field fs defs minVals ms
let (fv : _) = mvFields
widget = do
[whamlet|
$maybe tooltip <- fvTooltip fv
<small .#{msTooltipClass ms}>#{tooltip}
^{fvInput mvCounter}
$forall fv <- mvFields
^{fvInput fv}
^{fvInput mvAddBtn}
|]
view = FieldView
{ fvLabel = fvLabel fv
, fvTooltip = Nothing
, fvId = fvId fv
, fvInput = widget
, fvErrors = fvErrors mvAddBtn
, fvRequired = False
}
return (fr, view)
-- | Converts a form field into a monadic form containing an arbitrary
-- number of the given fields as specified by the user. Returns a list
-- of results, failing if the length of the list is less than the minimum
-- requested values.
--
-- @since 1.6.0 | 1,206 | false | true | 0 | 14 | 625 | 243 | 130 | 113 | null | null |
jasonzoladz/persistent | persistent-sqlite/Database/Sqlite.hs | mit | decodeError 2 = ErrorInternal | 29 | decodeError 2 = ErrorInternal | 29 | decodeError 2 = ErrorInternal | 29 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
arekfu/project_euler | p0054/p0054.hs | mit | toValue '5' = Val5 | 18 | toValue '5' = Val5 | 18 | toValue '5' = Val5 | 18 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
uduki/hsQt | Qtc/Gui/QColor.hs | bsd-2-clause | setBlue :: QColor a -> ((Int)) -> IO ()
setBlue x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QColor_setBlue cobj_x0 (toCInt x1) | 133 | setBlue :: QColor a -> ((Int)) -> IO ()
setBlue x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QColor_setBlue cobj_x0 (toCInt x1) | 133 | setBlue x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QColor_setBlue cobj_x0 (toCInt x1) | 93 | false | true | 0 | 9 | 27 | 64 | 32 | 32 | null | null |
andreagenso/java2scala | src/J2s/Ast/Syntax.hs | apache-2.0 | sem_ActualTypeArgumentList_Nil = [] | 36 | sem_ActualTypeArgumentList_Nil = [] | 36 | sem_ActualTypeArgumentList_Nil = [] | 36 | false | false | 0 | 5 | 3 | 8 | 4 | 4 | null | null |
olorin/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types/Product.hs | mpl-2.0 | -- | The status of the IP range, for example, \"authorized\".
irStatus :: Lens' IPRange (Maybe Text)
irStatus = lens _irStatus (\ s a -> s{_irStatus = a}) | 154 | irStatus :: Lens' IPRange (Maybe Text)
irStatus = lens _irStatus (\ s a -> s{_irStatus = a}) | 92 | irStatus = lens _irStatus (\ s a -> s{_irStatus = a}) | 53 | true | true | 0 | 9 | 27 | 46 | 25 | 21 | null | null |
danieldietrich/llrbtree | Data/Set/WBTree.hs | bsd-3-clause | singleR :: WBTree a -> a -> WBTree a -> WBTree a
singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 105 | singleR :: WBTree a -> a -> WBTree a -> WBTree a
singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 105 | singleR (Node _ ll lx lr) x r = node ll lx (node lr x r) | 56 | false | true | 0 | 11 | 27 | 72 | 33 | 39 | null | null |
portnov/yaledger | YaLedger/Output/ASCII.hs | bsd-3-clause | midchar :: LineKind -> Char
midchar TopLine = '╤' | 52 | midchar :: LineKind -> Char
midchar TopLine = '╤' | 52 | midchar TopLine = '╤' | 24 | false | true | 0 | 7 | 11 | 24 | 10 | 14 | null | null |
HS-Carbon/hs-carbon-aggregator | 3rd-party/python-pickle/Language/Python/Pickle.hs | apache-2.0 | pickle :: Value -> S.ByteString
pickle value = runPut $ do
putByteString "\128\STX"
mapM_ serialize . runPickler $ pickle' value
putByteString "."
----------------------------------------------------------------------
-- Pickle opcodes parser
----------------------------------------------------------------------
-- TODO parsing could be done with a big switch and only cereal,
-- instead of relying on attoparsec's "choice" combinator. | 445 | pickle :: Value -> S.ByteString
pickle value = runPut $ do
putByteString "\128\STX"
mapM_ serialize . runPickler $ pickle' value
putByteString "."
----------------------------------------------------------------------
-- Pickle opcodes parser
----------------------------------------------------------------------
-- TODO parsing could be done with a big switch and only cereal,
-- instead of relying on attoparsec's "choice" combinator. | 445 | pickle value = runPut $ do
putByteString "\128\STX"
mapM_ serialize . runPickler $ pickle' value
putByteString "."
----------------------------------------------------------------------
-- Pickle opcodes parser
----------------------------------------------------------------------
-- TODO parsing could be done with a big switch and only cereal,
-- instead of relying on attoparsec's "choice" combinator. | 413 | false | true | 0 | 10 | 56 | 58 | 28 | 30 | null | null |
fmapfmapfmap/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/DescribeConfigurationOptions.hs | mpl-2.0 | -- | The response status code.
dcorsResponseStatus :: Lens' DescribeConfigurationOptionsResponse Int
dcorsResponseStatus = lens _dcorsResponseStatus (\ s a -> s{_dcorsResponseStatus = a}) | 187 | dcorsResponseStatus :: Lens' DescribeConfigurationOptionsResponse Int
dcorsResponseStatus = lens _dcorsResponseStatus (\ s a -> s{_dcorsResponseStatus = a}) | 156 | dcorsResponseStatus = lens _dcorsResponseStatus (\ s a -> s{_dcorsResponseStatus = a}) | 86 | true | true | 1 | 9 | 21 | 45 | 22 | 23 | null | null |
poxu/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | preamble :: LP Blocks
preamble = mempty <$> manyTill preambleBlock beginDoc
where beginDoc = lookAhead $ try $ controlSeq "begin" *> string "{document}"
preambleBlock = void comment
<|> void sp
<|> void blanklines
<|> void macro
<|> void blockCommand
<|> void anyControlSeq
<|> void braced
<|> void anyChar
-------
-- citations | 487 | preamble :: LP Blocks
preamble = mempty <$> manyTill preambleBlock beginDoc
where beginDoc = lookAhead $ try $ controlSeq "begin" *> string "{document}"
preambleBlock = void comment
<|> void sp
<|> void blanklines
<|> void macro
<|> void blockCommand
<|> void anyControlSeq
<|> void braced
<|> void anyChar
-------
-- citations | 487 | preamble = mempty <$> manyTill preambleBlock beginDoc
where beginDoc = lookAhead $ try $ controlSeq "begin" *> string "{document}"
preambleBlock = void comment
<|> void sp
<|> void blanklines
<|> void macro
<|> void blockCommand
<|> void anyControlSeq
<|> void braced
<|> void anyChar
-------
-- citations | 465 | false | true | 1 | 14 | 210 | 108 | 50 | 58 | null | null |
nfjinjing/bench-euler | src/Math/AdditiveNumberTheory.hs | bsd-3-clause | isCube n = n `elem` takeWhile (<= n) cubes | 42 | isCube n = n `elem` takeWhile (<= n) cubes | 42 | isCube n = n `elem` takeWhile (<= n) cubes | 42 | false | false | 0 | 7 | 8 | 24 | 13 | 11 | null | null |
CGenie/hREST-tester | src/Main.hs | gpl-2.0 | getMethod "DELETE" = Just DELETE | 32 | getMethod "DELETE" = Just DELETE | 32 | getMethod "DELETE" = Just DELETE | 32 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.