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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dr-Horv/Advent-of-code
|
day16/day16.hs
|
mit
|
has3trees :: SueInfo -> Bool
has3trees si = maybeHasX (==) 3 $ trees si
| 71
|
has3trees :: SueInfo -> Bool
has3trees si = maybeHasX (==) 3 $ trees si
| 71
|
has3trees si = maybeHasX (==) 3 $ trees si
| 42
| false
| true
| 0
| 6
| 13
| 32
| 16
| 16
| null | null |
nataren/youtrack
|
src/YouTrack.hs
|
apache-2.0
|
buildAuthOptions :: YouTrackAuth -> Options
buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)]
| 320
|
buildAuthOptions :: YouTrackAuth -> Options
buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)]
| 320
|
buildAuthOptions auth = defaults &
header "Accept" .~ ["application/json"] &
header "Cookie" .~ [C.append (C.pack "JSESSIONID=") (sessionId auth), C.append (C.pack "jetbrains.charisma.main.security.PRINCIPAL=") (principal auth)]
| 276
| false
| true
| 0
| 10
| 75
| 91
| 45
| 46
| null | null |
urbanslug/ghc
|
compiler/cmm/CmmType.hs
|
bsd-3-clause
|
-- log_2 of the width in bytes, useful for generating shifts.
widthInLog :: Width -> Int
widthInLog W8 = 0
| 108
|
widthInLog :: Width -> Int
widthInLog W8 = 0
| 46
|
widthInLog W8 = 0
| 19
| true
| true
| 0
| 5
| 21
| 19
| 10
| 9
| null | null |
esengie/algebraic-checker
|
test/NaturalCategory.hs
|
bsd-3-clause
|
-- <-- ugly?
-- dom (id x) == dom (!x)
domId :: Expr MyProof
domId = N.proofAx (DomId "x") [] []
| 97
|
domId :: Expr MyProof
domId = N.proofAx (DomId "x") [] []
| 57
|
domId = N.proofAx (DomId "x") [] []
| 35
| true
| true
| 1
| 7
| 21
| 38
| 18
| 20
| null | null |
google/ghc-source-gen
|
src/GHC/SourceGen/Type/Internal.hs
|
bsd-3-clause
|
needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t
| 78
|
needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t
| 78
|
needsParenForOp t = case t of
HsOpTy{} -> True
_ -> needsParenForFun t
| 78
| false
| false
| 1
| 8
| 20
| 35
| 15
| 20
| null | null |
christiaanb/Idris-dev
|
src/Idris/REPL.hs
|
bsd-3-clause
|
parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns)
| 63
|
parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns)
| 63
|
parseArgs ("--dumpdefuns":n:ns) = DumpDefun n : (parseArgs ns)
| 63
| false
| false
| 0
| 7
| 8
| 34
| 16
| 18
| null | null |
dongy7/raytracer
|
src/Render/Raytracer.hs
|
mit
|
-- gets intersection color with reflection
colorPoint :: Int -> Maybe PosIntersection -> Scene -> Color
colorPoint (-1) _ _ = (0.0, 0.0, 0.0)
| 145
|
colorPoint :: Int -> Maybe PosIntersection -> Scene -> Color
colorPoint (-1) _ _ = (0.0, 0.0, 0.0)
| 102
|
colorPoint (-1) _ _ = (0.0, 0.0, 0.0)
| 41
| true
| true
| 3
| 6
| 27
| 48
| 27
| 21
| null | null |
nimia/bottle
|
bottlelib/Graphics/UI/Bottle/EventMap.hs
|
gpl-3.0
|
prettyKey :: Key -> String
prettyKey (CharKey x) = [toLower x]
| 62
|
prettyKey :: Key -> String
prettyKey (CharKey x) = [toLower x]
| 62
|
prettyKey (CharKey x) = [toLower x]
| 35
| false
| true
| 0
| 6
| 10
| 34
| 16
| 18
| null | null |
tdidriksen/copatterns
|
src/findus/test/TestPrograms.hs
|
mit
|
-- Natural numbers
natBody :: Type
natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
]
| 128
|
natBody :: Type
natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
]
| 108
|
natBody = TVari [
("Z", []),
("S", [TRecTypeVar "nat"])
]
| 92
| true
| true
| 0
| 9
| 51
| 41
| 24
| 17
| null | null |
dmvianna/haskellbook
|
src/Ch18-Monad.hs
|
unlicense
|
bindingAndSequencing :: IO ()
bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name)
| 134
|
bindingAndSequencing :: IO ()
bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name)
| 134
|
bindingAndSequencing = do
putStrLn "Name pls: "
name <- getLine
putStrLn ("y helo thar: " ++ name)
| 104
| false
| true
| 0
| 9
| 26
| 42
| 19
| 23
| null | null |
ierton/vsim
|
src/VSimR/User.hs
|
bsd-3-clause
|
step :: (Time,[Ptr (Process s)]) -> VSim s ()
step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t
| 121
|
step :: (Time,[Ptr (Process s)]) -> VSim s ()
step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t
| 120
|
step (t,ps) = concat `liftM` mapM (deref >=> runProcess t) ps >>= commit t
| 74
| false
| true
| 0
| 10
| 23
| 81
| 41
| 40
| null | null |
unisonweb/platform
|
parser-typechecker/src/Unison/Server/Doc.hs
|
mit
|
renderDoc :: forall v m . (Var v, Monad m)
=> PPE.PrettyPrintEnvDecl
-> (Reference -> m (Maybe (Term v ())))
-> (Referent -> m (Maybe (Type v ())))
-> (Term v () -> m (Maybe (Term v ())))
-> (Reference -> m (Maybe (DD.Decl v ())))
-> Term v ()
-> m Doc
renderDoc pped terms typeOf eval types tm = eval tm >>= \case
Nothing -> pure $ Word "🆘 doc rendering failed during evaluation"
Just tm -> go tm
where
go = \case
DD.Doc2Word txt -> pure $ Word txt
DD.Doc2Code d -> Code <$> go d
DD.Doc2CodeBlock lang d -> CodeBlock lang <$> go d
DD.Doc2Bold d -> Bold <$> go d
DD.Doc2Italic d -> Italic <$> go d
DD.Doc2Strikethrough d -> Strikethrough <$> go d
DD.Doc2Style s d -> Style s <$> go d
DD.Doc2Anchor id d -> Anchor id <$> go d
DD.Doc2Blockquote d -> Blockquote <$> go d
DD.Doc2Blankline -> pure Blankline
DD.Doc2Linebreak -> pure Linebreak
DD.Doc2SectionBreak -> pure SectionBreak
DD.Doc2Tooltip d1 d2 -> Tooltip <$> go d1 <*> go d2
DD.Doc2Aside d -> Aside <$> go d
DD.Doc2Callout Decls.OptionalNone' d -> Callout Nothing <$> go d
DD.Doc2Callout (Decls.OptionalSome' icon) d -> Callout <$> (Just <$> go icon) <*> go d
DD.Doc2Table rows -> Table <$> traverse r rows
where r (Term.List' ds) = traverse go (toList ds)
r _ = pure [Word "🆘 invalid table"]
DD.Doc2Folded isFolded d d2 -> Folded isFolded <$> go d <*> go d2
DD.Doc2Paragraph ds -> Paragraph <$> traverse go ds
DD.Doc2BulletedList ds -> BulletedList <$> traverse go ds
DD.Doc2Section title ds -> Section <$> go title <*> traverse go ds
DD.Doc2NamedLink d1 d2 -> NamedLink <$> go d1 <*> go d2
DD.Doc2Image d1 d2 Decls.OptionalNone' -> Image <$> go d1 <*> go d2 <*> pure Nothing
DD.Doc2Image d1 d2 (Decls.OptionalSome' d) -> Image <$> go d1 <*> go d2 <*> (Just <$> go d)
DD.Doc2Special sf -> Special <$> goSpecial sf
DD.Doc2Join ds -> Join <$> traverse go ds
DD.Doc2UntitledSection ds -> UntitledSection <$> traverse go ds
DD.Doc2Column ds -> Column <$> traverse go ds
DD.Doc2Group d -> Group <$> go d
wat -> pure . Word . Text.pack . P.toPlain (P.Width 80) . P.indent "🆘 "
. TermPrinter.pretty (PPE.suffixifiedPPE pped) $ wat
formatPretty = fmap Syntax.convertElement . P.render (P.Width 70)
formatPrettyType ppe typ = formatPretty (TypePrinter.prettySyntax ppe typ)
source :: Term v () -> m SyntaxText
source tm = (pure . formatPretty . TermPrinter.prettyBlock' True (PPE.suffixifiedPPE pped)) tm
goSignatures :: [Referent] -> m [P.Pretty S.SyntaxText]
goSignatures rs = runMaybeT (traverse (MaybeT . typeOf) rs) >>= \case
Nothing -> pure ["🆘 codebase is missing type signature for these definitions"]
Just types -> pure . fmap P.group $
TypePrinter.prettySignatures''
(PPE.suffixifiedPPE pped)
[ (PPE.termName (PPE.suffixifiedPPE pped) r, ty) | (r,ty) <- zip rs types]
goSpecial :: Term v () -> m SpecialForm
goSpecial = \case
DD.Doc2SpecialFormFoldedSource (Term.List' es) -> FoldedSource <$> goSrc (toList es)
-- Source [Either Link.Type Doc2.Term]
DD.Doc2SpecialFormSource (Term.List' es) -> Source <$> goSrc (toList es)
-- Example Nat Doc2.Term
-- Examples like `foo x y` are encoded as `Example 2 (_ x y -> foo)`, where
-- 2 is the number of variables that should be dropped from the rendering.
-- So this will render as `foo x y`.
DD.Doc2SpecialFormExample n (DD.Doc2Example vs body) ->
Example <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
DD.Doc2SpecialFormExampleBlock n (DD.Doc2Example vs body) ->
ExampleBlock <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
-- Link (Either Link.Type Doc2.Term)
DD.Doc2SpecialFormLink e -> let
ppe = PPE.suffixifiedPPE pped
tm :: Referent -> P.Pretty S.SyntaxText
tm r = (NP.styleHashQualified'' (NP.fmt (S.Referent r)) . PPE.termName ppe) r
ty :: Reference -> P.Pretty S.SyntaxText
ty r = (NP.styleHashQualified'' (NP.fmt (S.Reference r)) . PPE.typeName ppe) r
in Link <$> case e of
DD.EitherLeft' (Term.TypeLink' r) -> (pure . formatPretty . ty) r
DD.EitherRight' (DD.Doc2Term (Term.Referent' r)) -> (pure . formatPretty . tm) r
_ -> source e
DD.Doc2SpecialFormSignature (Term.List' tms) ->
let rs = [ r | DD.Doc2Term (Term.Referent' r) <- toList tms ]
in goSignatures rs <&> \s -> Signature (map formatPretty s)
-- SignatureInline Doc2.Term
DD.Doc2SpecialFormSignatureInline (DD.Doc2Term (Term.Referent' r)) ->
goSignatures [r] <&> \s -> SignatureInline (formatPretty (P.lines s))
-- Eval Doc2.Term
DD.Doc2SpecialFormEval (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> Eval <$> source tm <*> pure evalErrMsg
Just result -> Eval <$> source tm <*> source result
-- EvalInline Doc2.Term
DD.Doc2SpecialFormEvalInline (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> EvalInline <$> source tm <*> pure evalErrMsg
Just result -> EvalInline <$> source tm <*> source result
-- Embed Any
DD.Doc2SpecialFormEmbed (Term.App' _ any) ->
source any <&> \p -> Embed ("{{ embed {{" <> p <> "}} }}")
-- EmbedInline Any
DD.Doc2SpecialFormEmbedInline any ->
source any <&> \p -> EmbedInline ("{{ embed {{" <> p <> "}} }}")
tm -> source tm <&> \p -> Embed ("🆘 unable to render " <> p)
evalErrMsg = "🆘 An error occured during evaluation"
goSrc :: [Term v ()] -> m [Ref (UnisonHash, DisplayObject SyntaxText Src)]
goSrc es = do
let toRef (Term.Ref' r) = Set.singleton r
toRef (Term.RequestOrCtor' r _) = Set.singleton r
toRef _ = mempty
ppe = PPE.suffixifiedPPE pped
goType :: Reference -> m (Ref (UnisonHash, DisplayObject SyntaxText Src))
goType r@(Reference.Builtin _) =
pure (Type (Reference.toText r, DO.BuiltinObject name))
where name = formatPretty . NP.styleHashQualified (NP.fmt (S.Reference r))
. PPE.typeName ppe $ r
goType r = Type . (Reference.toText r,) <$> do
d <- types r
case d of
Nothing -> pure (DO.MissingObject (SH.unsafeFromText $ Reference.toText r))
Just decl ->
pure $ DO.UserObject (Src folded full)
where
full = formatPretty (DeclPrinter.prettyDecl ppe r (PPE.typeName ppe r) decl)
folded = formatPretty (DeclPrinter.prettyDeclHeader (PPE.typeName ppe r) decl)
go :: (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
-> Term v ()
-> m (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
go s1@(!seen,!acc) = \case
-- we ignore the annotations; but this could be extended later
DD.TupleTerm' [DD.EitherRight' (DD.Doc2Term tm), _anns] ->
(seen <> toRef tm,) <$> acc'
where
acc' = case tm of
Term.Ref' r | Set.notMember r seen -> (:acc) . Term . (Reference.toText r,) <$> case r of
Reference.Builtin _ -> typeOf (Referent.Ref r) <&> \case
Nothing -> DO.BuiltinObject ("🆘 missing type signature")
Just ty -> DO.BuiltinObject (formatPrettyType ppe ty)
ref -> terms ref >>= \case
Nothing -> pure $ DO.MissingObject (SH.unsafeFromText $ Reference.toText ref)
Just tm -> do
typ <- fromMaybe (Type.builtin() "unknown") <$> typeOf (Referent.Ref ref)
let name = PPE.termName ppe (Referent.Ref ref)
let folded = formatPretty . P.lines $ TypePrinter.prettySignatures'' ppe [(name, typ)]
let full tm@(Term.Ann' _ _) _ =
formatPretty (TermPrinter.prettyBinding ppe name tm)
full tm typ =
formatPretty (TermPrinter.prettyBinding ppe name (Term.ann() tm typ))
pure (DO.UserObject (Src folded (full tm typ)))
Term.RequestOrCtor' r _ | Set.notMember r seen -> (:acc) <$> goType r
_ -> pure acc
DD.TupleTerm' [DD.EitherLeft' (Term.TypeLink' ref), _anns]
| Set.notMember ref seen
-> (Set.insert ref seen,) . (:acc) <$> goType ref
_ -> pure s1
reverse . snd <$> foldM go mempty es
| 8,588
|
renderDoc :: forall v m . (Var v, Monad m)
=> PPE.PrettyPrintEnvDecl
-> (Reference -> m (Maybe (Term v ())))
-> (Referent -> m (Maybe (Type v ())))
-> (Term v () -> m (Maybe (Term v ())))
-> (Reference -> m (Maybe (DD.Decl v ())))
-> Term v ()
-> m Doc
renderDoc pped terms typeOf eval types tm = eval tm >>= \case
Nothing -> pure $ Word "🆘 doc rendering failed during evaluation"
Just tm -> go tm
where
go = \case
DD.Doc2Word txt -> pure $ Word txt
DD.Doc2Code d -> Code <$> go d
DD.Doc2CodeBlock lang d -> CodeBlock lang <$> go d
DD.Doc2Bold d -> Bold <$> go d
DD.Doc2Italic d -> Italic <$> go d
DD.Doc2Strikethrough d -> Strikethrough <$> go d
DD.Doc2Style s d -> Style s <$> go d
DD.Doc2Anchor id d -> Anchor id <$> go d
DD.Doc2Blockquote d -> Blockquote <$> go d
DD.Doc2Blankline -> pure Blankline
DD.Doc2Linebreak -> pure Linebreak
DD.Doc2SectionBreak -> pure SectionBreak
DD.Doc2Tooltip d1 d2 -> Tooltip <$> go d1 <*> go d2
DD.Doc2Aside d -> Aside <$> go d
DD.Doc2Callout Decls.OptionalNone' d -> Callout Nothing <$> go d
DD.Doc2Callout (Decls.OptionalSome' icon) d -> Callout <$> (Just <$> go icon) <*> go d
DD.Doc2Table rows -> Table <$> traverse r rows
where r (Term.List' ds) = traverse go (toList ds)
r _ = pure [Word "🆘 invalid table"]
DD.Doc2Folded isFolded d d2 -> Folded isFolded <$> go d <*> go d2
DD.Doc2Paragraph ds -> Paragraph <$> traverse go ds
DD.Doc2BulletedList ds -> BulletedList <$> traverse go ds
DD.Doc2Section title ds -> Section <$> go title <*> traverse go ds
DD.Doc2NamedLink d1 d2 -> NamedLink <$> go d1 <*> go d2
DD.Doc2Image d1 d2 Decls.OptionalNone' -> Image <$> go d1 <*> go d2 <*> pure Nothing
DD.Doc2Image d1 d2 (Decls.OptionalSome' d) -> Image <$> go d1 <*> go d2 <*> (Just <$> go d)
DD.Doc2Special sf -> Special <$> goSpecial sf
DD.Doc2Join ds -> Join <$> traverse go ds
DD.Doc2UntitledSection ds -> UntitledSection <$> traverse go ds
DD.Doc2Column ds -> Column <$> traverse go ds
DD.Doc2Group d -> Group <$> go d
wat -> pure . Word . Text.pack . P.toPlain (P.Width 80) . P.indent "🆘 "
. TermPrinter.pretty (PPE.suffixifiedPPE pped) $ wat
formatPretty = fmap Syntax.convertElement . P.render (P.Width 70)
formatPrettyType ppe typ = formatPretty (TypePrinter.prettySyntax ppe typ)
source :: Term v () -> m SyntaxText
source tm = (pure . formatPretty . TermPrinter.prettyBlock' True (PPE.suffixifiedPPE pped)) tm
goSignatures :: [Referent] -> m [P.Pretty S.SyntaxText]
goSignatures rs = runMaybeT (traverse (MaybeT . typeOf) rs) >>= \case
Nothing -> pure ["🆘 codebase is missing type signature for these definitions"]
Just types -> pure . fmap P.group $
TypePrinter.prettySignatures''
(PPE.suffixifiedPPE pped)
[ (PPE.termName (PPE.suffixifiedPPE pped) r, ty) | (r,ty) <- zip rs types]
goSpecial :: Term v () -> m SpecialForm
goSpecial = \case
DD.Doc2SpecialFormFoldedSource (Term.List' es) -> FoldedSource <$> goSrc (toList es)
-- Source [Either Link.Type Doc2.Term]
DD.Doc2SpecialFormSource (Term.List' es) -> Source <$> goSrc (toList es)
-- Example Nat Doc2.Term
-- Examples like `foo x y` are encoded as `Example 2 (_ x y -> foo)`, where
-- 2 is the number of variables that should be dropped from the rendering.
-- So this will render as `foo x y`.
DD.Doc2SpecialFormExample n (DD.Doc2Example vs body) ->
Example <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
DD.Doc2SpecialFormExampleBlock n (DD.Doc2Example vs body) ->
ExampleBlock <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
-- Link (Either Link.Type Doc2.Term)
DD.Doc2SpecialFormLink e -> let
ppe = PPE.suffixifiedPPE pped
tm :: Referent -> P.Pretty S.SyntaxText
tm r = (NP.styleHashQualified'' (NP.fmt (S.Referent r)) . PPE.termName ppe) r
ty :: Reference -> P.Pretty S.SyntaxText
ty r = (NP.styleHashQualified'' (NP.fmt (S.Reference r)) . PPE.typeName ppe) r
in Link <$> case e of
DD.EitherLeft' (Term.TypeLink' r) -> (pure . formatPretty . ty) r
DD.EitherRight' (DD.Doc2Term (Term.Referent' r)) -> (pure . formatPretty . tm) r
_ -> source e
DD.Doc2SpecialFormSignature (Term.List' tms) ->
let rs = [ r | DD.Doc2Term (Term.Referent' r) <- toList tms ]
in goSignatures rs <&> \s -> Signature (map formatPretty s)
-- SignatureInline Doc2.Term
DD.Doc2SpecialFormSignatureInline (DD.Doc2Term (Term.Referent' r)) ->
goSignatures [r] <&> \s -> SignatureInline (formatPretty (P.lines s))
-- Eval Doc2.Term
DD.Doc2SpecialFormEval (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> Eval <$> source tm <*> pure evalErrMsg
Just result -> Eval <$> source tm <*> source result
-- EvalInline Doc2.Term
DD.Doc2SpecialFormEvalInline (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> EvalInline <$> source tm <*> pure evalErrMsg
Just result -> EvalInline <$> source tm <*> source result
-- Embed Any
DD.Doc2SpecialFormEmbed (Term.App' _ any) ->
source any <&> \p -> Embed ("{{ embed {{" <> p <> "}} }}")
-- EmbedInline Any
DD.Doc2SpecialFormEmbedInline any ->
source any <&> \p -> EmbedInline ("{{ embed {{" <> p <> "}} }}")
tm -> source tm <&> \p -> Embed ("🆘 unable to render " <> p)
evalErrMsg = "🆘 An error occured during evaluation"
goSrc :: [Term v ()] -> m [Ref (UnisonHash, DisplayObject SyntaxText Src)]
goSrc es = do
let toRef (Term.Ref' r) = Set.singleton r
toRef (Term.RequestOrCtor' r _) = Set.singleton r
toRef _ = mempty
ppe = PPE.suffixifiedPPE pped
goType :: Reference -> m (Ref (UnisonHash, DisplayObject SyntaxText Src))
goType r@(Reference.Builtin _) =
pure (Type (Reference.toText r, DO.BuiltinObject name))
where name = formatPretty . NP.styleHashQualified (NP.fmt (S.Reference r))
. PPE.typeName ppe $ r
goType r = Type . (Reference.toText r,) <$> do
d <- types r
case d of
Nothing -> pure (DO.MissingObject (SH.unsafeFromText $ Reference.toText r))
Just decl ->
pure $ DO.UserObject (Src folded full)
where
full = formatPretty (DeclPrinter.prettyDecl ppe r (PPE.typeName ppe r) decl)
folded = formatPretty (DeclPrinter.prettyDeclHeader (PPE.typeName ppe r) decl)
go :: (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
-> Term v ()
-> m (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
go s1@(!seen,!acc) = \case
-- we ignore the annotations; but this could be extended later
DD.TupleTerm' [DD.EitherRight' (DD.Doc2Term tm), _anns] ->
(seen <> toRef tm,) <$> acc'
where
acc' = case tm of
Term.Ref' r | Set.notMember r seen -> (:acc) . Term . (Reference.toText r,) <$> case r of
Reference.Builtin _ -> typeOf (Referent.Ref r) <&> \case
Nothing -> DO.BuiltinObject ("🆘 missing type signature")
Just ty -> DO.BuiltinObject (formatPrettyType ppe ty)
ref -> terms ref >>= \case
Nothing -> pure $ DO.MissingObject (SH.unsafeFromText $ Reference.toText ref)
Just tm -> do
typ <- fromMaybe (Type.builtin() "unknown") <$> typeOf (Referent.Ref ref)
let name = PPE.termName ppe (Referent.Ref ref)
let folded = formatPretty . P.lines $ TypePrinter.prettySignatures'' ppe [(name, typ)]
let full tm@(Term.Ann' _ _) _ =
formatPretty (TermPrinter.prettyBinding ppe name tm)
full tm typ =
formatPretty (TermPrinter.prettyBinding ppe name (Term.ann() tm typ))
pure (DO.UserObject (Src folded (full tm typ)))
Term.RequestOrCtor' r _ | Set.notMember r seen -> (:acc) <$> goType r
_ -> pure acc
DD.TupleTerm' [DD.EitherLeft' (Term.TypeLink' ref), _anns]
| Set.notMember ref seen
-> (Set.insert ref seen,) . (:acc) <$> goType ref
_ -> pure s1
reverse . snd <$> foldM go mempty es
| 8,588
|
renderDoc pped terms typeOf eval types tm = eval tm >>= \case
Nothing -> pure $ Word "🆘 doc rendering failed during evaluation"
Just tm -> go tm
where
go = \case
DD.Doc2Word txt -> pure $ Word txt
DD.Doc2Code d -> Code <$> go d
DD.Doc2CodeBlock lang d -> CodeBlock lang <$> go d
DD.Doc2Bold d -> Bold <$> go d
DD.Doc2Italic d -> Italic <$> go d
DD.Doc2Strikethrough d -> Strikethrough <$> go d
DD.Doc2Style s d -> Style s <$> go d
DD.Doc2Anchor id d -> Anchor id <$> go d
DD.Doc2Blockquote d -> Blockquote <$> go d
DD.Doc2Blankline -> pure Blankline
DD.Doc2Linebreak -> pure Linebreak
DD.Doc2SectionBreak -> pure SectionBreak
DD.Doc2Tooltip d1 d2 -> Tooltip <$> go d1 <*> go d2
DD.Doc2Aside d -> Aside <$> go d
DD.Doc2Callout Decls.OptionalNone' d -> Callout Nothing <$> go d
DD.Doc2Callout (Decls.OptionalSome' icon) d -> Callout <$> (Just <$> go icon) <*> go d
DD.Doc2Table rows -> Table <$> traverse r rows
where r (Term.List' ds) = traverse go (toList ds)
r _ = pure [Word "🆘 invalid table"]
DD.Doc2Folded isFolded d d2 -> Folded isFolded <$> go d <*> go d2
DD.Doc2Paragraph ds -> Paragraph <$> traverse go ds
DD.Doc2BulletedList ds -> BulletedList <$> traverse go ds
DD.Doc2Section title ds -> Section <$> go title <*> traverse go ds
DD.Doc2NamedLink d1 d2 -> NamedLink <$> go d1 <*> go d2
DD.Doc2Image d1 d2 Decls.OptionalNone' -> Image <$> go d1 <*> go d2 <*> pure Nothing
DD.Doc2Image d1 d2 (Decls.OptionalSome' d) -> Image <$> go d1 <*> go d2 <*> (Just <$> go d)
DD.Doc2Special sf -> Special <$> goSpecial sf
DD.Doc2Join ds -> Join <$> traverse go ds
DD.Doc2UntitledSection ds -> UntitledSection <$> traverse go ds
DD.Doc2Column ds -> Column <$> traverse go ds
DD.Doc2Group d -> Group <$> go d
wat -> pure . Word . Text.pack . P.toPlain (P.Width 80) . P.indent "🆘 "
. TermPrinter.pretty (PPE.suffixifiedPPE pped) $ wat
formatPretty = fmap Syntax.convertElement . P.render (P.Width 70)
formatPrettyType ppe typ = formatPretty (TypePrinter.prettySyntax ppe typ)
source :: Term v () -> m SyntaxText
source tm = (pure . formatPretty . TermPrinter.prettyBlock' True (PPE.suffixifiedPPE pped)) tm
goSignatures :: [Referent] -> m [P.Pretty S.SyntaxText]
goSignatures rs = runMaybeT (traverse (MaybeT . typeOf) rs) >>= \case
Nothing -> pure ["🆘 codebase is missing type signature for these definitions"]
Just types -> pure . fmap P.group $
TypePrinter.prettySignatures''
(PPE.suffixifiedPPE pped)
[ (PPE.termName (PPE.suffixifiedPPE pped) r, ty) | (r,ty) <- zip rs types]
goSpecial :: Term v () -> m SpecialForm
goSpecial = \case
DD.Doc2SpecialFormFoldedSource (Term.List' es) -> FoldedSource <$> goSrc (toList es)
-- Source [Either Link.Type Doc2.Term]
DD.Doc2SpecialFormSource (Term.List' es) -> Source <$> goSrc (toList es)
-- Example Nat Doc2.Term
-- Examples like `foo x y` are encoded as `Example 2 (_ x y -> foo)`, where
-- 2 is the number of variables that should be dropped from the rendering.
-- So this will render as `foo x y`.
DD.Doc2SpecialFormExample n (DD.Doc2Example vs body) ->
Example <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
DD.Doc2SpecialFormExampleBlock n (DD.Doc2Example vs body) ->
ExampleBlock <$> source ex
where ex = Term.lam' (ABT.annotation body) (drop (fromIntegral n) vs) body
-- Link (Either Link.Type Doc2.Term)
DD.Doc2SpecialFormLink e -> let
ppe = PPE.suffixifiedPPE pped
tm :: Referent -> P.Pretty S.SyntaxText
tm r = (NP.styleHashQualified'' (NP.fmt (S.Referent r)) . PPE.termName ppe) r
ty :: Reference -> P.Pretty S.SyntaxText
ty r = (NP.styleHashQualified'' (NP.fmt (S.Reference r)) . PPE.typeName ppe) r
in Link <$> case e of
DD.EitherLeft' (Term.TypeLink' r) -> (pure . formatPretty . ty) r
DD.EitherRight' (DD.Doc2Term (Term.Referent' r)) -> (pure . formatPretty . tm) r
_ -> source e
DD.Doc2SpecialFormSignature (Term.List' tms) ->
let rs = [ r | DD.Doc2Term (Term.Referent' r) <- toList tms ]
in goSignatures rs <&> \s -> Signature (map formatPretty s)
-- SignatureInline Doc2.Term
DD.Doc2SpecialFormSignatureInline (DD.Doc2Term (Term.Referent' r)) ->
goSignatures [r] <&> \s -> SignatureInline (formatPretty (P.lines s))
-- Eval Doc2.Term
DD.Doc2SpecialFormEval (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> Eval <$> source tm <*> pure evalErrMsg
Just result -> Eval <$> source tm <*> source result
-- EvalInline Doc2.Term
DD.Doc2SpecialFormEvalInline (DD.Doc2Term tm) -> eval tm >>= \case
Nothing -> EvalInline <$> source tm <*> pure evalErrMsg
Just result -> EvalInline <$> source tm <*> source result
-- Embed Any
DD.Doc2SpecialFormEmbed (Term.App' _ any) ->
source any <&> \p -> Embed ("{{ embed {{" <> p <> "}} }}")
-- EmbedInline Any
DD.Doc2SpecialFormEmbedInline any ->
source any <&> \p -> EmbedInline ("{{ embed {{" <> p <> "}} }}")
tm -> source tm <&> \p -> Embed ("🆘 unable to render " <> p)
evalErrMsg = "🆘 An error occured during evaluation"
goSrc :: [Term v ()] -> m [Ref (UnisonHash, DisplayObject SyntaxText Src)]
goSrc es = do
let toRef (Term.Ref' r) = Set.singleton r
toRef (Term.RequestOrCtor' r _) = Set.singleton r
toRef _ = mempty
ppe = PPE.suffixifiedPPE pped
goType :: Reference -> m (Ref (UnisonHash, DisplayObject SyntaxText Src))
goType r@(Reference.Builtin _) =
pure (Type (Reference.toText r, DO.BuiltinObject name))
where name = formatPretty . NP.styleHashQualified (NP.fmt (S.Reference r))
. PPE.typeName ppe $ r
goType r = Type . (Reference.toText r,) <$> do
d <- types r
case d of
Nothing -> pure (DO.MissingObject (SH.unsafeFromText $ Reference.toText r))
Just decl ->
pure $ DO.UserObject (Src folded full)
where
full = formatPretty (DeclPrinter.prettyDecl ppe r (PPE.typeName ppe r) decl)
folded = formatPretty (DeclPrinter.prettyDeclHeader (PPE.typeName ppe r) decl)
go :: (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
-> Term v ()
-> m (Set.Set Reference, [Ref (UnisonHash, DisplayObject SyntaxText Src)])
go s1@(!seen,!acc) = \case
-- we ignore the annotations; but this could be extended later
DD.TupleTerm' [DD.EitherRight' (DD.Doc2Term tm), _anns] ->
(seen <> toRef tm,) <$> acc'
where
acc' = case tm of
Term.Ref' r | Set.notMember r seen -> (:acc) . Term . (Reference.toText r,) <$> case r of
Reference.Builtin _ -> typeOf (Referent.Ref r) <&> \case
Nothing -> DO.BuiltinObject ("🆘 missing type signature")
Just ty -> DO.BuiltinObject (formatPrettyType ppe ty)
ref -> terms ref >>= \case
Nothing -> pure $ DO.MissingObject (SH.unsafeFromText $ Reference.toText ref)
Just tm -> do
typ <- fromMaybe (Type.builtin() "unknown") <$> typeOf (Referent.Ref ref)
let name = PPE.termName ppe (Referent.Ref ref)
let folded = formatPretty . P.lines $ TypePrinter.prettySignatures'' ppe [(name, typ)]
let full tm@(Term.Ann' _ _) _ =
formatPretty (TermPrinter.prettyBinding ppe name tm)
full tm typ =
formatPretty (TermPrinter.prettyBinding ppe name (Term.ann() tm typ))
pure (DO.UserObject (Src folded (full tm typ)))
Term.RequestOrCtor' r _ | Set.notMember r seen -> (:acc) <$> goType r
_ -> pure acc
DD.TupleTerm' [DD.EitherLeft' (Term.TypeLink' ref), _anns]
| Set.notMember ref seen
-> (Set.insert ref seen,) . (:acc) <$> goType ref
_ -> pure s1
reverse . snd <$> foldM go mempty es
| 8,265
| false
| true
| 4
| 25
| 2,369
| 3,195
| 1,532
| 1,663
| null | null |
mit-plv/riscv-semantics
|
src/Spec/CSRGetSet.hs
|
bsd-3-clause
|
setCSR SScratch val = setCSRField Field.SScratch val
| 52
|
setCSR SScratch val = setCSRField Field.SScratch val
| 52
|
setCSR SScratch val = setCSRField Field.SScratch val
| 52
| false
| false
| 0
| 6
| 6
| 18
| 8
| 10
| null | null |
valderman/haste-app
|
src/Haste/App/Sandbox.hs
|
mit
|
-- | Called in sandbox to report to host that it's done loading dependencies.
doneLoadingDeps :: IO ()
doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})"
| 181
|
doneLoadingDeps :: IO ()
doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})"
| 103
|
doneLoadingDeps = ffi "(function(){parent.postMessage(__haste_prog_id,'*');})"
| 78
| true
| true
| 0
| 6
| 21
| 20
| 10
| 10
| null | null |
yliu120/K3
|
src/Language/K3/Core/Type.hs
|
apache-2.0
|
isTUID _ = False
| 23
|
isTUID _ = False
| 23
|
isTUID _ = False
| 23
| false
| false
| 0
| 5
| 10
| 9
| 4
| 5
| null | null |
ekmett/text
|
tests/Tests/Properties.hs
|
bsd-2-clause
|
s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail)
| 64
|
s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail)
| 64
|
s_tail_s = tail `eqP` (unpackS . S.unstream . S.tail)
| 64
| false
| false
| 0
| 9
| 19
| 27
| 15
| 12
| null | null |
ondrasej/heavenly-bodies
|
src/HBodies/Game/State.hs
|
apache-2.0
|
-- | Sets the asteroid the player collided with.
setAsteroidCollision :: AsteroidState.State
-- ^ The asteroid the player collided with.
-> Update ()
setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid }
| 296
|
setAsteroidCollision :: AsteroidState.State
-- ^ The asteroid the player collided with.
-> Update ()
setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid }
| 247
|
setAsteroidCollision asteroid = MonadState.modify'$ \d ->
d { getAsteroidCollision = Just asteroid }
| 104
| true
| true
| 0
| 9
| 81
| 49
| 26
| 23
| null | null |
igraves/flow-arrow
|
Control/Arrow/Flow.hs
|
bsd-3-clause
|
{-| Convenience function for returning a value -}
finished :: a -> Stalled a
finished a = Stalled $ Just a
| 107
|
finished :: a -> Stalled a
finished a = Stalled $ Just a
| 56
|
finished a = Stalled $ Just a
| 29
| true
| true
| 0
| 6
| 21
| 29
| 14
| 15
| null | null |
HJvT/com
|
System/Win32/Com/Exception.hs
|
bsd-3-clause
|
oLEOBJ_S_FIRST :: HRESULT
oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32)
| 78
|
oLEOBJ_S_FIRST :: HRESULT
oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32)
| 78
|
oLEOBJ_S_FIRST = word32ToInt32 (0x00040180 ::Word32)
| 52
| false
| true
| 0
| 6
| 7
| 26
| 12
| 14
| null | null |
uecmma/LTSHaskell-slack-bot
|
src/Bot/Config.hs
|
mit
|
allBotInfo :: ParserInfo BotOptions
allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell"
| 188
|
allBotInfo :: ParserInfo BotOptions
allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell"
| 188
|
allBotInfo = info
(helper <*> botOptionsParser)
$ fullDesc
<> progDesc "LTSHaskell Slack Bot"
<> header "notification updating of LTSHaskell"
| 152
| false
| true
| 7
| 6
| 33
| 49
| 20
| 29
| null | null |
vincenthz/hs-packer
|
Tests/Tests.hs
|
bsd-2-clause
|
test_property_hole :: DataBytes -> Bool
test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.ByteString -> DataBytes
runParser = runUnpacking parser
packer :: B.ByteString -> Packing ()
packer bs = do
hsize <- putHoleWord32LE
putBytes bs
fillHole hsize (fromIntegral $ B.length bs)
parser :: Unpacking DataBytes
parser = do
size <- fromIntegral <$> getWord32LE
DataBytes <$> getBytes size
| 676
|
test_property_hole :: DataBytes -> Bool
test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.ByteString -> DataBytes
runParser = runUnpacking parser
packer :: B.ByteString -> Packing ()
packer bs = do
hsize <- putHoleWord32LE
putBytes bs
fillHole hsize (fromIntegral $ B.length bs)
parser :: Unpacking DataBytes
parser = do
size <- fromIntegral <$> getWord32LE
DataBytes <$> getBytes size
| 676
|
test_property_hole dbytes =
dbytes == r2
where
p1 = runPacker dbytes
r1 = runParser p1
p2 = runPacker r1
r2 = runParser p2
runPacker :: DataBytes -> B.ByteString
runPacker (DataBytes bs) = runPacking (B.length bs + 4) (packer bs)
runParser :: B.ByteString -> DataBytes
runParser = runUnpacking parser
packer :: B.ByteString -> Packing ()
packer bs = do
hsize <- putHoleWord32LE
putBytes bs
fillHole hsize (fromIntegral $ B.length bs)
parser :: Unpacking DataBytes
parser = do
size <- fromIntegral <$> getWord32LE
DataBytes <$> getBytes size
| 636
| false
| true
| 21
| 7
| 185
| 207
| 104
| 103
| null | null |
siddhanathan/ghc
|
compiler/ghci/ByteCodeAsm.hs
|
bsd-3-clause
|
return_ubx V16 = error "return_ubx: vector"
| 43
|
return_ubx V16 = error "return_ubx: vector"
| 43
|
return_ubx V16 = error "return_ubx: vector"
| 43
| false
| false
| 1
| 5
| 5
| 15
| 5
| 10
| null | null |
jamesdabbs/pi-base-2
|
src/Universe.hs
|
bsd-3-clause
|
contains :: SpaceId -> PropertyId -> Universe -> Bool
contains sid pid = M.member pid . attributes sid
| 102
|
contains :: SpaceId -> PropertyId -> Universe -> Bool
contains sid pid = M.member pid . attributes sid
| 102
|
contains sid pid = M.member pid . attributes sid
| 48
| false
| true
| 1
| 9
| 17
| 46
| 20
| 26
| null | null |
ilyasergey/GHC-XAppFix
|
compiler/nativeGen/PPC/Ppr.hs
|
bsd-3-clause
|
pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
]
| 179
|
pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
]
| 179
|
pprInstr platform (JMP lbl) = hcat [ -- an alias for b that takes a CLabel
char '\t',
ptext (sLit "b"),
char '\t',
pprCLabel_asm platform lbl
]
| 179
| false
| false
| 0
| 9
| 62
| 53
| 26
| 27
| null | null |
bitemyapp/hakaru
|
Language/Hakaru/Lambda.hs
|
bsd-3-clause
|
-- raw lit is a pain to use. These are nicer
dbl :: Double -> Double
dbl = lit
| 79
|
dbl :: Double -> Double
dbl = lit
| 33
|
dbl = lit
| 9
| true
| true
| 0
| 7
| 19
| 23
| 10
| 13
| null | null |
nevrenato/Hets_Fork
|
Common/AnnoParser.hs
|
gpl-2.0
|
annoteGroup :: Pos -> Annote_word -> GenParser Char st Annotation
annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w $ swapTable semantic_anno_table of
Just sa -> return $ Semantic_anno sa
$ Range [p, Id.incSourceColumn p $ length (show sa) - 3]
Nothing -> aP
_ -> aP
| 510
|
annoteGroup :: Pos -> Annote_word -> GenParser Char st Annotation
annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w $ swapTable semantic_anno_table of
Just sa -> return $ Semantic_anno sa
$ Range [p, Id.incSourceColumn p $ length (show sa) - 3]
Nothing -> aP
_ -> aP
| 510
|
annoteGroup p s =
let aP = do
annoteLines <- plainBlock "(" ")%"
q <- getPos
return $ Unparsed_anno s (Group_anno $ mylines annoteLines)
$ Range [p, dec q]
in case s of
Annote_word w -> case lookup w $ swapTable semantic_anno_table of
Just sa -> return $ Semantic_anno sa
$ Range [p, Id.incSourceColumn p $ length (show sa) - 3]
Nothing -> aP
_ -> aP
| 444
| false
| true
| 0
| 20
| 170
| 189
| 88
| 101
| null | null |
erochest/whatisdh
|
Application.hs
|
bsd-2-clause
|
canonicalizeKey pair = pair
| 27
|
canonicalizeKey pair = pair
| 27
|
canonicalizeKey pair = pair
| 27
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ajtulloch/dnngraph
|
NN/Visualize.hs
|
bsd-3-clause
|
pdf = render Pdf
| 16
|
pdf = render Pdf
| 16
|
pdf = render Pdf
| 16
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
mzini/hosa
|
src/HoSA/Utils.hs
|
mit
|
uniqueToInt :: Unique -> Int
uniqueToInt (Unique i) = i
| 55
|
uniqueToInt :: Unique -> Int
uniqueToInt (Unique i) = i
| 55
|
uniqueToInt (Unique i) = i
| 26
| false
| true
| 0
| 7
| 9
| 24
| 12
| 12
| null | null |
lynnard/cocos2d-hs
|
generator/Graphics/UI/Cocos2d/Generator/Interface/Event.hs
|
bsd-3-clause
|
c_EventListenerMouse :: Class
c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseUp" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseMove" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseScroll" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
]
| 664
|
c_EventListenerMouse :: Class
c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseUp" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseMove" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseScroll" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
]
| 664
|
c_EventListenerMouse =
addReqIncludes [includeStd "base/CCEventListenerMouse.h"] $
makeClass (ident1 "cocos2d" "EventListenerMouse") Nothing [c_EventListener]
[ mkStaticMethod "create" [] $ ptrT $ objT c_EventListenerMouse
, makeClassVariable "onMouseDown" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseUp" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseMove" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
, makeClassVariable "onMouseScroll" Nothing (callbackT cb_EventMouseCallback) Nonstatic False
]
| 634
| false
| true
| 0
| 10
| 98
| 154
| 73
| 81
| null | null |
jbapple/unique
|
BraunUnique.hs
|
mit
|
insert :: Ord a => a -> Unique a -> Unique a
insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]])
| 107
|
insert :: Ord a => a -> Unique a -> Unique a
insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]])
| 107
|
insert x (Unique 0 _) = Unique 1 (B.fromList [B.fromList [x]])
| 62
| false
| true
| 0
| 10
| 22
| 69
| 33
| 36
| null | null |
Pixelgebra/tilepin
|
src/Internal/Colors.hs
|
mit
|
--
clrPink = V4 255 105 180 255
| 33
|
clrPink = V4 255 105 180 255
| 30
|
clrPink = V4 255 105 180 255
| 30
| true
| false
| 0
| 5
| 9
| 16
| 8
| 8
| null | null |
NickAger/LearningHaskell
|
haskellForMacMiscPlayground/Diagrams.hsproj/ExampleStocks.hs
|
mit
|
pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mkDate 55096,(6.67,6.68,6.74,6.78))
, (mkDate 55095,(6.62,6.67,6.7,6.77))
, (mkDate 55092,(6.63,6.71,6.7,6.76))
, (mkDate 55091,(6.64,6.7,6.67,6.76))
, (mkDate 55090,(6.76,6.84,6.77,6.85))
, (mkDate 55089,(6.69,6.73,6.84,6.9))
, (mkDate 55088,(6.73,6.74,6.8,6.81))
, (mkDate 55085,(6.84,7.05,6.87,7.07))
, (mkDate 55084,(6.65,6.7,6.94,6.97))
, (mkDate 55083,(6.65,6.71,6.7,6.75))
, (mkDate 55082,(6.56,6.58,6.65,6.68))
, (mkDate 55078,(6.16,6.18,6.39,6.41))
, (mkDate 55077,(6.11,6.19,6.21,6.24))
, (mkDate 55076,(6.03,6.07,6.09,6.14))
, (mkDate 55075,(6.14,6.22,6.24,6.31))
, (mkDate 55074,(6.3,6.45,6.35,6.45))
, (mkDate 55071,(6.4,6.5,6.47,6.56))
, (mkDate 55070,(6.13,6.18,6.35,6.39))
, (mkDate 55069,(6.1,6.12,6.16,6.2))
, (mkDate 55068,(6.14,6.3,6.17,6.3))
, (mkDate 55067,(6.19,6.29,6.21,6.34))
, (mkDate 55064,(6.25,6.32,6.3,6.38))
, (mkDate 55063,(6.18,6.2,6.25,6.27))
, (mkDate 55062,(6.09,6.11,6.19,6.22))
, (mkDate 55061,(6.14,6.14,6.23,6.28))
, (mkDate 55060,(5.91,6.02,5.98,6.04))
, (mkDate 55057,(6.04,6.15,6.2,6.21))
, (mkDate 55056,(6.1,6.18,6.22,6.26))
, (mkDate 55055,(6.07,6.07,6.22,6.3))
, (mkDate 55054,(6.09,6.23,6.14,6.23))
, (mkDate 55053,(6.19,6.39,6.23,6.4))
, (mkDate 55050,(6.25,6.31,6.32,6.41))
, (mkDate 55049,(6.2,6.42,6.24,6.42))
, (mkDate 55048,(6.4,6.55,6.46,6.55))
, (mkDate 55047,(6.5,6.52,6.67,6.7))
, (mkDate 55046,(6.5,6.51,6.58,6.6))
, (mkDate 55043,(6.3,6.34,6.39,6.43))
, (mkDate 55042,(6.42,6.47,6.46,6.64))
, (mkDate 55041,(6.14,6.37,6.22,6.49))
, (mkDate 55040,(6.28,6.32,6.52,6.56))
, (mkDate 55039,(6.41,6.47,6.49,6.63))
, (mkDate 55036,(6.27,6.36,6.44,6.44))
, (mkDate 55035,(6.47,6.48,6.52,6.55))
, (mkDate 55034,(6.38,6.41,6.47,6.51))
, (mkDate 55033,(6.27,6.45,6.41,6.46))
, (mkDate 55032,(6.32,6.44,6.45,6.48))
, (mkDate 55029,(6.23,6.25,6.37,6.45))
, (mkDate 55028,(6.24,6.29,6.35,6.39))
, (mkDate 55027,(6.37,6.53,6.45,6.6))
, (mkDate 55026,(6.12,6.13,6.19,6.23))
, (mkDate 55025,(5.98,6.02,6.12,6.13))
, (mkDate 55022,(5.93,5.96,6.08,6.12))
, (mkDate 55021,(5.74,5.8,5.97,6.0))
, (mkDate 55020,(5.61,5.74,5.69,5.82))
, (mkDate 55019,(5.68,5.82,5.69,5.84))
, (mkDate 55018,(5.77,5.84,5.91,5.93))
, (mkDate 55014,(5.89,6.03,5.94,6.06))
, (mkDate 55013,(5.93,5.98,5.95,6.03))
]
| 2,780
|
pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mkDate 55096,(6.67,6.68,6.74,6.78))
, (mkDate 55095,(6.62,6.67,6.7,6.77))
, (mkDate 55092,(6.63,6.71,6.7,6.76))
, (mkDate 55091,(6.64,6.7,6.67,6.76))
, (mkDate 55090,(6.76,6.84,6.77,6.85))
, (mkDate 55089,(6.69,6.73,6.84,6.9))
, (mkDate 55088,(6.73,6.74,6.8,6.81))
, (mkDate 55085,(6.84,7.05,6.87,7.07))
, (mkDate 55084,(6.65,6.7,6.94,6.97))
, (mkDate 55083,(6.65,6.71,6.7,6.75))
, (mkDate 55082,(6.56,6.58,6.65,6.68))
, (mkDate 55078,(6.16,6.18,6.39,6.41))
, (mkDate 55077,(6.11,6.19,6.21,6.24))
, (mkDate 55076,(6.03,6.07,6.09,6.14))
, (mkDate 55075,(6.14,6.22,6.24,6.31))
, (mkDate 55074,(6.3,6.45,6.35,6.45))
, (mkDate 55071,(6.4,6.5,6.47,6.56))
, (mkDate 55070,(6.13,6.18,6.35,6.39))
, (mkDate 55069,(6.1,6.12,6.16,6.2))
, (mkDate 55068,(6.14,6.3,6.17,6.3))
, (mkDate 55067,(6.19,6.29,6.21,6.34))
, (mkDate 55064,(6.25,6.32,6.3,6.38))
, (mkDate 55063,(6.18,6.2,6.25,6.27))
, (mkDate 55062,(6.09,6.11,6.19,6.22))
, (mkDate 55061,(6.14,6.14,6.23,6.28))
, (mkDate 55060,(5.91,6.02,5.98,6.04))
, (mkDate 55057,(6.04,6.15,6.2,6.21))
, (mkDate 55056,(6.1,6.18,6.22,6.26))
, (mkDate 55055,(6.07,6.07,6.22,6.3))
, (mkDate 55054,(6.09,6.23,6.14,6.23))
, (mkDate 55053,(6.19,6.39,6.23,6.4))
, (mkDate 55050,(6.25,6.31,6.32,6.41))
, (mkDate 55049,(6.2,6.42,6.24,6.42))
, (mkDate 55048,(6.4,6.55,6.46,6.55))
, (mkDate 55047,(6.5,6.52,6.67,6.7))
, (mkDate 55046,(6.5,6.51,6.58,6.6))
, (mkDate 55043,(6.3,6.34,6.39,6.43))
, (mkDate 55042,(6.42,6.47,6.46,6.64))
, (mkDate 55041,(6.14,6.37,6.22,6.49))
, (mkDate 55040,(6.28,6.32,6.52,6.56))
, (mkDate 55039,(6.41,6.47,6.49,6.63))
, (mkDate 55036,(6.27,6.36,6.44,6.44))
, (mkDate 55035,(6.47,6.48,6.52,6.55))
, (mkDate 55034,(6.38,6.41,6.47,6.51))
, (mkDate 55033,(6.27,6.45,6.41,6.46))
, (mkDate 55032,(6.32,6.44,6.45,6.48))
, (mkDate 55029,(6.23,6.25,6.37,6.45))
, (mkDate 55028,(6.24,6.29,6.35,6.39))
, (mkDate 55027,(6.37,6.53,6.45,6.6))
, (mkDate 55026,(6.12,6.13,6.19,6.23))
, (mkDate 55025,(5.98,6.02,6.12,6.13))
, (mkDate 55022,(5.93,5.96,6.08,6.12))
, (mkDate 55021,(5.74,5.8,5.97,6.0))
, (mkDate 55020,(5.61,5.74,5.69,5.82))
, (mkDate 55019,(5.68,5.82,5.69,5.84))
, (mkDate 55018,(5.77,5.84,5.91,5.93))
, (mkDate 55014,(5.89,6.03,5.94,6.06))
, (mkDate 55013,(5.93,5.98,5.95,6.03))
]
| 2,780
|
pricesARMH =
[ (mkDate 55105,(6.65,6.83,6.65,6.86))
, (mkDate 55104,(6.87,7.0,7.0,7.02))
, (mkDate 55103,(6.88,6.92,6.95,6.97))
, (mkDate 55102,(6.62,6.63,6.81,6.82))
, (mkDate 55099,(6.69,6.88,6.72,6.88))
, (mkDate 55098,(6.55,6.69,6.64,6.88))
, (mkDate 55097,(6.8,6.87,6.8,6.94))
, (mkDate 55096,(6.67,6.68,6.74,6.78))
, (mkDate 55095,(6.62,6.67,6.7,6.77))
, (mkDate 55092,(6.63,6.71,6.7,6.76))
, (mkDate 55091,(6.64,6.7,6.67,6.76))
, (mkDate 55090,(6.76,6.84,6.77,6.85))
, (mkDate 55089,(6.69,6.73,6.84,6.9))
, (mkDate 55088,(6.73,6.74,6.8,6.81))
, (mkDate 55085,(6.84,7.05,6.87,7.07))
, (mkDate 55084,(6.65,6.7,6.94,6.97))
, (mkDate 55083,(6.65,6.71,6.7,6.75))
, (mkDate 55082,(6.56,6.58,6.65,6.68))
, (mkDate 55078,(6.16,6.18,6.39,6.41))
, (mkDate 55077,(6.11,6.19,6.21,6.24))
, (mkDate 55076,(6.03,6.07,6.09,6.14))
, (mkDate 55075,(6.14,6.22,6.24,6.31))
, (mkDate 55074,(6.3,6.45,6.35,6.45))
, (mkDate 55071,(6.4,6.5,6.47,6.56))
, (mkDate 55070,(6.13,6.18,6.35,6.39))
, (mkDate 55069,(6.1,6.12,6.16,6.2))
, (mkDate 55068,(6.14,6.3,6.17,6.3))
, (mkDate 55067,(6.19,6.29,6.21,6.34))
, (mkDate 55064,(6.25,6.32,6.3,6.38))
, (mkDate 55063,(6.18,6.2,6.25,6.27))
, (mkDate 55062,(6.09,6.11,6.19,6.22))
, (mkDate 55061,(6.14,6.14,6.23,6.28))
, (mkDate 55060,(5.91,6.02,5.98,6.04))
, (mkDate 55057,(6.04,6.15,6.2,6.21))
, (mkDate 55056,(6.1,6.18,6.22,6.26))
, (mkDate 55055,(6.07,6.07,6.22,6.3))
, (mkDate 55054,(6.09,6.23,6.14,6.23))
, (mkDate 55053,(6.19,6.39,6.23,6.4))
, (mkDate 55050,(6.25,6.31,6.32,6.41))
, (mkDate 55049,(6.2,6.42,6.24,6.42))
, (mkDate 55048,(6.4,6.55,6.46,6.55))
, (mkDate 55047,(6.5,6.52,6.67,6.7))
, (mkDate 55046,(6.5,6.51,6.58,6.6))
, (mkDate 55043,(6.3,6.34,6.39,6.43))
, (mkDate 55042,(6.42,6.47,6.46,6.64))
, (mkDate 55041,(6.14,6.37,6.22,6.49))
, (mkDate 55040,(6.28,6.32,6.52,6.56))
, (mkDate 55039,(6.41,6.47,6.49,6.63))
, (mkDate 55036,(6.27,6.36,6.44,6.44))
, (mkDate 55035,(6.47,6.48,6.52,6.55))
, (mkDate 55034,(6.38,6.41,6.47,6.51))
, (mkDate 55033,(6.27,6.45,6.41,6.46))
, (mkDate 55032,(6.32,6.44,6.45,6.48))
, (mkDate 55029,(6.23,6.25,6.37,6.45))
, (mkDate 55028,(6.24,6.29,6.35,6.39))
, (mkDate 55027,(6.37,6.53,6.45,6.6))
, (mkDate 55026,(6.12,6.13,6.19,6.23))
, (mkDate 55025,(5.98,6.02,6.12,6.13))
, (mkDate 55022,(5.93,5.96,6.08,6.12))
, (mkDate 55021,(5.74,5.8,5.97,6.0))
, (mkDate 55020,(5.61,5.74,5.69,5.82))
, (mkDate 55019,(5.68,5.82,5.69,5.84))
, (mkDate 55018,(5.77,5.84,5.91,5.93))
, (mkDate 55014,(5.89,6.03,5.94,6.06))
, (mkDate 55013,(5.93,5.98,5.95,6.03))
]
| 2,780
| false
| false
| 0
| 7
| 462
| 1,566
| 978
| 588
| null | null |
andyarvanitis/Idris-dev
|
src/Idris/Core/CaseTree.hs
|
bsd-3-clause
|
isVarPat (PAny : ps , _) = True
| 33
|
isVarPat (PAny : ps , _) = True
| 33
|
isVarPat (PAny : ps , _) = True
| 33
| false
| false
| 0
| 7
| 9
| 19
| 10
| 9
| null | null |
brendanhay/gogol
|
gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Triggers/List.hs
|
mpl-2.0
|
-- | Creates a value of 'AccountsContainersWorkspacesTriggersList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acwtl1Parent'
--
-- * 'acwtl1Xgafv'
--
-- * 'acwtl1UploadProtocol'
--
-- * 'acwtl1AccessToken'
--
-- * 'acwtl1UploadType'
--
-- * 'acwtl1PageToken'
--
-- * 'acwtl1Callback'
accountsContainersWorkspacesTriggersList
:: Text -- ^ 'acwtl1Parent'
-> AccountsContainersWorkspacesTriggersList
accountsContainersWorkspacesTriggersList pAcwtl1Parent_ =
AccountsContainersWorkspacesTriggersList'
{ _acwtl1Parent = pAcwtl1Parent_
, _acwtl1Xgafv = Nothing
, _acwtl1UploadProtocol = Nothing
, _acwtl1AccessToken = Nothing
, _acwtl1UploadType = Nothing
, _acwtl1PageToken = Nothing
, _acwtl1Callback = Nothing
}
| 840
|
accountsContainersWorkspacesTriggersList
:: Text -- ^ 'acwtl1Parent'
-> AccountsContainersWorkspacesTriggersList
accountsContainersWorkspacesTriggersList pAcwtl1Parent_ =
AccountsContainersWorkspacesTriggersList'
{ _acwtl1Parent = pAcwtl1Parent_
, _acwtl1Xgafv = Nothing
, _acwtl1UploadProtocol = Nothing
, _acwtl1AccessToken = Nothing
, _acwtl1UploadType = Nothing
, _acwtl1PageToken = Nothing
, _acwtl1Callback = Nothing
}
| 466
|
accountsContainersWorkspacesTriggersList pAcwtl1Parent_ =
AccountsContainersWorkspacesTriggersList'
{ _acwtl1Parent = pAcwtl1Parent_
, _acwtl1Xgafv = Nothing
, _acwtl1UploadProtocol = Nothing
, _acwtl1AccessToken = Nothing
, _acwtl1UploadType = Nothing
, _acwtl1PageToken = Nothing
, _acwtl1Callback = Nothing
}
| 345
| true
| true
| 0
| 7
| 140
| 89
| 58
| 31
| null | null |
christiaanb/Idris-dev
|
src/Idris/ElabDecls.hs
|
bsd-3-clause
|
pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc
| 94
|
pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc
| 94
|
pbinds (Bind n (PVar t) sc) = do attack; patbind n
pbinds sc
| 94
| false
| false
| 0
| 9
| 46
| 41
| 18
| 23
| null | null |
qnikst/distributed-process-task
|
tests/TestTaskQueues.hs
|
bsd-3-clause
|
testSimplePoolJobBlocksCaller :: TestResult (AsyncResult (Either ExitReason String))
-> Process ()
testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= wait >>= stash result
| 341
|
testSimplePoolJobBlocksCaller :: TestResult (AsyncResult (Either ExitReason String))
-> Process ()
testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= wait >>= stash result
| 341
|
testSimplePoolJobBlocksCaller result = do
pid <- startPool 1
-- we do a non-blocking test first
job <- return $ ($(mkClosure 'sampleTask) (seconds 2, "foobar"))
callAsync pid job >>= wait >>= stash result
| 212
| false
| true
| 0
| 13
| 79
| 104
| 49
| 55
| null | null |
beni55/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |]
| 110
|
genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |]
| 110
|
genPrim _ _ WriteOffAddrOp_Float [] [a,o,i,v] = PrimInline [j| `a`.dv.setFloat32(`o`+(`i`<<2), `v`,true); |]
| 110
| false
| false
| 0
| 6
| 13
| 38
| 22
| 16
| null | null |
robx/puzzle-draw
|
tests/tests.hs
|
mit
|
test_plain_edge_grid :: Assertion
test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0), Just MBlack),
((0, 1), Just MWhite),
((1, 0), Just MWhite),
((1, 1), Just MBlack),
((2, 0), Nothing),
((2, 1), Just MBlack),
((3, 0), Nothing),
((3, 1), Just MWhite)
]
gc :: Grid.Grid C Int
gc =
Map.mapKeys fromCoord
. Map.fromList
$ [((0, 0), 1), ((1, 0), 2), ((2, 0), 3)]
es =
map
(\(E c d) -> E (fromCoord c) d)
[ E (0, 0) Horiz,
E (0, 1) Horiz,
E (1, 1) Horiz,
E (2, 1) Horiz,
E (0, 0) Vert,
E (1, 0) Vert
]
| 942
|
test_plain_edge_grid :: Assertion
test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0), Just MBlack),
((0, 1), Just MWhite),
((1, 0), Just MWhite),
((1, 1), Just MBlack),
((2, 0), Nothing),
((2, 1), Just MBlack),
((3, 0), Nothing),
((3, 1), Just MWhite)
]
gc :: Grid.Grid C Int
gc =
Map.mapKeys fromCoord
. Map.fromList
$ [((0, 0), 1), ((1, 0), 2), ((2, 0), 3)]
es =
map
(\(E c d) -> E (fromCoord c) d)
[ E (0, 0) Horiz,
E (0, 1) Horiz,
E (1, 1) Horiz,
E (2, 1) Horiz,
E (0, 0) Vert,
E (1, 0) Vert
]
| 942
|
test_plain_edge_grid = Right (gn, gc, sort es) @=? res'
where
res = parseEither parsePlainEdgeGrid edgeGrid_1
res' = fmap (\(x, y, e) -> (x, y, sort e)) res
gn :: Grid.Grid N (Maybe MasyuPearl)
gn =
Map.mapKeys fromCoord
. Map.fromList
$ [ ((0, 0), Just MBlack),
((0, 1), Just MWhite),
((1, 0), Just MWhite),
((1, 1), Just MBlack),
((2, 0), Nothing),
((2, 1), Just MBlack),
((3, 0), Nothing),
((3, 1), Just MWhite)
]
gc :: Grid.Grid C Int
gc =
Map.mapKeys fromCoord
. Map.fromList
$ [((0, 0), 1), ((1, 0), 2), ((2, 0), 3)]
es =
map
(\(E c d) -> E (fromCoord c) d)
[ E (0, 0) Horiz,
E (0, 1) Horiz,
E (1, 1) Horiz,
E (2, 1) Horiz,
E (0, 0) Vert,
E (1, 0) Vert
]
| 908
| false
| true
| 13
| 9
| 380
| 443
| 257
| 186
| null | null |
trxeste/wrk
|
haskell/myBlog/Application.hs
|
bsd-3-clause
|
-- | The @main@ function for an executable running this site.
appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 821
|
appMain :: IO ()
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 759
|
appMain = do
-- Get the settings from all relevant sources
settings <- loadAppSettingsArgs
-- fall back to compile-time values, set to [] to require values at runtime
[configSettingsYmlValue]
-- allow environment variables to override
useEnv
-- Generate the foundation from the settings
foundation <- makeFoundation settings
-- Generate a WAI Application from the foundation
app <- makeApplication foundation
-- Run the application with Warp
runSettings (warpSettings foundation) app
--------------------------------------------------------------
-- Functions for DevelMain.hs (a way to run the app from GHCi)
--------------------------------------------------------------
| 742
| true
| true
| 0
| 9
| 167
| 75
| 39
| 36
| null | null |
JPMoresmau/leksah
|
src/IDE/Metainfo/Provider.hs
|
gpl-2.0
|
searchInScope (Prefix False) l _ | T.null l = []
| 48
|
searchInScope (Prefix False) l _ | T.null l = []
| 48
|
searchInScope (Prefix False) l _ | T.null l = []
| 48
| false
| false
| 0
| 9
| 9
| 32
| 14
| 18
| null | null |
mstksg/neural
|
src/Data/Neural/HMatrix/Recurrent/Dropout.hs
|
mit
|
applyMask
:: KnownNet i hs o
=> NetMask i hs o
-> Network i hs o
-> Network i hs o
applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
NetOL (FLayer b' (w' <> mM))
NetIL (RLayer b' wI' wS' s') nn' ->
NetIL (RLayer b' (wI' <> mM) wS' s') nn'
in NetIL (RLayer (m * b) (mM <> wI) (mM <> wS <> mM) (m * s))
nnMasked
| 599
|
applyMask
:: KnownNet i hs o
=> NetMask i hs o
-> Network i hs o
-> Network i hs o
applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
NetOL (FLayer b' (w' <> mM))
NetIL (RLayer b' wI' wS' s') nn' ->
NetIL (RLayer b' (wI' <> mM) wS' s') nn'
in NetIL (RLayer (m * b) (mM <> wI) (mM <> wS <> mM) (m * s))
nnMasked
| 599
|
applyMask = \case
MaskOL -> id
MaskIL m nm -> \case
NetIL (RLayer b wI wS s) nn ->
let mM = diag m
nnMasked = case applyMask nm nn of
NetOL (FLayer b' w') ->
NetOL (FLayer b' (w' <> mM))
NetIL (RLayer b' wI' wS' s') nn' ->
NetIL (RLayer b' (wI' <> mM) wS' s') nn'
in NetIL (RLayer (m * b) (mM <> wI) (mM <> wS <> mM) (m * s))
nnMasked
| 500
| false
| true
| 0
| 22
| 279
| 259
| 125
| 134
| null | null |
minoki/LambdaQuest
|
src/LambdaQuest/SystemF/Eval.hs
|
bsd-3-clause
|
termSubst = termSubstD 0
| 24
|
termSubst = termSubstD 0
| 24
|
termSubst = termSubstD 0
| 24
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
nick-orton/euler
|
src/Euler/Numz.hs
|
gpl-3.0
|
-- |Fibinacci Series: <http://oeis.org/A000045>
fib :: [Integer] -> [Integer]
fib (y : z : xs) = y + z : fib (y + z : y : z : xs)
| 129
|
fib :: [Integer] -> [Integer]
fib (y : z : xs) = y + z : fib (y + z : y : z : xs)
| 81
|
fib (y : z : xs) = y + z : fib (y + z : y : z : xs)
| 51
| true
| true
| 0
| 11
| 29
| 70
| 36
| 34
| null | null |
FranklinChen/Hugs
|
dotnet/lib/Dotnet/System/Xml/XmlReader.hs
|
bsd-3-clause
|
readElementStringNameURI :: String -> String -> XmlReader a -> IO String
readElementStringNameURI str uri = invoke "ReadElementString" (str,uri)
| 144
|
readElementStringNameURI :: String -> String -> XmlReader a -> IO String
readElementStringNameURI str uri = invoke "ReadElementString" (str,uri)
| 144
|
readElementStringNameURI str uri = invoke "ReadElementString" (str,uri)
| 71
| false
| true
| 0
| 8
| 17
| 45
| 22
| 23
| null | null |
rvion/lamdu
|
Lamdu/Sugar/Names/Walk.hs
|
gpl-3.0
|
withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName
| 199
|
withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName
| 199
|
withBinderParams (VarParam fp) =
opWithParamName (isFunctionType (fp ^. fpAnnotation . aInferredType))
(fp ^. fpInfo . npiName)
<&> VarParam . \newName -> fp & fpInfo . npiName .~ newName
| 199
| false
| false
| 2
| 10
| 39
| 76
| 37
| 39
| null | null |
gridaphobe/liquid-fixpoint
|
src/Language/Fixpoint/Parse.hs
|
bsd-3-clause
|
funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP
| 55
|
funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP
| 55
|
funcSortP = parens $ FFunc <$> intP <* comma <*> sortsP
| 55
| false
| false
| 0
| 8
| 10
| 22
| 11
| 11
| null | null |
arnabgho/HLearn
|
src/HLearn/History.hs
|
bsd-3-clause
|
-- else P.head $ P.words $ show $ typeRep [a]
-- | Print the current iteration of the optimization.
infoItr :: DisplayInfo
infoItr r _ = "; "++show (numReports r)
| 167
|
infoItr :: DisplayInfo
infoItr r _ = "; "++show (numReports r)
| 62
|
infoItr r _ = "; "++show (numReports r)
| 39
| true
| true
| 0
| 8
| 34
| 31
| 16
| 15
| null | null |
clarkcb/xsearch
|
haskell/hssearch/test/HsSearch/FileTypesTest.hs
|
mit
|
getFileTypeTests :: IO [Test]
getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType binaryFile
codeFileType <- getFileType codeFile
textFileType <- getFileType textFile
xmlFileType <- getFileType xmlFile
unknownFileType <- getFileType unknownFile
return [ testCase "getFileType archive.zip == Archive" (archiveFileType @?= Archive)
, testCase "getFileType binary.exe == Binary" (binaryFileType @?= Binary)
, testCase "getFileType FileTypes.hs == Code" (codeFileType @?= Code)
, testCase "getFileType text.txt == Text" (textFileType @?= Text)
, testCase "getFileType markup.xml == Xml" (xmlFileType @?= Xml)
, testCase "getFileType unknown.xyz == Unknown" (unknownFileType @?= Unknown)
]
| 984
|
getFileTypeTests :: IO [Test]
getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType binaryFile
codeFileType <- getFileType codeFile
textFileType <- getFileType textFile
xmlFileType <- getFileType xmlFile
unknownFileType <- getFileType unknownFile
return [ testCase "getFileType archive.zip == Archive" (archiveFileType @?= Archive)
, testCase "getFileType binary.exe == Binary" (binaryFileType @?= Binary)
, testCase "getFileType FileTypes.hs == Code" (codeFileType @?= Code)
, testCase "getFileType text.txt == Text" (textFileType @?= Text)
, testCase "getFileType markup.xml == Xml" (xmlFileType @?= Xml)
, testCase "getFileType unknown.xyz == Unknown" (unknownFileType @?= Unknown)
]
| 984
|
getFileTypeTests = do
let archiveFile = "archive.zip"
let binaryFile = "binary.exe"
let codeFile = "FileTypes.hs"
let textFile = "text.txt"
let xmlFile = "markup.xml"
let unknownFile = "unknown.xyz"
archiveFileType <- getFileType archiveFile
binaryFileType <- getFileType binaryFile
codeFileType <- getFileType codeFile
textFileType <- getFileType textFile
xmlFileType <- getFileType xmlFile
unknownFileType <- getFileType unknownFile
return [ testCase "getFileType archive.zip == Archive" (archiveFileType @?= Archive)
, testCase "getFileType binary.exe == Binary" (binaryFileType @?= Binary)
, testCase "getFileType FileTypes.hs == Code" (codeFileType @?= Code)
, testCase "getFileType text.txt == Text" (textFileType @?= Text)
, testCase "getFileType markup.xml == Xml" (xmlFileType @?= Xml)
, testCase "getFileType unknown.xyz == Unknown" (unknownFileType @?= Unknown)
]
| 954
| false
| true
| 18
| 11
| 190
| 209
| 107
| 102
| null | null |
markus-git/co-feldspar
|
src/Feldspar/Software/Optimize.hs
|
bsd-3-clause
|
--
simplifyUp a = constFold a
| 30
|
simplifyUp a = constFold a
| 26
|
simplifyUp a = constFold a
| 26
| true
| false
| 0
| 5
| 6
| 13
| 6
| 7
| null | null |
sinelaw/infernu
|
src/Infernu/Parse.hs
|
gpl-2.0
|
fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr
| 230
|
fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr
| 230
|
fromExpression f (ES3.UnaryAssignExpr z op (ES3.LDot _ objExpr name)) = assignToProperty f z objExpr (EPropName name) (addConstant z op (EProp (src z) objExpr' (EPropName name))) Nothing
where objExpr' = fromExpression f objExpr
| 230
| false
| false
| 0
| 11
| 33
| 99
| 48
| 51
| null | null |
brendanhay/gogol
|
gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Jobs/Patch.hs
|
mpl-2.0
|
-- | Creates a value of 'ProjectsRegionsJobsPatch' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prjpXgafv'
--
-- * 'prjpJobId'
--
-- * 'prjpUploadProtocol'
--
-- * 'prjpUpdateMask'
--
-- * 'prjpAccessToken'
--
-- * 'prjpUploadType'
--
-- * 'prjpPayload'
--
-- * 'prjpRegion'
--
-- * 'prjpProjectId'
--
-- * 'prjpCallback'
projectsRegionsJobsPatch
:: Text -- ^ 'prjpJobId'
-> Job -- ^ 'prjpPayload'
-> Text -- ^ 'prjpRegion'
-> Text -- ^ 'prjpProjectId'
-> ProjectsRegionsJobsPatch
projectsRegionsJobsPatch pPrjpJobId_ pPrjpPayload_ pPrjpRegion_ pPrjpProjectId_ =
ProjectsRegionsJobsPatch'
{ _prjpXgafv = Nothing
, _prjpJobId = pPrjpJobId_
, _prjpUploadProtocol = Nothing
, _prjpUpdateMask = Nothing
, _prjpAccessToken = Nothing
, _prjpUploadType = Nothing
, _prjpPayload = pPrjpPayload_
, _prjpRegion = pPrjpRegion_
, _prjpProjectId = pPrjpProjectId_
, _prjpCallback = Nothing
}
| 1,033
|
projectsRegionsJobsPatch
:: Text -- ^ 'prjpJobId'
-> Job -- ^ 'prjpPayload'
-> Text -- ^ 'prjpRegion'
-> Text -- ^ 'prjpProjectId'
-> ProjectsRegionsJobsPatch
projectsRegionsJobsPatch pPrjpJobId_ pPrjpPayload_ pPrjpRegion_ pPrjpProjectId_ =
ProjectsRegionsJobsPatch'
{ _prjpXgafv = Nothing
, _prjpJobId = pPrjpJobId_
, _prjpUploadProtocol = Nothing
, _prjpUpdateMask = Nothing
, _prjpAccessToken = Nothing
, _prjpUploadType = Nothing
, _prjpPayload = pPrjpPayload_
, _prjpRegion = pPrjpRegion_
, _prjpProjectId = pPrjpProjectId_
, _prjpCallback = Nothing
}
| 622
|
projectsRegionsJobsPatch pPrjpJobId_ pPrjpPayload_ pPrjpRegion_ pPrjpProjectId_ =
ProjectsRegionsJobsPatch'
{ _prjpXgafv = Nothing
, _prjpJobId = pPrjpJobId_
, _prjpUploadProtocol = Nothing
, _prjpUpdateMask = Nothing
, _prjpAccessToken = Nothing
, _prjpUploadType = Nothing
, _prjpPayload = pPrjpPayload_
, _prjpRegion = pPrjpRegion_
, _prjpProjectId = pPrjpProjectId_
, _prjpCallback = Nothing
}
| 443
| true
| true
| 0
| 10
| 206
| 134
| 88
| 46
| null | null |
deontologician/orbRPG
|
Game/OrbRPG/Combinations.hs
|
gpl-3.0
|
E Erbium @>> L Mu = L Lambda
| 28
|
E Erbium @>> L Mu = L Lambda
| 28
|
E Erbium @>> L Mu = L Lambda
| 28
| false
| false
| 0
| 6
| 7
| 21
| 8
| 13
| null | null |
nh2/darcs-fastconvert
|
Export.hs
|
bsd-3-clause
|
dumpFiles :: [AnchoredPath] -> ExportM ()
dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "data " ++ show (BL.length bits)
, bits ]
when isdir $ do tt <- lift $ gets tree -- ick
let subs = [ file `appendPath` n | (n, _) <-
listImmediate $ fromJust $ findTree tt file ]
dumpFiles subs
when (not isfile && not isdir) $ do
doPrint <- asks printer
doPrint . BLU.fromString $ "D " ++ anchorPath "" file
| 719
|
dumpFiles :: [AnchoredPath] -> ExportM ()
dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "data " ++ show (BL.length bits)
, bits ]
when isdir $ do tt <- lift $ gets tree -- ick
let subs = [ file `appendPath` n | (n, _) <-
listImmediate $ fromJust $ findTree tt file ]
dumpFiles subs
when (not isfile && not isdir) $ do
doPrint <- asks printer
doPrint . BLU.fromString $ "D " ++ anchorPath "" file
| 719
|
dumpFiles files = forM_ files $ \file -> do
isfile <- lift $ fileExists file
isdir <- lift $ directoryExists file
when isfile $ do
bits <- lift $ readFile file
dumpBits [ BLU.fromString $ "M 100644 inline " ++ anchorPath "" file
, BLU.fromString $ "data " ++ show (BL.length bits)
, bits ]
when isdir $ do tt <- lift $ gets tree -- ick
let subs = [ file `appendPath` n | (n, _) <-
listImmediate $ fromJust $ findTree tt file ]
dumpFiles subs
when (not isfile && not isdir) $ do
doPrint <- asks printer
doPrint . BLU.fromString $ "D " ++ anchorPath "" file
| 677
| false
| true
| 0
| 19
| 237
| 277
| 128
| 149
| null | null |
elieux/ghc
|
libraries/base/Data/OldList.hs
|
bsd-3-clause
|
-- | Sort a list by comparing the results of a key function applied to each
-- element. @sortOn f@ is equivalent to @sortBy (comparing f)@, but has the
-- performance advantage of only evaluating @f@ once for each element in the
-- input list. This is called the decorate-sort-undecorate paradigm, or
-- Schwartzian transform.
--
-- @since 4.8.0.0
sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn f =
map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
| 481
|
sortOn :: Ord b => (a -> b) -> [a] -> [a]
sortOn f =
map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
| 131
|
sortOn f =
map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
| 89
| true
| true
| 0
| 13
| 97
| 106
| 58
| 48
| null | null |
HJvT/hdirect
|
src/Parser.hs
|
bsd-3-clause
|
happyReduction_229 _ _ _ = notHappyAtAll
| 41
|
happyReduction_229 _ _ _ = notHappyAtAll
| 41
|
happyReduction_229 _ _ _ = notHappyAtAll
| 41
| false
| false
| 0
| 5
| 6
| 13
| 6
| 7
| null | null |
junjihashimoto/hsverilog
|
src/HsVerilog/Verilog/Internal.hs
|
bsd-3-clause
|
instOutputPort :: T.Text -> Circuit -> [(Signal,Signal)]
instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op
| 172
|
instOutputPort :: T.Text -> Circuit -> [(Signal,Signal)]
instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op
| 172
|
instOutputPort name cir =
let op = coutput cir
ren v = (v,v{sname=name <> "_" <> sname v})
in map ren op
| 115
| false
| true
| 0
| 13
| 39
| 87
| 45
| 42
| null | null |
andorp/bead
|
src/Bead/Domain/Relationships.hs
|
bsd-3-clause
|
submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
]
| 103
|
submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
]
| 103
|
submissionTableInfoPermissions = ObjectPermissions [
(P_Open, P_Course), (P_Open, P_Assignment)
]
| 103
| false
| false
| 0
| 7
| 14
| 27
| 16
| 11
| null | null |
Thhethssmuz/ppp
|
src/Writer.hs
|
mit
|
writer :: WriterOptions
writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
}
| 269
|
writer :: WriterOptions
writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
}
| 269
|
writer = def
{ writerTemplate = fmap (BS.unpack . BS.fromStrict)
. lookup "template.tex" $ emb
, writerHighlightStyle = Just tango
, writerVariables = [ ("ppp-version", showVersion version) ]
}
| 245
| false
| true
| 0
| 13
| 83
| 81
| 41
| 40
| null | null |
glutamate/probably-baysig
|
src/Math/Probably/Sampler.hs
|
bsd-3-clause
|
normal :: Double -> Double -> Prob Double
normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean)
| 122
|
normal :: Double -> Double -> Prob Double
normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean)
| 122
|
normal mean variance = do
u <- unormal
return (u * (sqrt variance) + mean)
| 80
| false
| true
| 0
| 12
| 28
| 57
| 27
| 30
| null | null |
bartoszw/yelca
|
Handler/Util.hs
|
gpl-2.0
|
simpleLoanHash :: Loan -> Text
simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan)
| 289
|
simpleLoanHash :: Loan -> Text
simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan)
| 289
|
simpleLoanHash loan = (pack $ show $ loanS loan) <>
" P" <> (pack $ show $ principalS loan) <>
" D" <> (pack $ show $ durationS loan) <>
" R" <> (pack $ showWithLenDec 6 2 $ 100 * rateS loan)
| 258
| false
| true
| 0
| 13
| 114
| 107
| 53
| 54
| null | null |
tjakway/ghcjvm
|
compiler/utils/Bag.hs
|
bsd-3-clause
|
foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1
| 65
|
foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1
| 65
|
foldBag t u e (TwoBags b1 b2) = foldBag t u (foldBag t u e b2) b1
| 65
| false
| false
| 0
| 7
| 16
| 44
| 21
| 23
| null | null |
dterei/Scraps
|
haskell/prettyGenerics/D1.hs
|
bsd-3-clause
|
comma :: Doc
comma = DocStr (Chr ',')
| 37
|
comma :: Doc
comma = DocStr (Chr ',')
| 37
|
comma = DocStr (Chr ',')
| 24
| false
| true
| 0
| 7
| 7
| 20
| 10
| 10
| null | null |
SKA-ScienceDataProcessor/RC
|
MS5/dna/flow/Flow/Halide.hs
|
apache-2.0
|
halideRepr :: dim -> HalideRepr dim val abs
halideRepr = HalideRepr ReadAccess
| 78
|
halideRepr :: dim -> HalideRepr dim val abs
halideRepr = HalideRepr ReadAccess
| 78
|
halideRepr = HalideRepr ReadAccess
| 34
| false
| true
| 0
| 7
| 11
| 30
| 13
| 17
| null | null |
bgwines/horse-control
|
src/Horse/Utils.hs
|
bsd-3-clause
|
fromEitherMaybeDefault (Left _) (Just y) = y
| 45
|
fromEitherMaybeDefault (Left _) (Just y) = y
| 45
|
fromEitherMaybeDefault (Left _) (Just y) = y
| 45
| false
| false
| 1
| 6
| 7
| 26
| 11
| 15
| null | null |
wehu/hw
|
src/Utils.hs
|
apache-2.0
|
currentFile :: Q Exp
currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc)
| 104
|
currentFile :: Q Exp
currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc)
| 104
|
currentFile = do
loc <- location
return $ LitE (StringL $ loc_filename loc)
| 83
| false
| true
| 0
| 12
| 24
| 47
| 20
| 27
| null | null |
ambiata/highlighting-kate
|
Text/Highlighting/Kate/Syntax/Relaxng.hs
|
gpl-2.0
|
pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","normalText") -> return ()
("RELAX NG","detectEntRef") -> return ()
("RELAX NG","tagname") -> return ()
("RELAX NG","attributes") -> return ()
("RELAX NG","attrValue") -> return ()
("RELAX NG","string") -> return ()
("RELAX NG","comment") -> return ()
_ -> return ()
else return ()
| 641
|
pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","normalText") -> return ()
("RELAX NG","detectEntRef") -> return ()
("RELAX NG","tagname") -> return ()
("RELAX NG","attributes") -> return ()
("RELAX NG","attrValue") -> return ()
("RELAX NG","string") -> return ()
("RELAX NG","comment") -> return ()
_ -> return ()
else return ()
| 641
|
pEndLine = do
updateState $ \st -> st{ synStPrevNonspace = False }
context <- currentContext
contexts <- synStContexts `fmap` getState
st <- getState
if length contexts >= 2
then case context of
_ | synStContinuation st -> updateState $ \st -> st{ synStContinuation = False }
("RELAX NG","normalText") -> return ()
("RELAX NG","detectEntRef") -> return ()
("RELAX NG","tagname") -> return ()
("RELAX NG","attributes") -> return ()
("RELAX NG","attrValue") -> return ()
("RELAX NG","string") -> return ()
("RELAX NG","comment") -> return ()
_ -> return ()
else return ()
| 641
| false
| false
| 0
| 15
| 159
| 242
| 124
| 118
| null | null |
NICTA/radian
|
test/hunit_tests.hs
|
bsd-3-clause
|
tests :: Test
tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
]
| 149
|
tests :: Test
tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
]
| 149
|
tests =
TestList $ fmap TestCase [
t180
, t90
, t359
, t360
, t3600
, t1
, tneg180
, f0
, f1
, fneg1
, f3
]
| 135
| false
| true
| 0
| 7
| 59
| 53
| 32
| 21
| null | null |
pikajude/kevin
|
src/Kevin/IRC/Packet.hs
|
gpl-3.0
|
colonParam :: Parser T.Text
colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa")
| 87
|
colonParam :: Parser T.Text
colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa")
| 87
|
colonParam = char ':' *> takeWhile (notInClass "\x0\xd\xa")
| 59
| false
| true
| 0
| 8
| 11
| 37
| 16
| 21
| null | null |
HairyDude/heal
|
EveApi/Types.hs
|
bsd-2-clause
|
subsystemSlot SubsystemSlot6 = Just 6
| 37
|
subsystemSlot SubsystemSlot6 = Just 6
| 37
|
subsystemSlot SubsystemSlot6 = Just 6
| 37
| false
| false
| 1
| 5
| 4
| 16
| 5
| 11
| null | null |
haskellbr/missingh
|
missingh-all/src/Network/Utils.hs
|
mit
|
showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x
| 63
|
showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x
| 63
|
showSockAddr (SockAddrUnix x) = return $ "UNIX socket at " ++ x
| 63
| false
| false
| 0
| 6
| 11
| 24
| 11
| 13
| null | null |
cshung/MiscLab
|
Haskell99/q36.hs
|
mit
|
primeFactorsMult :: Int -> [(Int, Int)]
primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message
| 200
|
primeFactorsMult :: Int -> [(Int, Int)]
primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message
| 200
|
primeFactorsMult x = case (tryPrimeFactorsMult x) of Left result -> result
Right message -> error message
| 160
| false
| true
| 0
| 8
| 76
| 58
| 29
| 29
| null | null |
silkapp/heist
|
src/Heist/Interpreted/Internal.hs
|
bsd-3-clause
|
------------------------------------------------------------------------------
-- | Like runChildrenWith but using literal text rather than dynamic splices.
runChildrenWithText :: (Monad n) => [(Text, Text)] -> Splice n
runChildrenWithText = runChildrenWithTrans textSplice
| 273
|
runChildrenWithText :: (Monad n) => [(Text, Text)] -> Splice n
runChildrenWithText = runChildrenWithTrans textSplice
| 116
|
runChildrenWithText = runChildrenWithTrans textSplice
| 53
| true
| true
| 0
| 8
| 26
| 41
| 23
| 18
| null | null |
HIPERFIT/futhark
|
src/Futhark/IR/Traversals.hs
|
isc
|
walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size
| 116
|
walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size
| 116
|
walkExpM tv (BasicOp (Concat _ x ys size)) =
walkOnVName tv x >> mapM_ (walkOnVName tv) ys >> walkOnSubExp tv size
| 116
| false
| false
| 0
| 9
| 22
| 58
| 27
| 31
| null | null |
msullivan/advent-of-code
|
2018/A21a.hs
|
mit
|
eval_instr' Iban = (.&.)
| 24
|
eval_instr' Iban = (.&.)
| 24
|
eval_instr' Iban = (.&.)
| 24
| false
| false
| 1
| 5
| 3
| 15
| 6
| 9
| null | null |
ghcjs/ghcjs
|
src/Gen2/Prim.hs
|
mit
|
genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y)
| 77
|
genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y)
| 77
|
genPrim _ _ Word16EqOp [r] [x,y] = PrimInline $ r |= if10 (x .===. y)
| 77
| false
| false
| 0
| 8
| 22
| 44
| 23
| 21
| null | null |
meiersi/scyther-proof
|
src/Scyther/Theory/Html.hs
|
gpl-3.0
|
insertExplanation :: String -> HtmlMarkup Int
insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref
| 317
|
insertExplanation :: String -> HtmlMarkup Int
insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref
| 317
|
insertExplanation e = do
expls <- gets htmlExpls
case M.lookup e expls of
Just ref -> return ref
Nothing -> do
st <- get
let ref = htmlNextExplRef st
put $ st { htmlNextExplRef = succ ref, htmlExpls = M.insert e ref expls }
return ref
| 271
| false
| true
| 0
| 16
| 88
| 121
| 55
| 66
| null | null |
gbaz/cabal
|
cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs
|
bsd-3-clause
|
merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss))
| 78
|
merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss))
| 78
|
merge (Constrained rs) (Constrained ss) = Right (Constrained (rs ++ ss))
| 78
| false
| false
| 1
| 9
| 16
| 41
| 19
| 22
| null | null |
li-zhirui/EoplLangs
|
src/SimpleModule/Evaluator.hs
|
bsd-3-clause
|
unaryOps :: [(UnaryOp, ExpressedValue -> EvaluateResult)]
unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (second n2bTrans) unaryNumToBoolOpMap
b2bTrans = unaryOpConverter unpackBool ExprBool
unaryBool2Bool = fmap (second b2bTrans) unaryBoolOpMap
| 465
|
unaryOps :: [(UnaryOp, ExpressedValue -> EvaluateResult)]
unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (second n2bTrans) unaryNumToBoolOpMap
b2bTrans = unaryOpConverter unpackBool ExprBool
unaryBool2Bool = fmap (second b2bTrans) unaryBoolOpMap
| 465
|
unaryOps = concat [unaryNum2Num, unaryNum2Bool, unaryBool2Bool]
where
n2nTrans = unaryOpConverter unpackNum ExprNum
unaryNum2Num = fmap (second n2nTrans) unaryNumToNumOpMap
n2bTrans = unaryOpConverter unpackNum ExprBool
unaryNum2Bool = fmap (second n2bTrans) unaryNumToBoolOpMap
b2bTrans = unaryOpConverter unpackBool ExprBool
unaryBool2Bool = fmap (second b2bTrans) unaryBoolOpMap
| 407
| false
| true
| 5
| 7
| 71
| 117
| 61
| 56
| null | null |
cullina/Extractor
|
src/Matrix.hs
|
bsd-3-clause
|
lookupBB (_,_,c,_) (True, False) = c
| 37
|
lookupBB (_,_,c,_) (True, False) = c
| 37
|
lookupBB (_,_,c,_) (True, False) = c
| 37
| false
| false
| 0
| 6
| 6
| 29
| 17
| 12
| null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/StorageEvent.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/StorageEvent.storageArea Mozilla StorageEvent.storageArea documentation>
getStorageArea :: (MonadDOM m) => StorageEvent -> m (Maybe Storage)
getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal)
| 271
|
getStorageArea :: (MonadDOM m) => StorageEvent -> m (Maybe Storage)
getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal)
| 142
|
getStorageArea self
= liftDOM ((self ^. js "storageArea") >>= fromJSVal)
| 74
| true
| true
| 0
| 10
| 28
| 62
| 30
| 32
| null | null |
koengit/zeldspar
|
src/Zeldspar/Parallel.hs
|
bsd-3-clause
|
foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f
| 88
|
foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f
| 88
|
foldParZ chs acc (ConnP s a b) f = foldParZ s acc a f >>= \acc' -> foldParZ chs acc' b f
| 88
| false
| false
| 0
| 7
| 21
| 52
| 25
| 27
| null | null |
fpco/fay
|
tests/RecDecl.hs
|
bsd-3-clause
|
-- Record updates
r1' = r1{ i = 10 }
| 36
|
r1' = r1{ i = 10 }
| 18
|
r1' = r1{ i = 10 }
| 18
| true
| false
| 1
| 7
| 9
| 23
| 10
| 13
| null | null |
bitemyapp/lets-lens
|
src/Lets/GetSetLens.hs
|
bsd-3-clause
|
-- |
--
-- >>> setStreet fred "Some Other St"
-- Person 24 "Fred" (Address "Some Other St" "Fredville" (Locality "Fredmania" "New South Fred" "Fredalia"))
--
-- >>> setStreet mary "Some Other St"
-- Person 28 "Mary" (Address "Some Other St" "Maryland" (Locality "Mary Mary" "Western Mary" "Maristan"))
setStreet ::
Person
-> String
-> Person
setStreet =
error "todo: setStreet"
| 385
|
setStreet ::
Person
-> String
-> Person
setStreet =
error "todo: setStreet"
| 83
|
setStreet =
error "todo: setStreet"
| 37
| true
| true
| 0
| 8
| 67
| 36
| 19
| 17
| null | null |
ezyang/ghc
|
compiler/nativeGen/PPC/Ppr.hs
|
bsd-3-clause
|
pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique blockid)
neg_prediction = case prediction of
Nothing -> empty
Just True -> char '-'
Just False -> char '+'
| 471
|
pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique blockid)
neg_prediction = case prediction of
Nothing -> empty
Just True -> char '-'
Just False -> char '+'
| 471
|
pprInstr (BCCFAR cond blockid prediction) = vcat [
hcat [
text "\tb",
pprCond (condNegate cond),
neg_prediction,
text "\t$+8"
],
hcat [
text "\tb\t",
ppr lbl
]
]
where lbl = mkLocalBlockLabel (getUnique blockid)
neg_prediction = case prediction of
Nothing -> empty
Just True -> char '-'
Just False -> char '+'
| 471
| false
| false
| 1
| 11
| 212
| 130
| 62
| 68
| null | null |
alpha22jp/simplenote.hs
|
Simplenote.hs
|
mit
|
posixTimeToStr :: POSIXTime -> String
posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime
| 114
|
posixTimeToStr :: POSIXTime -> String
posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime
| 114
|
posixTimeToStr = formatTime defaultTimeLocale "%s%Q" . posixSecondsToUTCTime
| 76
| false
| true
| 0
| 6
| 11
| 24
| 12
| 12
| null | null |
thalerjonathan/phd
|
coding/learning/haskell/grahambook/Code_Solutions/countdown.hs
|
gpl-3.0
|
perms (x:xs) = concat (map (interleave x) (perms xs))
| 53
|
perms (x:xs) = concat (map (interleave x) (perms xs))
| 53
|
perms (x:xs) = concat (map (interleave x) (perms xs))
| 53
| false
| false
| 0
| 9
| 8
| 39
| 19
| 20
| null | null |
wavewave/madgraph-auto-dataset
|
src/HEP/Automation/MadGraph/Dataset/Set20110516set2.hs
|
gpl-3.0
|
sets :: [Int]
sets = [1,2..80]
| 30
|
sets :: [Int]
sets = [1,2..80]
| 30
|
sets = [1,2..80]
| 16
| false
| true
| 0
| 7
| 5
| 29
| 14
| 15
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/SimplCore/OccurAnal.hs
|
bsd-3-clause
|
{-
Note [Use one-shot information]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The occurrrence analyser propagates one-shot-lambda information in two situation
* Applications: eg build (\cn -> blah)
Propagate one-shot info from the strictness signature of 'build' to
the \cn
* Let-bindings: eg let f = \c. let ... in \n -> blah
in (build f, build f)
Propagate one-shot info from the demanand-info on 'f' to the
lambdas in its RHS (which may not be syntactically at the top)
Some of this is done by the demand analyser, but this way it happens
much earlier, taking advantage of the strictness signature of
imported functions.
Note [Binders in case alternatives]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
case x of y { (a,b) -> f y }
We treat 'a', 'b' as dead, because they don't physically occur in the
case alternative. (Indeed, a variable is dead iff it doesn't occur in
its scope in the output of OccAnal.) It really helps to know when
binders are unused. See esp the call to isDeadBinder in
Simplify.mkDupableAlt
In this example, though, the Simplifier will bring 'a' and 'b' back to
life, beause it binds 'y' to (a,b) (imagine got inlined and
scrutinised y).
-}
occAnalAlt :: (OccEnv, Maybe (Id, CoreExpr))
-> CoreAlt
-> (UsageDetails, Alt IdWithOccInfo)
occAnalAlt (env, scrut_bind) (con, bndrs, rhs)
= case occAnal env rhs of { (rhs_usage1, rhs1) ->
let
(alt_usg, tagged_bndrs) = tagLamBinders rhs_usage1 bndrs
-- See Note [Binders in case alternatives]
(alt_usg', rhs2) =
wrapAltRHS env scrut_bind alt_usg tagged_bndrs rhs1
in
(alt_usg', (con, tagged_bndrs, rhs2)) }
| 1,722
|
occAnalAlt :: (OccEnv, Maybe (Id, CoreExpr))
-> CoreAlt
-> (UsageDetails, Alt IdWithOccInfo)
occAnalAlt (env, scrut_bind) (con, bndrs, rhs)
= case occAnal env rhs of { (rhs_usage1, rhs1) ->
let
(alt_usg, tagged_bndrs) = tagLamBinders rhs_usage1 bndrs
-- See Note [Binders in case alternatives]
(alt_usg', rhs2) =
wrapAltRHS env scrut_bind alt_usg tagged_bndrs rhs1
in
(alt_usg', (con, tagged_bndrs, rhs2)) }
| 503
|
occAnalAlt (env, scrut_bind) (con, bndrs, rhs)
= case occAnal env rhs of { (rhs_usage1, rhs1) ->
let
(alt_usg, tagged_bndrs) = tagLamBinders rhs_usage1 bndrs
-- See Note [Binders in case alternatives]
(alt_usg', rhs2) =
wrapAltRHS env scrut_bind alt_usg tagged_bndrs rhs1
in
(alt_usg', (con, tagged_bndrs, rhs2)) }
| 388
| true
| true
| 0
| 12
| 406
| 149
| 84
| 65
| null | null |
jean-edouard/manager
|
updatemgr/UpdateMgr/UpdateReqHandler.hs
|
gpl-2.0
|
handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p)
| 205
|
handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p)
| 205
|
handleUpdateReq (NotifyUpdateDownloadProgress p) = eitherErr . liftRpc $
notifyComCitrixXenclientUpdatemgrUpdateDownloadProgress updatemgrObjectPath (realToFrac $ dlComplete p) (realToFrac $ dlSpeed p)
| 205
| false
| false
| 0
| 9
| 21
| 50
| 24
| 26
| null | null |
brownsys/nettle-openflow
|
src/Nettle/Ethernet/AddressResolutionProtocol.hs
|
bsd-3-clause
|
ipProtocolType = 0x0800
| 38
|
ipProtocolType = 0x0800
| 38
|
ipProtocolType = 0x0800
| 38
| false
| false
| 0
| 4
| 17
| 6
| 3
| 3
| null | null |
keithodulaigh/Hets
|
HasCASL/Sublogic.hs
|
gpl-2.0
|
sl_typeItem :: TypeItem -> Sublogic
sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ need_sub
, sl_typePattern tp
, sl_type t
, sl_term $ item term ]
AliasType tp (Just k) ts _ -> comp_list
[ sl_kind k
, sl_typePattern tp
, sl_typeScheme ts ]
AliasType tp Nothing ts _ ->
sublogic_max (sl_typePattern tp) $ sl_typeScheme ts
Datatype dDecl -> sl_datatypeDecl dDecl
| 666
|
sl_typeItem :: TypeItem -> Sublogic
sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ need_sub
, sl_typePattern tp
, sl_type t
, sl_term $ item term ]
AliasType tp (Just k) ts _ -> comp_list
[ sl_kind k
, sl_typePattern tp
, sl_typeScheme ts ]
AliasType tp Nothing ts _ ->
sublogic_max (sl_typePattern tp) $ sl_typeScheme ts
Datatype dDecl -> sl_datatypeDecl dDecl
| 666
|
sl_typeItem tyIt = case tyIt of
TypeDecl l k _ -> comp_list $ sl_kind k : map sl_typePattern l
SubtypeDecl l _ _ -> comp_list $ need_sub : map sl_typePattern l
IsoDecl l _ -> comp_list $ need_sub : map sl_typePattern l
SubtypeDefn tp _ t term _ -> comp_list
[ need_sub
, sl_typePattern tp
, sl_type t
, sl_term $ item term ]
AliasType tp (Just k) ts _ -> comp_list
[ sl_kind k
, sl_typePattern tp
, sl_typeScheme ts ]
AliasType tp Nothing ts _ ->
sublogic_max (sl_typePattern tp) $ sl_typeScheme ts
Datatype dDecl -> sl_datatypeDecl dDecl
| 630
| false
| true
| 14
| 8
| 195
| 163
| 86
| 77
| null | null |
futtetennista/IntroductionToFunctionalProgramming
|
PiH/src/Exercises.hs
|
mit
|
alabel (Bin l r) =
Bin <$> alabel l <*> alabel r
| 50
|
alabel (Bin l r) =
Bin <$> alabel l <*> alabel r
| 50
|
alabel (Bin l r) =
Bin <$> alabel l <*> alabel r
| 50
| false
| false
| 0
| 7
| 13
| 31
| 14
| 17
| null | null |
hpacheco/HAAP
|
examples/minimalistic/MMDraw.hs
|
mit
|
componentsToArrow (0,y) | y < 0 = (y,90)
| 40
|
componentsToArrow (0,y) | y < 0 = (y,90)
| 40
|
componentsToArrow (0,y) | y < 0 = (y,90)
| 40
| false
| false
| 0
| 8
| 7
| 31
| 16
| 15
| null | null |
Mathnerd314/lamdu
|
bottlelib/Graphics/UI/Bottle/EventMap.hs
|
gpl-3.0
|
keyEventMap :: KeyEvent -> Doc -> a -> EventMap a
keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
}
| 163
|
keyEventMap :: KeyEvent -> Doc -> a -> EventMap a
keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
}
| 163
|
keyEventMap eventType doc handler =
mempty
{ _emKeyMap = Map.singleton eventType $ DocHandler doc handler
}
| 113
| false
| true
| 0
| 10
| 31
| 63
| 29
| 34
| null | null |
cspollard/bcalib
|
src/BCalib/JF.hs
|
bsd-3-clause
|
readJFs :: MonadIO m => TR m (ZipList JFInfo)
readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFitter_N2Tpair"
llr <- readD "jetsJetFitter_loglikelihoodratio"
pu <- readD "jetsJetFitter_pu"
pc <- readD "jetsJetFitter_pc"
pb <- readD "jetsJetFitter_pb"
return $ JFInfo
<$> nvtx
<*> mass
<*> nsts
<*> ntsav
<*> efrac
<*> n2tpair
<*> llr
<*> pu
<*> pc
<*> pb
where
readD n = fmap float2Double <$> readBranch n
readI n = fmap (fromEnum :: CInt -> Int) <$> readBranch n
-- TODO
-- can't get TH working with external libs (e.g. root)
| 813
|
readJFs :: MonadIO m => TR m (ZipList JFInfo)
readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFitter_N2Tpair"
llr <- readD "jetsJetFitter_loglikelihoodratio"
pu <- readD "jetsJetFitter_pu"
pc <- readD "jetsJetFitter_pc"
pb <- readD "jetsJetFitter_pb"
return $ JFInfo
<$> nvtx
<*> mass
<*> nsts
<*> ntsav
<*> efrac
<*> n2tpair
<*> llr
<*> pu
<*> pc
<*> pb
where
readD n = fmap float2Double <$> readBranch n
readI n = fmap (fromEnum :: CInt -> Int) <$> readBranch n
-- TODO
-- can't get TH working with external libs (e.g. root)
| 813
|
readJFs = do
nvtx <- readI "jetsJetFitter_nVTX"
mass <- fmap (/ 1e3) <$> readD "jetsJetFitter_mass"
nsts <- readI "jetsJetFitter_nSingleTracks"
ntsav <- readI "jetsJetFitter_nTracksAtVtx"
efrac <- readD "jetsJetFitter_energyFraction"
n2tpair <- readI "jetsJetFitter_N2Tpair"
llr <- readD "jetsJetFitter_loglikelihoodratio"
pu <- readD "jetsJetFitter_pu"
pc <- readD "jetsJetFitter_pc"
pb <- readD "jetsJetFitter_pb"
return $ JFInfo
<$> nvtx
<*> mass
<*> nsts
<*> ntsav
<*> efrac
<*> n2tpair
<*> llr
<*> pu
<*> pc
<*> pb
where
readD n = fmap float2Double <$> readBranch n
readI n = fmap (fromEnum :: CInt -> Int) <$> readBranch n
-- TODO
-- can't get TH working with external libs (e.g. root)
| 767
| false
| true
| 2
| 17
| 187
| 249
| 109
| 140
| null | null |
quickdudley/varroa
|
Reinforcement.hs
|
agpl-3.0
|
actorSolidarity _ = 0
| 21
|
actorSolidarity _ = 0
| 21
|
actorSolidarity _ = 0
| 21
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
vito/atomo-old
|
Atomo/Parser.hs
|
mit
|
aImport :: Parser AtomoVal
aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")
return $ AImport from targets
<?> "import"
| 386
|
aImport :: Parser AtomoVal
aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")
return $ AImport from targets
<?> "import"
| 386
|
aImport = do reserved "import"
from <- option "" (symbol "from" >> aModule)
colon
whiteSpace
targets <- case from of
"" -> commaSep1 aModule
_ -> commaSep1 (aReference <|> symbol "*")
return $ AImport from targets
<?> "import"
| 359
| false
| true
| 3
| 14
| 174
| 108
| 46
| 62
| null | null |
jmacmahon/syllabify
|
Linguisticks/Statistics/Processing.hs
|
agpl-3.0
|
-- Several passes, but premature optimisation is the root of all evil
consonantLength = fromIntegral . length . filter (`elem` consonants)
| 138
|
consonantLength = fromIntegral . length . filter (`elem` consonants)
| 68
|
consonantLength = fromIntegral . length . filter (`elem` consonants)
| 68
| true
| false
| 1
| 7
| 20
| 27
| 14
| 13
| null | null |
blanu/juicer
|
puree.hs
|
gpl-2.0
|
main :: IO ()
main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p
| 234
|
main :: IO ()
main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p
| 234
|
main = do
maybeFeed <- thaw
case maybeFeed of
Nothing -> return ()
Just (Feed _ posts) -> do
let post@(Post title desc) = posts !! 0
printTags desc
let p = parse desc
putStrLn $ show p
| 220
| false
| true
| 1
| 19
| 77
| 116
| 50
| 66
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.