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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Xandaros/MinecraftCLI | app/Commands.hs | bsd-2-clause | placeBlockCommandE :: forall t. Reflex t => Event t ChatCommand -> Event t SBPacket
placeBlockCommandE cmd = fforMaybe (filterCommand "placeBlock" cmd) $ \c ->
let args = c ^. arguments
getArg n = read $ T.unpack (args !! n)
x = getArg 0
y = getArg 1
z = getArg 2
pos = Position x y z
in if | length args == 3 -> Just $ SBPlayerBlockPlacement (SBPlayerBlockPlacementPayload pos 1 0 0 0 0)
| otherwise -> Nothing | 469 | placeBlockCommandE :: forall t. Reflex t => Event t ChatCommand -> Event t SBPacket
placeBlockCommandE cmd = fforMaybe (filterCommand "placeBlock" cmd) $ \c ->
let args = c ^. arguments
getArg n = read $ T.unpack (args !! n)
x = getArg 0
y = getArg 1
z = getArg 2
pos = Position x y z
in if | length args == 3 -> Just $ SBPlayerBlockPlacement (SBPlayerBlockPlacementPayload pos 1 0 0 0 0)
| otherwise -> Nothing | 469 | placeBlockCommandE cmd = fforMaybe (filterCommand "placeBlock" cmd) $ \c ->
let args = c ^. arguments
getArg n = read $ T.unpack (args !! n)
x = getArg 0
y = getArg 1
z = getArg 2
pos = Position x y z
in if | length args == 3 -> Just $ SBPlayerBlockPlacement (SBPlayerBlockPlacementPayload pos 1 0 0 0 0)
| otherwise -> Nothing | 385 | false | true | 0 | 14 | 136 | 183 | 88 | 95 | null | null |
ingemaradahl/bilder | src/TypeChecker/TCM/Utils.hs | lgpl-3.0 | setAssigned β· String β TCM ()
setAssigned s = setCIdentAssigned (CIdent ((0,0),s)) | 82 | setAssigned β· String β TCM ()
setAssigned s = setCIdentAssigned (CIdent ((0,0),s)) | 82 | setAssigned s = setCIdentAssigned (CIdent ((0,0),s)) | 52 | false | true | 0 | 9 | 11 | 48 | 24 | 24 | null | null |
timjs/spl-compiler | src/Language/SPL/Lexer.hs | bsd-3-clause | basicNames = [ "if", "else", "while", "return"
, "True", "False"
, "Void", "Int", "Bool"
, "print", "isEmpty", "head", "tail", "fst", "snd", "main"
] | 211 | basicNames = [ "if", "else", "while", "return"
, "True", "False"
, "Void", "Int", "Bool"
, "print", "isEmpty", "head", "tail", "fst", "snd", "main"
] | 211 | basicNames = [ "if", "else", "while", "return"
, "True", "False"
, "Void", "Int", "Bool"
, "print", "isEmpty", "head", "tail", "fst", "snd", "main"
] | 211 | false | false | 0 | 5 | 84 | 54 | 35 | 19 | null | null |
Mokosha/HsTetrisAttack | TetrisAttack/Board/Gravity.hs | mit | gravity m _ = GridUpdater $ \tile -> ((tile, Nothing), gravity m tile) | 70 | gravity m _ = GridUpdater $ \tile -> ((tile, Nothing), gravity m tile) | 70 | gravity m _ = GridUpdater $ \tile -> ((tile, Nothing), gravity m tile) | 70 | false | false | 0 | 8 | 12 | 37 | 20 | 17 | null | null |
miguelpagano/equ | TestSuite/Tests/Matching.hs | gpl-3.0 | testMatch :: PreExpr -> PreExpr -> Either (MatchMErr,Log) ExprSubst -> Assertion
testMatch pe pe' mpe = let m = match pe pe'
in unless (m == mpe) $
assertFailure $
"\n Resultado esperado: " ++ show mpe ++
"\n Contra : " ++ show m | 337 | testMatch :: PreExpr -> PreExpr -> Either (MatchMErr,Log) ExprSubst -> Assertion
testMatch pe pe' mpe = let m = match pe pe'
in unless (m == mpe) $
assertFailure $
"\n Resultado esperado: " ++ show mpe ++
"\n Contra : " ++ show m | 337 | testMatch pe pe' mpe = let m = match pe pe'
in unless (m == mpe) $
assertFailure $
"\n Resultado esperado: " ++ show mpe ++
"\n Contra : " ++ show m | 256 | false | true | 0 | 11 | 152 | 98 | 46 | 52 | null | null |
siddhanathan/ghc | testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun01.hs | bsd-3-clause | t = MkT { x = True, y = id, tField = False } | 44 | t = MkT { x = True, y = id, tField = False } | 44 | t = MkT { x = True, y = id, tField = False } | 44 | false | false | 1 | 6 | 13 | 29 | 16 | 13 | null | null |
snoyberg/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | -- Show needed for Lexer.x
{-
Note [InlinePragma]
~~~~~~~~~~~~~~~~~~~
This data type mirrors what you can write in an INLINE or NOINLINE pragma in
the source program.
If you write nothing at all, you get defaultInlinePragma:
inl_inline = EmptyInlineSpec
inl_act = AlwaysActive
inl_rule = FunLike
It's not possible to get that combination by *writing* something, so
if an Id has defaultInlinePragma it means the user didn't specify anything.
If inl_inline = Inline or Inlineable, then the Id should have an InlineRule unfolding.
If you want to know where InlinePragmas take effect: Look in DsBinds.makeCorePair
Note [CONLIKE pragma]
~~~~~~~~~~~~~~~~~~~~~
The ConLike constructor of a RuleMatchInfo is aimed at the following.
Consider first
{-# RULE "r/cons" forall a as. r (a:as) = f (a+1) #-}
g b bs = let x = b:bs in ..x...x...(r x)...
Now, the rule applies to the (r x) term, because GHC "looks through"
the definition of 'x' to see that it is (b:bs).
Now consider
{-# RULE "r/f" forall v. r (f v) = f (v+1) #-}
g v = let x = f v in ..x...x...(r x)...
Normally the (r x) would *not* match the rule, because GHC would be
scared about duplicating the redex (f v), so it does not "look
through" the bindings.
However the CONLIKE modifier says to treat 'f' like a constructor in
this situation, and "look through" the unfolding for x. So (r x)
fires, yielding (f (v+1)).
This is all controlled with a user-visible pragma:
{-# NOINLINE CONLIKE [1] f #-}
The main effects of CONLIKE are:
- The occurrence analyser (OccAnal) and simplifier (Simplify) treat
CONLIKE thing like constructors, by ANF-ing them
- New function coreUtils.exprIsExpandable is like exprIsCheap, but
additionally spots applications of CONLIKE functions
- A CoreUnfolding has a field that caches exprIsExpandable
- The rule matcher consults this field. See
Note [Expanding variables] in Rules.hs.
-}
isConLike :: RuleMatchInfo -> Bool
isConLike ConLike = True | 2,012 | isConLike :: RuleMatchInfo -> Bool
isConLike ConLike = True | 59 | isConLike ConLike = True | 24 | true | true | 0 | 5 | 405 | 20 | 11 | 9 | null | null |
momomimachli/Hedsql | src/Database/Hedsql/Common/Constructor.hs | gpl-3.0 | {-|
Coerce a type to a 'ColRefWrap'. This is used to wrap the columns
of different types into one single type. Then such standardized type can
be used in lists.
-}
colRefWrap :: ToColRef a (ColRef colType dbVendor) => a -> ColRefWrap dbVendor
colRefWrap = wrap . colRef | 269 | colRefWrap :: ToColRef a (ColRef colType dbVendor) => a -> ColRefWrap dbVendor
colRefWrap = wrap . colRef | 105 | colRefWrap = wrap . colRef | 26 | true | true | 0 | 8 | 47 | 40 | 20 | 20 | null | null |
hpacheco/jasminv | src/Language/Jasmin/TypeChecker.hs | gpl-3.0 | tt_intvar :: TcK m => Pident Position -> Bool -> TcM m (Pident TyInfo)
tt_intvar x isWrite = expect (loc x) TPInt (infoTyNote "tt_intvar" . loc) (tt_var x isWrite) | 163 | tt_intvar :: TcK m => Pident Position -> Bool -> TcM m (Pident TyInfo)
tt_intvar x isWrite = expect (loc x) TPInt (infoTyNote "tt_intvar" . loc) (tt_var x isWrite) | 163 | tt_intvar x isWrite = expect (loc x) TPInt (infoTyNote "tt_intvar" . loc) (tt_var x isWrite) | 92 | false | true | 0 | 10 | 28 | 78 | 37 | 41 | null | null |
mcapodici/dotsandboxes | src/Data/DotsAndBoxes/Types.hs | gpl-3.0 | emptyBoardCurrentState :: Int -> Int -> BoardCurrentState
emptyBoardCurrentState w h = BoardCurrentState w h Set.empty Map.empty Player1 | 136 | emptyBoardCurrentState :: Int -> Int -> BoardCurrentState
emptyBoardCurrentState w h = BoardCurrentState w h Set.empty Map.empty Player1 | 136 | emptyBoardCurrentState w h = BoardCurrentState w h Set.empty Map.empty Player1 | 78 | false | true | 0 | 6 | 16 | 39 | 19 | 20 | null | null |
brendanhay/gogol | gogol-tpu/gen/Network/Google/TPU/Types/Product.hs | mpl-2.0 | -- | Output only. The time when the node was created.
nCreateTime :: Lens' Node (Maybe UTCTime)
nCreateTime
= lens _nCreateTime (\ s a -> s{_nCreateTime = a}) .
mapping _DateTime | 186 | nCreateTime :: Lens' Node (Maybe UTCTime)
nCreateTime
= lens _nCreateTime (\ s a -> s{_nCreateTime = a}) .
mapping _DateTime | 132 | nCreateTime
= lens _nCreateTime (\ s a -> s{_nCreateTime = a}) .
mapping _DateTime | 90 | true | true | 1 | 9 | 38 | 59 | 28 | 31 | null | null |
ikuehne/craeft-hs | lib/Craeft/Parser.hs | gpl-3.0 | assignment :: Parser AST.Statement
assignment = do p <- getPosition
l <- lvalue
((do Lexer.equals
r <- expr
return $ AST.Assignment l r) <?> "assignment")
<|> let e = Annotated (AST.LValueExpr l) p
in return $ AST.ExpressionStatement e | 352 | assignment :: Parser AST.Statement
assignment = do p <- getPosition
l <- lvalue
((do Lexer.equals
r <- expr
return $ AST.Assignment l r) <?> "assignment")
<|> let e = Annotated (AST.LValueExpr l) p
in return $ AST.ExpressionStatement e | 352 | assignment = do p <- getPosition
l <- lvalue
((do Lexer.equals
r <- expr
return $ AST.Assignment l r) <?> "assignment")
<|> let e = Annotated (AST.LValueExpr l) p
in return $ AST.ExpressionStatement e | 317 | false | true | 1 | 16 | 154 | 110 | 49 | 61 | null | null |
Schpin/schpin-chassis | schpin_robot_lib/src/Data/URDF/Xml.hs | gpl-3.0 | cMassToXML :: ArrowXml a => Mass -> a XmlTree XmlTree
cMassToXML m = aelem "mass" [ sattr "value" $ show $ m /~ gram ] | 118 | cMassToXML :: ArrowXml a => Mass -> a XmlTree XmlTree
cMassToXML m = aelem "mass" [ sattr "value" $ show $ m /~ gram ] | 118 | cMassToXML m = aelem "mass" [ sattr "value" $ show $ m /~ gram ] | 64 | false | true | 0 | 10 | 24 | 56 | 26 | 30 | null | null |
c0deaddict/project-euler | src/Part2/Problem61.hs | bsd-3-clause | pFn :: [Int -> Int]
pFn =
[ \n -> n*(n+1) `div` 2
, \n -> n*n
, \n -> n*(3*n-1) `div` 2
, \n -> n*(2*n-1)
, \n -> n*(5*n-3) `div` 2
, \n -> n*(3*n-2)
] | 165 | pFn :: [Int -> Int]
pFn =
[ \n -> n*(n+1) `div` 2
, \n -> n*n
, \n -> n*(3*n-1) `div` 2
, \n -> n*(2*n-1)
, \n -> n*(5*n-3) `div` 2
, \n -> n*(3*n-2)
] | 165 | pFn =
[ \n -> n*(n+1) `div` 2
, \n -> n*n
, \n -> n*(3*n-1) `div` 2
, \n -> n*(2*n-1)
, \n -> n*(5*n-3) `div` 2
, \n -> n*(3*n-2)
] | 145 | false | true | 0 | 11 | 51 | 159 | 92 | 67 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 1189 = 1188 | 11 | 1189 = 1188 | 11 | 1189 = 1188 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
batterseapower/halifax-import | Finance/Halifax/Options.hs | bsd-3-clause | option_descriptions :: [OptDescr Options]
option_descriptions = [
Option ['f'] ["output-format"] (ReqArg (\s -> mempty { opt_output_method = Just (read s) }) "ledger|qif|csv")
"Format to output the parsed file in",
Option ['r'] ["rules"] (ReqArg (\s -> mempty { opt_rules_file = Just s }) "filename")
"Rules file to use for processing transactions",
Option ['c'] ["ledger-category"] (ReqArg (\s -> mempty { opt_ledger_account_category = Just s }) "category")
"Category to attribute this account to in Ledger output"
] | 581 | option_descriptions :: [OptDescr Options]
option_descriptions = [
Option ['f'] ["output-format"] (ReqArg (\s -> mempty { opt_output_method = Just (read s) }) "ledger|qif|csv")
"Format to output the parsed file in",
Option ['r'] ["rules"] (ReqArg (\s -> mempty { opt_rules_file = Just s }) "filename")
"Rules file to use for processing transactions",
Option ['c'] ["ledger-category"] (ReqArg (\s -> mempty { opt_ledger_account_category = Just s }) "category")
"Category to attribute this account to in Ledger output"
] | 581 | option_descriptions = [
Option ['f'] ["output-format"] (ReqArg (\s -> mempty { opt_output_method = Just (read s) }) "ledger|qif|csv")
"Format to output the parsed file in",
Option ['r'] ["rules"] (ReqArg (\s -> mempty { opt_rules_file = Just s }) "filename")
"Rules file to use for processing transactions",
Option ['c'] ["ledger-category"] (ReqArg (\s -> mempty { opt_ledger_account_category = Just s }) "category")
"Category to attribute this account to in Ledger output"
] | 539 | false | true | 0 | 15 | 137 | 158 | 87 | 71 | null | null |
wolverian/scheme48 | Main.hs | mit | primitiveBindings :: IO Env
primitiveBindings = do
n <- nullEnv
bindVars n $ map (makeFunc IOFunc) ioPrimitives
++ map (makeFunc PrimitiveFunc) primitives
where makeFunc constructor (var, f) = (var, constructor f) | 252 | primitiveBindings :: IO Env
primitiveBindings = do
n <- nullEnv
bindVars n $ map (makeFunc IOFunc) ioPrimitives
++ map (makeFunc PrimitiveFunc) primitives
where makeFunc constructor (var, f) = (var, constructor f) | 252 | primitiveBindings = do
n <- nullEnv
bindVars n $ map (makeFunc IOFunc) ioPrimitives
++ map (makeFunc PrimitiveFunc) primitives
where makeFunc constructor (var, f) = (var, constructor f) | 224 | false | true | 0 | 11 | 69 | 84 | 41 | 43 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/Term/Pretty.hs | bsd-3-clause | -- | Run a pretty-printing computation in a top-level, empty context
runPPM :: PPOpts -> SAWNamingEnv -> PPM a -> a
runPPM opts ne (PPM m) = runReader m $ emptyPPState opts ne | 175 | runPPM :: PPOpts -> SAWNamingEnv -> PPM a -> a
runPPM opts ne (PPM m) = runReader m $ emptyPPState opts ne | 106 | runPPM opts ne (PPM m) = runReader m $ emptyPPState opts ne | 59 | true | true | 0 | 8 | 32 | 52 | 25 | 27 | null | null |
brendanhay/gogol | gogol-surveys/gen/Network/Google/Surveys/Types/Product.hs | mpl-2.0 | tpNextPageToken :: Lens' TokenPagination (Maybe Text)
tpNextPageToken
= lens _tpNextPageToken
(\ s a -> s{_tpNextPageToken = a}) | 136 | tpNextPageToken :: Lens' TokenPagination (Maybe Text)
tpNextPageToken
= lens _tpNextPageToken
(\ s a -> s{_tpNextPageToken = a}) | 136 | tpNextPageToken
= lens _tpNextPageToken
(\ s a -> s{_tpNextPageToken = a}) | 82 | false | true | 0 | 8 | 24 | 48 | 24 | 24 | null | null |
vikraman/ghc | compiler/main/DynFlags.hs | bsd-3-clause | add_dep_message (SepArg f) message = SepArg $ \s -> f s >> deprecate message | 76 | add_dep_message (SepArg f) message = SepArg $ \s -> f s >> deprecate message | 76 | add_dep_message (SepArg f) message = SepArg $ \s -> f s >> deprecate message | 76 | false | false | 0 | 8 | 13 | 36 | 17 | 19 | null | null |
gpahal/hgraph | src/HGraph/Edge.hs | bsd-3-clause | hasEdgeLabelIndex :: LabelIndex -> Id -> GS Bool
hasEdgeLabelIndex li i = getEdgeByIdUnsafe i >>= hasEdgeLabelIndexE li | 119 | hasEdgeLabelIndex :: LabelIndex -> Id -> GS Bool
hasEdgeLabelIndex li i = getEdgeByIdUnsafe i >>= hasEdgeLabelIndexE li | 119 | hasEdgeLabelIndex li i = getEdgeByIdUnsafe i >>= hasEdgeLabelIndexE li | 70 | false | true | 0 | 7 | 16 | 37 | 17 | 20 | null | null |
andorp/bead | src/Bead/View/Content/Bootstrap.hs | bsd-3-clause | -- Returns the HTML class attribute value for the given column size
columnSizeClass = columnSize $ \size -> "col-md-" ++ show size | 130 | columnSizeClass = columnSize $ \size -> "col-md-" ++ show size | 62 | columnSizeClass = columnSize $ \size -> "col-md-" ++ show size | 62 | true | false | 0 | 8 | 21 | 23 | 12 | 11 | null | null |
Odomontois/abapdocu | src/Main.hs | bsd-3-clause | main::IO ()
main = do
Params{..} <- cmdArgs params
let indent = not noIndent
runX $
readDocument [withValidate no] src
>>> root [] [content styles]
>>> writeDocument [withIndent indent] dst
return () | 219 | main::IO ()
main = do
Params{..} <- cmdArgs params
let indent = not noIndent
runX $
readDocument [withValidate no] src
>>> root [] [content styles]
>>> writeDocument [withIndent indent] dst
return () | 219 | main = do
Params{..} <- cmdArgs params
let indent = not noIndent
runX $
readDocument [withValidate no] src
>>> root [] [content styles]
>>> writeDocument [withIndent indent] dst
return () | 207 | false | true | 1 | 13 | 51 | 107 | 46 | 61 | null | null |
thoughtpolice/calc | Asm.hs | bsd-3-clause | gsub = do
pop ebx
pop eax
sub eax ebx
push eax | 54 | gsub = do
pop ebx
pop eax
sub eax ebx
push eax | 54 | gsub = do
pop ebx
pop eax
sub eax ebx
push eax | 54 | false | false | 0 | 7 | 19 | 32 | 12 | 20 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/GlobalForwardingRules/SetTarget.hs | mpl-2.0 | -- | Creates a value of 'GlobalForwardingRulesSetTarget' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gfrstProject'
--
-- * 'gfrstForwardingRule'
--
-- * 'gfrstPayload'
globalForwardingRulesSetTarget
:: Text -- ^ 'gfrstProject'
-> Text -- ^ 'gfrstForwardingRule'
-> TargetReference -- ^ 'gfrstPayload'
-> GlobalForwardingRulesSetTarget
globalForwardingRulesSetTarget pGfrstProject_ pGfrstForwardingRule_ pGfrstPayload_ =
GlobalForwardingRulesSetTarget'
{ _gfrstProject = pGfrstProject_
, _gfrstForwardingRule = pGfrstForwardingRule_
, _gfrstPayload = pGfrstPayload_
} | 692 | globalForwardingRulesSetTarget
:: Text -- ^ 'gfrstProject'
-> Text -- ^ 'gfrstForwardingRule'
-> TargetReference -- ^ 'gfrstPayload'
-> GlobalForwardingRulesSetTarget
globalForwardingRulesSetTarget pGfrstProject_ pGfrstForwardingRule_ pGfrstPayload_ =
GlobalForwardingRulesSetTarget'
{ _gfrstProject = pGfrstProject_
, _gfrstForwardingRule = pGfrstForwardingRule_
, _gfrstPayload = pGfrstPayload_
} | 434 | globalForwardingRulesSetTarget pGfrstProject_ pGfrstForwardingRule_ pGfrstPayload_ =
GlobalForwardingRulesSetTarget'
{ _gfrstProject = pGfrstProject_
, _gfrstForwardingRule = pGfrstForwardingRule_
, _gfrstPayload = pGfrstPayload_
} | 251 | true | true | 0 | 9 | 114 | 71 | 42 | 29 | null | null |
nickbart1980/pandoc | src/Text/Pandoc.hs | gpl-2.0 | -- | Association list of formats and writers.
writers :: [ ( String, Writer ) ]
writers = [
("native" , PureStringWriter writeNative)
,("json" , PureStringWriter writeJSON)
,("docx" , IOByteStringWriter writeDocx)
,("odt" , IOByteStringWriter writeODT)
,("epub" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB2 })
,("epub3" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB3 })
,("fb2" , IOStringWriter writeFB2)
,("html" , PureStringWriter writeHtmlString)
,("html5" , PureStringWriter $ \o ->
writeHtmlString o{ writerHtml5 = True })
,("icml" , PureStringWriter writeICML)
,("s5" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = S5Slides
, writerTableOfContents = False })
,("slidy" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlidySlides })
,("slideous" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlideousSlides })
,("dzslides" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = DZSlides
, writerHtml5 = True })
,("revealjs" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = RevealJsSlides
, writerHtml5 = True })
,("docbook" , PureStringWriter writeDocbook)
,("opml" , PureStringWriter writeOPML)
,("opendocument" , PureStringWriter writeOpenDocument)
,("latex" , PureStringWriter writeLaTeX)
,("beamer" , PureStringWriter $ \o ->
writeLaTeX o{ writerBeamer = True })
,("context" , PureStringWriter writeConTeXt)
,("texinfo" , PureStringWriter writeTexinfo)
,("man" , PureStringWriter writeMan)
,("markdown" , PureStringWriter writeMarkdown)
,("markdown_strict" , PureStringWriter writeMarkdown)
,("markdown_phpextra" , PureStringWriter writeMarkdown)
,("markdown_github" , PureStringWriter writeMarkdown)
,("markdown_mmd" , PureStringWriter writeMarkdown)
,("plain" , PureStringWriter writePlain)
,("rst" , PureStringWriter writeRST)
,("mediawiki" , PureStringWriter writeMediaWiki)
,("textile" , PureStringWriter writeTextile)
,("rtf" , IOStringWriter writeRTFWithEmbeddedImages)
,("org" , PureStringWriter writeOrg)
,("asciidoc" , PureStringWriter writeAsciiDoc)
] | 2,537 | writers :: [ ( String, Writer ) ]
writers = [
("native" , PureStringWriter writeNative)
,("json" , PureStringWriter writeJSON)
,("docx" , IOByteStringWriter writeDocx)
,("odt" , IOByteStringWriter writeODT)
,("epub" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB2 })
,("epub3" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB3 })
,("fb2" , IOStringWriter writeFB2)
,("html" , PureStringWriter writeHtmlString)
,("html5" , PureStringWriter $ \o ->
writeHtmlString o{ writerHtml5 = True })
,("icml" , PureStringWriter writeICML)
,("s5" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = S5Slides
, writerTableOfContents = False })
,("slidy" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlidySlides })
,("slideous" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlideousSlides })
,("dzslides" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = DZSlides
, writerHtml5 = True })
,("revealjs" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = RevealJsSlides
, writerHtml5 = True })
,("docbook" , PureStringWriter writeDocbook)
,("opml" , PureStringWriter writeOPML)
,("opendocument" , PureStringWriter writeOpenDocument)
,("latex" , PureStringWriter writeLaTeX)
,("beamer" , PureStringWriter $ \o ->
writeLaTeX o{ writerBeamer = True })
,("context" , PureStringWriter writeConTeXt)
,("texinfo" , PureStringWriter writeTexinfo)
,("man" , PureStringWriter writeMan)
,("markdown" , PureStringWriter writeMarkdown)
,("markdown_strict" , PureStringWriter writeMarkdown)
,("markdown_phpextra" , PureStringWriter writeMarkdown)
,("markdown_github" , PureStringWriter writeMarkdown)
,("markdown_mmd" , PureStringWriter writeMarkdown)
,("plain" , PureStringWriter writePlain)
,("rst" , PureStringWriter writeRST)
,("mediawiki" , PureStringWriter writeMediaWiki)
,("textile" , PureStringWriter writeTextile)
,("rtf" , IOStringWriter writeRTFWithEmbeddedImages)
,("org" , PureStringWriter writeOrg)
,("asciidoc" , PureStringWriter writeAsciiDoc)
] | 2,491 | writers = [
("native" , PureStringWriter writeNative)
,("json" , PureStringWriter writeJSON)
,("docx" , IOByteStringWriter writeDocx)
,("odt" , IOByteStringWriter writeODT)
,("epub" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB2 })
,("epub3" , IOByteStringWriter $ \o ->
writeEPUB o{ writerEpubVersion = Just EPUB3 })
,("fb2" , IOStringWriter writeFB2)
,("html" , PureStringWriter writeHtmlString)
,("html5" , PureStringWriter $ \o ->
writeHtmlString o{ writerHtml5 = True })
,("icml" , PureStringWriter writeICML)
,("s5" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = S5Slides
, writerTableOfContents = False })
,("slidy" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlidySlides })
,("slideous" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = SlideousSlides })
,("dzslides" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = DZSlides
, writerHtml5 = True })
,("revealjs" , PureStringWriter $ \o ->
writeHtmlString o{ writerSlideVariant = RevealJsSlides
, writerHtml5 = True })
,("docbook" , PureStringWriter writeDocbook)
,("opml" , PureStringWriter writeOPML)
,("opendocument" , PureStringWriter writeOpenDocument)
,("latex" , PureStringWriter writeLaTeX)
,("beamer" , PureStringWriter $ \o ->
writeLaTeX o{ writerBeamer = True })
,("context" , PureStringWriter writeConTeXt)
,("texinfo" , PureStringWriter writeTexinfo)
,("man" , PureStringWriter writeMan)
,("markdown" , PureStringWriter writeMarkdown)
,("markdown_strict" , PureStringWriter writeMarkdown)
,("markdown_phpextra" , PureStringWriter writeMarkdown)
,("markdown_github" , PureStringWriter writeMarkdown)
,("markdown_mmd" , PureStringWriter writeMarkdown)
,("plain" , PureStringWriter writePlain)
,("rst" , PureStringWriter writeRST)
,("mediawiki" , PureStringWriter writeMediaWiki)
,("textile" , PureStringWriter writeTextile)
,("rtf" , IOStringWriter writeRTFWithEmbeddedImages)
,("org" , PureStringWriter writeOrg)
,("asciidoc" , PureStringWriter writeAsciiDoc)
] | 2,457 | true | true | 0 | 12 | 667 | 618 | 362 | 256 | null | null |
nominolo/haddock2 | src/Haddock/Backends/Xhtml/Themes.hs | bsd-2-clause | directoryTheme :: FilePath -> IO PossibleTheme
directoryTheme path = do
items <- getDirectoryItems path
case filter isCssFilePath items of
[cf] -> retRight $ Theme (takeBaseName path) (takeFileName cf) items
[] -> errMessage "No .css file in theme directory" path
_ -> errMessage "More than one .css file in theme directory" path
-- | Check if we have a built in theme | 386 | directoryTheme :: FilePath -> IO PossibleTheme
directoryTheme path = do
items <- getDirectoryItems path
case filter isCssFilePath items of
[cf] -> retRight $ Theme (takeBaseName path) (takeFileName cf) items
[] -> errMessage "No .css file in theme directory" path
_ -> errMessage "More than one .css file in theme directory" path
-- | Check if we have a built in theme | 386 | directoryTheme path = do
items <- getDirectoryItems path
case filter isCssFilePath items of
[cf] -> retRight $ Theme (takeBaseName path) (takeFileName cf) items
[] -> errMessage "No .css file in theme directory" path
_ -> errMessage "More than one .css file in theme directory" path
-- | Check if we have a built in theme | 339 | false | true | 0 | 13 | 78 | 100 | 47 | 53 | null | null |
kolmodin/cabal | cabal-install/Distribution/Client/SolverInstallPlan.hs | bsd-3-clause | -- | An installation plan is closed if for every package in the set, all of
-- its dependencies are also in the set. That is, the set is closed under the
-- dependency relation.
--
-- * if the result is @False@ use 'PackageIndex.brokenPackages' to find out
-- which packages depend on packages not in the index.
--
closed :: SolverPlanIndex -> Bool
closed = null . Graph.broken | 379 | closed :: SolverPlanIndex -> Bool
closed = null . Graph.broken | 62 | closed = null . Graph.broken | 28 | true | true | 1 | 7 | 70 | 36 | 19 | 17 | null | null |
deckool/my-hs-github | Github/Repos.hs | bsd-3-clause | -- | The contributors to a repo, given the owner and repo name.
--
-- > contributors "thoughtbot" "paperclip"
contributors :: String -> String -> IO (Either Error [Contributor])
contributors userName reqRepoName =
githubGet ["repos", userName, reqRepoName, "contributors"] | 274 | contributors :: String -> String -> IO (Either Error [Contributor])
contributors userName reqRepoName =
githubGet ["repos", userName, reqRepoName, "contributors"] | 164 | contributors userName reqRepoName =
githubGet ["repos", userName, reqRepoName, "contributors"] | 96 | true | true | 0 | 10 | 39 | 56 | 31 | 25 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Resource/Analytics/Management/WebPropertyAdWordsLinks/Insert.hs | mpl-2.0 | -- | Creates a value of 'ManagementWebPropertyAdWordsLinksInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mwpawliWebPropertyId'
--
-- * 'mwpawliPayload'
--
-- * 'mwpawliAccountId'
managementWebPropertyAdWordsLinksInsert
:: Text -- ^ 'mwpawliWebPropertyId'
-> EntityAdWordsLink -- ^ 'mwpawliPayload'
-> Text -- ^ 'mwpawliAccountId'
-> ManagementWebPropertyAdWordsLinksInsert
managementWebPropertyAdWordsLinksInsert pMwpawliWebPropertyId_ pMwpawliPayload_ pMwpawliAccountId_ =
ManagementWebPropertyAdWordsLinksInsert'
{ _mwpawliWebPropertyId = pMwpawliWebPropertyId_
, _mwpawliPayload = pMwpawliPayload_
, _mwpawliAccountId = pMwpawliAccountId_
} | 774 | managementWebPropertyAdWordsLinksInsert
:: Text -- ^ 'mwpawliWebPropertyId'
-> EntityAdWordsLink -- ^ 'mwpawliPayload'
-> Text -- ^ 'mwpawliAccountId'
-> ManagementWebPropertyAdWordsLinksInsert
managementWebPropertyAdWordsLinksInsert pMwpawliWebPropertyId_ pMwpawliPayload_ pMwpawliAccountId_ =
ManagementWebPropertyAdWordsLinksInsert'
{ _mwpawliWebPropertyId = pMwpawliWebPropertyId_
, _mwpawliPayload = pMwpawliPayload_
, _mwpawliAccountId = pMwpawliAccountId_
} | 500 | managementWebPropertyAdWordsLinksInsert pMwpawliWebPropertyId_ pMwpawliPayload_ pMwpawliAccountId_ =
ManagementWebPropertyAdWordsLinksInsert'
{ _mwpawliWebPropertyId = pMwpawliWebPropertyId_
, _mwpawliPayload = pMwpawliPayload_
, _mwpawliAccountId = pMwpawliAccountId_
} | 290 | true | true | 0 | 9 | 114 | 71 | 42 | 29 | null | null |
gbwey/persistentold | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | keyToOid :: (PersistEntity entity, PersistEntityBackend entity ~ MongoBackend)
=> Key entity -> DB.ObjectId
keyToOid (Key k) = persistObjectIdToDbOid k | 160 | keyToOid :: (PersistEntity entity, PersistEntityBackend entity ~ MongoBackend)
=> Key entity -> DB.ObjectId
keyToOid (Key k) = persistObjectIdToDbOid k | 160 | keyToOid (Key k) = persistObjectIdToDbOid k | 43 | false | true | 0 | 8 | 27 | 52 | 25 | 27 | null | null |
geigerzaehler/pladen | Pladen/App/Api.hs | mit | extend :: (ToJSON a, ToJSON v) => a -> Text -> v -> Value
extend a k v | Object o <- toJSON a
= Object $ H.insert k (toJSON v) o
| otherwise = toJSON a | 177 | extend :: (ToJSON a, ToJSON v) => a -> Text -> v -> Value
extend a k v | Object o <- toJSON a
= Object $ H.insert k (toJSON v) o
| otherwise = toJSON a | 177 | extend a k v | Object o <- toJSON a
= Object $ H.insert k (toJSON v) o
| otherwise = toJSON a | 119 | false | true | 1 | 10 | 62 | 95 | 44 | 51 | null | null |
alphalambda/codeworld | codeworld-game-server/src/Bot.hs | apache-2.0 | opts =
info
(helper <*> config)
(fullDesc <> progDesc "CodeWorld simple bot" <>
header
"codeword-game-bot - a simple mirroring bot for codeworld-gameserver")
where
config :: Parser Config
config =
Config <$>
option
auto
(long "clients" <> short 'c' <> showDefault <> metavar "N" <>
value 1 <>
help "Number of clients to simulate (>=1)") <*>
switch
(long "invert" <> showDefault <> help "Return opposite direction") <*>
optional
(option
auto
(long "delay" <> showDefault <> metavar "ms" <>
help
"Use remote timestamp and adjust with this many milli seconds. Default is to use local time stamps. Can be negative.")) <*>
strOption
(long "hostname" <> showDefault <> value "0.0.0.0" <>
metavar "HOSTNAME" <>
help "Hostname") <*>
option
auto
(long "port" <> showDefault <> metavar "PORT" <> value 9160 <>
help "Port") <*>
strOption
(long "path" <> showDefault <> metavar "PATH" <> value "gameserver" <>
help "Path") <*>
(T.pack <$>
strOption
(long "gameid" <> showDefault <> metavar "ID" <>
help "The ID of the game to join (4 letters)")) <*>
switch (long "debug" <> showDefault <> help "Show debugging output") | 1,514 | opts =
info
(helper <*> config)
(fullDesc <> progDesc "CodeWorld simple bot" <>
header
"codeword-game-bot - a simple mirroring bot for codeworld-gameserver")
where
config :: Parser Config
config =
Config <$>
option
auto
(long "clients" <> short 'c' <> showDefault <> metavar "N" <>
value 1 <>
help "Number of clients to simulate (>=1)") <*>
switch
(long "invert" <> showDefault <> help "Return opposite direction") <*>
optional
(option
auto
(long "delay" <> showDefault <> metavar "ms" <>
help
"Use remote timestamp and adjust with this many milli seconds. Default is to use local time stamps. Can be negative.")) <*>
strOption
(long "hostname" <> showDefault <> value "0.0.0.0" <>
metavar "HOSTNAME" <>
help "Hostname") <*>
option
auto
(long "port" <> showDefault <> metavar "PORT" <> value 9160 <>
help "Port") <*>
strOption
(long "path" <> showDefault <> metavar "PATH" <> value "gameserver" <>
help "Path") <*>
(T.pack <$>
strOption
(long "gameid" <> showDefault <> metavar "ID" <>
help "The ID of the game to join (4 letters)")) <*>
switch (long "debug" <> showDefault <> help "Show debugging output") | 1,514 | opts =
info
(helper <*> config)
(fullDesc <> progDesc "CodeWorld simple bot" <>
header
"codeword-game-bot - a simple mirroring bot for codeworld-gameserver")
where
config :: Parser Config
config =
Config <$>
option
auto
(long "clients" <> short 'c' <> showDefault <> metavar "N" <>
value 1 <>
help "Number of clients to simulate (>=1)") <*>
switch
(long "invert" <> showDefault <> help "Return opposite direction") <*>
optional
(option
auto
(long "delay" <> showDefault <> metavar "ms" <>
help
"Use remote timestamp and adjust with this many milli seconds. Default is to use local time stamps. Can be negative.")) <*>
strOption
(long "hostname" <> showDefault <> value "0.0.0.0" <>
metavar "HOSTNAME" <>
help "Hostname") <*>
option
auto
(long "port" <> showDefault <> metavar "PORT" <> value 9160 <>
help "Port") <*>
strOption
(long "path" <> showDefault <> metavar "PATH" <> value "gameserver" <>
help "Path") <*>
(T.pack <$>
strOption
(long "gameid" <> showDefault <> metavar "ID" <>
help "The ID of the game to join (4 letters)")) <*>
switch (long "debug" <> showDefault <> help "Show debugging output") | 1,514 | false | false | 1 | 20 | 584 | 345 | 157 | 188 | null | null |
GaloisInc/halvm-ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | -- | Remove usage (but not strictness) info on the 'IdInfo'
zapUsageInfo :: IdInfo -> Maybe IdInfo
zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) | 178 | zapUsageInfo :: IdInfo -> Maybe IdInfo
zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) | 118 | zapUsageInfo info = Just (info {demandInfo = zapUsageDemand (demandInfo info)}) | 79 | true | true | 0 | 11 | 26 | 45 | 23 | 22 | null | null |
sethfowler/hsbugzilla | src/Web/Bugzilla/Search.hs | bsd-3-clause | containsAll :: Field T.Text -> [T.Text] -> SearchExpression
containsAll = (Term .) . BinaryOp "allwordssubstr" | 110 | containsAll :: Field T.Text -> [T.Text] -> SearchExpression
containsAll = (Term .) . BinaryOp "allwordssubstr" | 110 | containsAll = (Term .) . BinaryOp "allwordssubstr" | 50 | false | true | 0 | 8 | 14 | 40 | 21 | 19 | null | null |
z0isch/advent-of-code | src/Day21.hs | bsd-3-clause | invStat :: Inventory -> (Item -> Int) -> Int
invStat i f = sum $ map f i | 72 | invStat :: Inventory -> (Item -> Int) -> Int
invStat i f = sum $ map f i | 72 | invStat i f = sum $ map f i | 27 | false | true | 0 | 8 | 17 | 40 | 20 | 20 | null | null |
beni55/haste-compiler | src/haste-cat.hs | bsd-3-clause | niceName (Name n (Just (pkg, m))) =
BS.concat [pkg, ":", m, ".", n] | 69 | niceName (Name n (Just (pkg, m))) =
BS.concat [pkg, ":", m, ".", n] | 69 | niceName (Name n (Just (pkg, m))) =
BS.concat [pkg, ":", m, ".", n] | 69 | false | false | 0 | 9 | 14 | 50 | 27 | 23 | null | null |
snoyberg/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isDeadOcc _ = False | 25 | isDeadOcc _ = False | 25 | isDeadOcc _ = False | 25 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
kazu-yamamoto/llrbtree | Data/Set/LLRBTree.hs | bsd-3-clause | showSet' :: Show a => String -> RBTree a -> String
showSet' _ Leaf = "\n" | 73 | showSet' :: Show a => String -> RBTree a -> String
showSet' _ Leaf = "\n" | 73 | showSet' _ Leaf = "\n" | 22 | false | true | 0 | 9 | 15 | 40 | 17 | 23 | null | null |
quchen/stg | test/Testsuite/Test/Machine/Evaluate/Rules.hs | bsd-3-clause | primopShortcut_defaultBound :: TestTree
primopShortcut_defaultBound = machineStateTest defSpec
{ testName = "Default bound match shortcut (rule 18)"
, source = [stg|
main = \ => case +# 1# 2# of
1# -> TestFail 1#;
2# -> TestFail 2#;
v -> Success
|]
, failPredicate = \state -> case stgCode state of
Eval AppP{} _ -> True -- The point of the shortcut is to never reach
-- the AppP rule itself.
_otherwise -> False
} | 532 | primopShortcut_defaultBound :: TestTree
primopShortcut_defaultBound = machineStateTest defSpec
{ testName = "Default bound match shortcut (rule 18)"
, source = [stg|
main = \ => case +# 1# 2# of
1# -> TestFail 1#;
2# -> TestFail 2#;
v -> Success
|]
, failPredicate = \state -> case stgCode state of
Eval AppP{} _ -> True -- The point of the shortcut is to never reach
-- the AppP rule itself.
_otherwise -> False
} | 532 | primopShortcut_defaultBound = machineStateTest defSpec
{ testName = "Default bound match shortcut (rule 18)"
, source = [stg|
main = \ => case +# 1# 2# of
1# -> TestFail 1#;
2# -> TestFail 2#;
v -> Success
|]
, failPredicate = \state -> case stgCode state of
Eval AppP{} _ -> True -- The point of the shortcut is to never reach
-- the AppP rule itself.
_otherwise -> False
} | 492 | false | true | 0 | 13 | 191 | 73 | 42 | 31 | null | null |
christiaanb/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | mkLocalOcc :: Unique -- ^ Unique to combine with the 'OccName'
-> OccName -- ^ Local name, e.g. @sat@
-> OccName -- ^ Nice unique version, e.g. @$L23sat@
mkLocalOcc uniq occ
= mk_deriv varName ("$L" ++ show uniq) (occNameString occ) | 288 | mkLocalOcc :: Unique -- ^ Unique to combine with the 'OccName'
-> OccName -- ^ Local name, e.g. @sat@
-> OccName
mkLocalOcc uniq occ
= mk_deriv varName ("$L" ++ show uniq) (occNameString occ) | 237 | mkLocalOcc uniq occ
= mk_deriv varName ("$L" ++ show uniq) (occNameString occ) | 81 | true | true | 0 | 8 | 95 | 50 | 26 | 24 | null | null |
mjhoy/chorebot | src/Chorebot/Doer/Parser.hs | gpl-2.0 | runDoersParser :: String -> -- filename to report errors with
String -> -- text to parse
Either String [Doer]
runDoersParser filename str =
case res of
(Right doers) -> return doers
(Left err) -> Left $ show err
where
res = parse doersParser filename str | 317 | runDoersParser :: String -> -- filename to report errors with
String -> -- text to parse
Either String [Doer]
runDoersParser filename str =
case res of
(Right doers) -> return doers
(Left err) -> Left $ show err
where
res = parse doersParser filename str | 317 | runDoersParser filename str =
case res of
(Right doers) -> return doers
(Left err) -> Left $ show err
where
res = parse doersParser filename str | 163 | false | true | 1 | 9 | 107 | 96 | 44 | 52 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/GlobalForwardingRules/Delete.hs | mpl-2.0 | -- | Creates a value of 'GlobalForwardingRulesDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gfrdProject'
--
-- * 'gfrdForwardingRule'
globalForwardingRulesDelete
:: Text -- ^ 'gfrdProject'
-> Text -- ^ 'gfrdForwardingRule'
-> GlobalForwardingRulesDelete
globalForwardingRulesDelete pGfrdProject_ pGfrdForwardingRule_ =
GlobalForwardingRulesDelete'
{ _gfrdProject = pGfrdProject_
, _gfrdForwardingRule = pGfrdForwardingRule_
} | 549 | globalForwardingRulesDelete
:: Text -- ^ 'gfrdProject'
-> Text -- ^ 'gfrdForwardingRule'
-> GlobalForwardingRulesDelete
globalForwardingRulesDelete pGfrdProject_ pGfrdForwardingRule_ =
GlobalForwardingRulesDelete'
{ _gfrdProject = pGfrdProject_
, _gfrdForwardingRule = pGfrdForwardingRule_
} | 319 | globalForwardingRulesDelete pGfrdProject_ pGfrdForwardingRule_ =
GlobalForwardingRulesDelete'
{ _gfrdProject = pGfrdProject_
, _gfrdForwardingRule = pGfrdForwardingRule_
} | 187 | true | true | 0 | 8 | 92 | 56 | 32 | 24 | null | null |
mapinguari/SC_HS_Proxy | src/Proxy/Math/Rectangle.hs | mit | vertex :: (Integral b) => b -> Rectangle a -> Point a
vertex n r = case n `mod` 4 of
0 -> mkPointxFirst (inf.xI $ r) (inf.yI $ r)
1 -> mkPointxFirst (inf.xI $ r) (sup.yI $ r)
2 -> mkPointxFirst (sup.xI $ r) (sup.yI $ r)
3 -> mkPointxFirst (sup.xI $ r) (inf.yI $ r) | 272 | vertex :: (Integral b) => b -> Rectangle a -> Point a
vertex n r = case n `mod` 4 of
0 -> mkPointxFirst (inf.xI $ r) (inf.yI $ r)
1 -> mkPointxFirst (inf.xI $ r) (sup.yI $ r)
2 -> mkPointxFirst (sup.xI $ r) (sup.yI $ r)
3 -> mkPointxFirst (sup.xI $ r) (inf.yI $ r) | 272 | vertex n r = case n `mod` 4 of
0 -> mkPointxFirst (inf.xI $ r) (inf.yI $ r)
1 -> mkPointxFirst (inf.xI $ r) (sup.yI $ r)
2 -> mkPointxFirst (sup.xI $ r) (sup.yI $ r)
3 -> mkPointxFirst (sup.xI $ r) (inf.yI $ r) | 218 | false | true | 4 | 8 | 64 | 168 | 85 | 83 | null | null |
brendanhay/gogol | gogol-drive/gen/Network/Google/Resource/Drive/Replies/Get.hs | mpl-2.0 | -- | Whether to return deleted replies. Deleted replies will not include
-- their original content.
rgIncludeDeleted :: Lens' RepliesGet Bool
rgIncludeDeleted
= lens _rgIncludeDeleted
(\ s a -> s{_rgIncludeDeleted = a}) | 227 | rgIncludeDeleted :: Lens' RepliesGet Bool
rgIncludeDeleted
= lens _rgIncludeDeleted
(\ s a -> s{_rgIncludeDeleted = a}) | 127 | rgIncludeDeleted
= lens _rgIncludeDeleted
(\ s a -> s{_rgIncludeDeleted = a}) | 85 | true | true | 0 | 9 | 39 | 43 | 23 | 20 | null | null |
jerhoud/true-real | src/Data/TrueReal.hs | gpl-3.0 | oddIndexPowerSeries :: (Integer -> Rational) -> R -> R
oddIndexPowerSeries f x = oddPowerSeries [f n | n <- [0..]] x | 116 | oddIndexPowerSeries :: (Integer -> Rational) -> R -> R
oddIndexPowerSeries f x = oddPowerSeries [f n | n <- [0..]] x | 116 | oddIndexPowerSeries f x = oddPowerSeries [f n | n <- [0..]] x | 61 | false | true | 0 | 9 | 20 | 53 | 27 | 26 | null | null |
lukexi/ghc | compiler/nativeGen/RegAlloc/Graph/Spill.hs | bsd-3-clause | - | Add both RELOAD and SPILL meta instructions for an instruction that
-- both reads and writes to a vreg that is being spilled.
spillModify
:: Instruction instr
=> UniqFM Int
-> instr
-> Reg
-> SpillM (instr, ([LiveInstr instr'], [LiveInstr instr']))
spillModify regSlotMap instr reg
| Just slot <- lookupUFM regSlotMap reg
= do (instr', nReg) <- patchInstr reg instr
modify $ \s -> s
{ stateSpillSL = addToUFM_C accSpillSL (stateSpillSL s) reg (reg, 1, 1) }
return ( instr'
, ( [LiveInstr (RELOAD slot nReg) Nothing]
, [LiveInstr (SPILL nReg slot) Nothing]))
| otherwise = panic "RegSpill.spillModify: no slot defined for spilled reg"
| 771 | spillModify
:: Instruction instr
=> UniqFM Int
-> instr
-> Reg
-> SpillM (instr, ([LiveInstr instr'], [LiveInstr instr']))
spillModify regSlotMap instr reg
| Just slot <- lookupUFM regSlotMap reg
= do (instr', nReg) <- patchInstr reg instr
modify $ \s -> s
{ stateSpillSL = addToUFM_C accSpillSL (stateSpillSL s) reg (reg, 1, 1) }
return ( instr'
, ( [LiveInstr (RELOAD slot nReg) Nothing]
, [LiveInstr (SPILL nReg slot) Nothing]))
| otherwise = panic "RegSpill.spillModify: no slot defined for spilled reg" | 637 | spillModify regSlotMap instr reg
| Just slot <- lookupUFM regSlotMap reg
= do (instr', nReg) <- patchInstr reg instr
modify $ \s -> s
{ stateSpillSL = addToUFM_C accSpillSL (stateSpillSL s) reg (reg, 1, 1) }
return ( instr'
, ( [LiveInstr (RELOAD slot nReg) Nothing]
, [LiveInstr (SPILL nReg slot) Nothing]))
| otherwise = panic "RegSpill.spillModify: no slot defined for spilled reg" | 474 | true | true | 2 | 15 | 239 | 242 | 120 | 122 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkTcForAllCos tvs co = ASSERT( all isTyVar tvs ) foldr TcForAllCo co tvs | 83 | mkTcForAllCos tvs co = ASSERT( all isTyVar tvs ) foldr TcForAllCo co tvs | 83 | mkTcForAllCos tvs co = ASSERT( all isTyVar tvs ) foldr TcForAllCo co tvs | 83 | false | false | 0 | 7 | 23 | 30 | 14 | 16 | null | null |
ingemaradahl/bilder | src/TypeChecker/Inferring.hs | lgpl-3.0 | inferExp (EAssSub (EVar cid) tk e) = inferAssignment tk cid e | 61 | inferExp (EAssSub (EVar cid) tk e) = inferAssignment tk cid e | 61 | inferExp (EAssSub (EVar cid) tk e) = inferAssignment tk cid e | 61 | false | false | 0 | 9 | 10 | 32 | 15 | 17 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | conference/2018-05-lambdaconf/telegram-bot-in-haskell/app/Main5.hs | unlicense | -- | Add a new item to todo list.
addItem :: TodoItem -> Model -> Model
addItem item model = model { todoItems = item : todoItems model } | 137 | addItem :: TodoItem -> Model -> Model
addItem item model = model { todoItems = item : todoItems model } | 103 | addItem item model = model { todoItems = item : todoItems model } | 65 | true | true | 0 | 8 | 28 | 40 | 21 | 19 | null | null |
thomie/cabal | cabal-install/Distribution/Client/Sandbox.hs | bsd-3-clause | sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags
-> IO ()
sandboxListSources verbosity _sandboxFlags globalFlags = do
(sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
refs <- Index.listBuildTreeRefs verbosity
Index.ListIgnored Index.LinksAndSnapshots indexFile
when (null refs) $
notice verbosity $ "Index file '" ++ indexFile
++ "' has no references to local build trees."
when (not . null $ refs) $ do
notice verbosity $ "Source dependencies registered "
++ "in the current sandbox ('" ++ sandboxDir ++ "'):\n\n"
mapM_ putStrLn refs
notice verbosity $ "\nTo unregister source dependencies, "
++ "use the 'sandbox delete-source' command."
-- | Entry point for the 'cabal sandbox hc-pkg' command. Invokes the @hc-pkg@
-- tool with provided arguments, restricted to the sandbox. | 973 | sandboxListSources :: Verbosity -> SandboxFlags -> GlobalFlags
-> IO ()
sandboxListSources verbosity _sandboxFlags globalFlags = do
(sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
refs <- Index.listBuildTreeRefs verbosity
Index.ListIgnored Index.LinksAndSnapshots indexFile
when (null refs) $
notice verbosity $ "Index file '" ++ indexFile
++ "' has no references to local build trees."
when (not . null $ refs) $ do
notice verbosity $ "Source dependencies registered "
++ "in the current sandbox ('" ++ sandboxDir ++ "'):\n\n"
mapM_ putStrLn refs
notice verbosity $ "\nTo unregister source dependencies, "
++ "use the 'sandbox delete-source' command."
-- | Entry point for the 'cabal sandbox hc-pkg' command. Invokes the @hc-pkg@
-- tool with provided arguments, restricted to the sandbox. | 973 | sandboxListSources verbosity _sandboxFlags globalFlags = do
(sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
refs <- Index.listBuildTreeRefs verbosity
Index.ListIgnored Index.LinksAndSnapshots indexFile
when (null refs) $
notice verbosity $ "Index file '" ++ indexFile
++ "' has no references to local build trees."
when (not . null $ refs) $ do
notice verbosity $ "Source dependencies registered "
++ "in the current sandbox ('" ++ sandboxDir ++ "'):\n\n"
mapM_ putStrLn refs
notice verbosity $ "\nTo unregister source dependencies, "
++ "use the 'sandbox delete-source' command."
-- | Entry point for the 'cabal sandbox hc-pkg' command. Invokes the @hc-pkg@
-- tool with provided arguments, restricted to the sandbox. | 879 | false | true | 0 | 14 | 222 | 189 | 88 | 101 | null | null |
ben-schulz/Idris-dev | src/Idris/ASTUtils.hs | bsd-3-clause | -- | TT Context
--
-- This has a terrible name, but I'm not sure of a better one that
-- isn't confusingly close to tt_ctxt
known_terms :: Field IState (Ctxt (Def, Injectivity, Accessibility, Totality, MetaInformation))
known_terms = Field (definitions . tt_ctxt)
(\v state -> state {tt_ctxt = (tt_ctxt state) {definitions = v}}) | 349 | known_terms :: Field IState (Ctxt (Def, Injectivity, Accessibility, Totality, MetaInformation))
known_terms = Field (definitions . tt_ctxt)
(\v state -> state {tt_ctxt = (tt_ctxt state) {definitions = v}}) | 225 | known_terms = Field (definitions . tt_ctxt)
(\v state -> state {tt_ctxt = (tt_ctxt state) {definitions = v}}) | 129 | true | true | 0 | 12 | 72 | 92 | 51 | 41 | null | null |
srenatus/avus | src/Avus.hs | mit | -- | Quasi-main function that is used to run avus in a user-specified way
-- See `examples/avus.hs`.
processScan :: Config -> IO ()
processScan = Dyre.wrapMain Dyre.defaultParams
{ Dyre.projectName = "avus"
, Dyre.realMain = realMain
, Dyre.showError = showError
} | 295 | processScan :: Config -> IO ()
processScan = Dyre.wrapMain Dyre.defaultParams
{ Dyre.projectName = "avus"
, Dyre.realMain = realMain
, Dyre.showError = showError
} | 192 | processScan = Dyre.wrapMain Dyre.defaultParams
{ Dyre.projectName = "avus"
, Dyre.realMain = realMain
, Dyre.showError = showError
} | 161 | true | true | 0 | 7 | 70 | 55 | 31 | 24 | null | null |
mgsloan/ghcjs-jquery | JavaScript/JQuery.hs | mit | pageX :: Event -> IO Double
pageX = jq_pageX | 44 | pageX :: Event -> IO Double
pageX = jq_pageX | 44 | pageX = jq_pageX | 16 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/ExtensionPredicates.hs | bsd-3-clause | -- | Is the <https://www.opengl.org/registry/specs/EXT/texture_sRGB_R8.txt EXT_texture_sRGB_R8> extension supported?
-- Note that in the presence of multiple contexts with different capabilities,
-- this might be wrong. Use 'glGetEXTTextureSRGBR8' in those cases instead.
gl_EXT_texture_sRGB_R8 :: Bool
gl_EXT_texture_sRGB_R8 = member "GL_EXT_texture_sRGB_R8" extensions | 370 | gl_EXT_texture_sRGB_R8 :: Bool
gl_EXT_texture_sRGB_R8 = member "GL_EXT_texture_sRGB_R8" extensions | 98 | gl_EXT_texture_sRGB_R8 = member "GL_EXT_texture_sRGB_R8" extensions | 67 | true | true | 0 | 5 | 38 | 19 | 11 | 8 | null | null |
modeswitch/barrelfish | hake/RuleDefs.hs | mit | --
-- Copy include files to the appropriate directory
--
includeFile :: Options -> String -> HRule
includeFile opts hdr =
Rules [ (Rule [ Str "cp", In SrcTree "src" hdr, Out (optArch opts) hdr ]),
(Rule [ PreDep BuildTree (optArch opts) hdr,
Target (optArch opts) "/include/errors/errno.h" ]
)
] | 353 | includeFile :: Options -> String -> HRule
includeFile opts hdr =
Rules [ (Rule [ Str "cp", In SrcTree "src" hdr, Out (optArch opts) hdr ]),
(Rule [ PreDep BuildTree (optArch opts) hdr,
Target (optArch opts) "/include/errors/errno.h" ]
)
] | 296 | includeFile opts hdr =
Rules [ (Rule [ Str "cp", In SrcTree "src" hdr, Out (optArch opts) hdr ]),
(Rule [ PreDep BuildTree (optArch opts) hdr,
Target (optArch opts) "/include/errors/errno.h" ]
)
] | 254 | true | true | 0 | 12 | 107 | 108 | 56 | 52 | null | null |
erantapaa/haskell-platform | hptool/os-extras/osx/bin/uninstall-hs.hs | bsd-3-clause | -- | FilePath doesn't start with a dot
notDot :: FilePath -> Bool
notDot = not . ("." `isPrefixOf`) . takeFileName | 114 | notDot :: FilePath -> Bool
notDot = not . ("." `isPrefixOf`) . takeFileName | 75 | notDot = not . ("." `isPrefixOf`) . takeFileName | 48 | true | true | 0 | 7 | 20 | 30 | 18 | 12 | null | null |
TomMD/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | dffvExpr (Tick _other e) = dffvExpr e | 40 | dffvExpr (Tick _other e) = dffvExpr e | 40 | dffvExpr (Tick _other e) = dffvExpr e | 40 | false | false | 0 | 6 | 9 | 21 | 9 | 12 | null | null |
GaloisInc/verification-game | web-prover/src/TestRewrite.hs | bsd-3-clause | litProcs = [ binLitProc (:+) (+)
, binLitProc (:*) (*)
, binLitProc (:-) (-)
, binLitProc (:<) (<)
] | 144 | litProcs = [ binLitProc (:+) (+)
, binLitProc (:*) (*)
, binLitProc (:-) (-)
, binLitProc (:<) (<)
] | 144 | litProcs = [ binLitProc (:+) (+)
, binLitProc (:*) (*)
, binLitProc (:-) (-)
, binLitProc (:<) (<)
] | 144 | false | false | 1 | 7 | 62 | 58 | 35 | 23 | null | null |
mboes/hs-asn1 | data/Data/ASN1/BinaryEncoding/Parse.hs | bsd-3-clause | asn1LengthToConst LenIndefinite = Nothing | 41 | asn1LengthToConst LenIndefinite = Nothing | 41 | asn1LengthToConst LenIndefinite = Nothing | 41 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/ByteLengthQueuingStrategy.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy.size Mozilla ByteLengthQueuingStrategy.size documentation>
size :: (MonadDOM m) => ByteLengthQueuingStrategy -> m Double
size self = liftDOM ((self ^. jsf "size" ()) >>= valToNumber) | 264 | size :: (MonadDOM m) => ByteLengthQueuingStrategy -> m Double
size self = liftDOM ((self ^. jsf "size" ()) >>= valToNumber) | 123 | size self = liftDOM ((self ^. jsf "size" ()) >>= valToNumber) | 61 | true | true | 0 | 11 | 26 | 58 | 29 | 29 | null | null |
AndrewRademacher/stack | src/Stack/SDist.hs | bsd-3-clause | dirsFromFiles :: [FilePath] -> [FilePath]
dirsFromFiles dirs = Set.toAscList (Set.delete "." results)
where
results = foldl' (\s -> go s . FP.takeDirectory) Set.empty dirs
go s x
| Set.member x s = s
| otherwise = go (Set.insert x s) (FP.takeDirectory x)
-- | Check package in given tarball. This will log all warnings
-- and will throw an exception in case of critical errors.
--
-- Note that we temporarily decompress the archive to analyze it. | 469 | dirsFromFiles :: [FilePath] -> [FilePath]
dirsFromFiles dirs = Set.toAscList (Set.delete "." results)
where
results = foldl' (\s -> go s . FP.takeDirectory) Set.empty dirs
go s x
| Set.member x s = s
| otherwise = go (Set.insert x s) (FP.takeDirectory x)
-- | Check package in given tarball. This will log all warnings
-- and will throw an exception in case of critical errors.
--
-- Note that we temporarily decompress the archive to analyze it. | 469 | dirsFromFiles dirs = Set.toAscList (Set.delete "." results)
where
results = foldl' (\s -> go s . FP.takeDirectory) Set.empty dirs
go s x
| Set.member x s = s
| otherwise = go (Set.insert x s) (FP.takeDirectory x)
-- | Check package in given tarball. This will log all warnings
-- and will throw an exception in case of critical errors.
--
-- Note that we temporarily decompress the archive to analyze it. | 427 | false | true | 1 | 9 | 99 | 148 | 69 | 79 | null | null |
SimSaladin/animu-watch | src/Library.hs | bsd-3-clause | -- | Search library for titles.
searchAnime :: [Text] -> M [TitleEntity]
searchAnime = db . selectTitles . const . fuzzyTitle | 125 | searchAnime :: [Text] -> M [TitleEntity]
searchAnime = db . selectTitles . const . fuzzyTitle | 93 | searchAnime = db . selectTitles . const . fuzzyTitle | 52 | true | true | 0 | 7 | 20 | 37 | 20 | 17 | null | null |
nakamuray/htig | HTIG/Main.hs | bsd-3-clause | parseArgs' _ ("--help":_) = printHelp >> exitSuccess | 63 | parseArgs' _ ("--help":_) = printHelp >> exitSuccess | 63 | parseArgs' _ ("--help":_) = printHelp >> exitSuccess | 63 | false | false | 0 | 7 | 17 | 22 | 11 | 11 | null | null |
bitemyapp/apply-refact | src/Main.hs | bsd-3-clause | findHsFiles :: FilePath -> IO [FilePath]
findHsFiles = find filterDirectory filterFilename | 90 | findHsFiles :: FilePath -> IO [FilePath]
findHsFiles = find filterDirectory filterFilename | 90 | findHsFiles = find filterDirectory filterFilename | 49 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
SAdams601/ParRegexSearch | test/fst-0.9.0.1/FST/StateMonad.hs | mit | {- **********************************************************
* Functions on the state monad. *
**********************************************************
-}
setState :: State -> STM ()
setState s = STM (\_ -> ((),s)) | 249 | setState :: State -> STM ()
setState s = STM (\_ -> ((),s)) | 59 | setState s = STM (\_ -> ((),s)) | 31 | true | true | 0 | 9 | 55 | 46 | 24 | 22 | null | null |
ryantm/ghc | compiler/cmm/CmmMachOp.hs | bsd-3-clause | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | mo_wordAnd dflags = MO_And (wordWidth dflags) | 50 | false | false | 0 | 7 | 10 | 18 | 8 | 10 | null | null |
ezrakilty/narc | Database/Narc/Eval.hs | bsd-2-clause | -- | eval: Evaluate a typed term in a closing environment. Captures the
-- effects performed by the term. (NB: type info is not actually used;
-- should eliminate this.)
eval :: Env -> TypedTerm -> Value
eval env (Unit, _) = (VUnit) | 232 | eval :: Env -> TypedTerm -> Value
eval env (Unit, _) = (VUnit) | 62 | eval env (Unit, _) = (VUnit) | 28 | true | true | 0 | 9 | 42 | 42 | 22 | 20 | null | null |
conal/shady-graphics | src/Shady/CompileImage.hs | agpl-3.0 | -- | GLSL program for an 'ImageB'.
imageBProg :: HasColor c => ImageB c -> GLSL R1 R2
imageBProg = surfBProg eyePosE . imSurfB | 126 | imageBProg :: HasColor c => ImageB c -> GLSL R1 R2
imageBProg = surfBProg eyePosE . imSurfB | 91 | imageBProg = surfBProg eyePosE . imSurfB | 40 | true | true | 0 | 7 | 23 | 38 | 18 | 20 | null | null |
Feeniks/Agon | app/Agon/Agon.hs | bsd-3-clause | runAgonM = runReaderT | 21 | runAgonM = runReaderT | 21 | runAgonM = runReaderT | 21 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
pfq/PFQ | user/pfqd/src/Main.hs | gpl-2.0 | mkPolicy :: Policy -> Q.GroupPolicy
mkPolicy Shared = Q.policy_shared | 73 | mkPolicy :: Policy -> Q.GroupPolicy
mkPolicy Shared = Q.policy_shared | 73 | mkPolicy Shared = Q.policy_shared | 37 | false | true | 0 | 6 | 12 | 22 | 11 | 11 | null | null |
jsofra/hflock | src/Main.hs | gpl-2.0 | boidPics :: [Boid] -> [Picture]
boidPics boids =
map (\Boid {pos=(x,y), vec=v, col=c} ->
translate x y
$ rotate (radToDeg ((degToRad 270.0) - (argV v)))
$ scale 0.6 0.6
$ boidPicture c) boids | 235 | boidPics :: [Boid] -> [Picture]
boidPics boids =
map (\Boid {pos=(x,y), vec=v, col=c} ->
translate x y
$ rotate (radToDeg ((degToRad 270.0) - (argV v)))
$ scale 0.6 0.6
$ boidPicture c) boids | 235 | boidPics boids =
map (\Boid {pos=(x,y), vec=v, col=c} ->
translate x y
$ rotate (radToDeg ((degToRad 270.0) - (argV v)))
$ scale 0.6 0.6
$ boidPicture c) boids | 203 | false | true | 0 | 17 | 76 | 117 | 62 | 55 | null | null |
wolverian/scheme48 | Main.hs | mit | runOne :: [String] -> IO ()
runOne args = do
env <- do
prims <- primitiveBindings
bindVars prims [("args", List . map String $ tail args)]
result <- runIOThrows $ liftM show $ eval env (List [Atom "load", String (head args)])
hPutStrLn stderr result | 297 | runOne :: [String] -> IO ()
runOne args = do
env <- do
prims <- primitiveBindings
bindVars prims [("args", List . map String $ tail args)]
result <- runIOThrows $ liftM show $ eval env (List [Atom "load", String (head args)])
hPutStrLn stderr result | 297 | runOne args = do
env <- do
prims <- primitiveBindings
bindVars prims [("args", List . map String $ tail args)]
result <- runIOThrows $ liftM show $ eval env (List [Atom "load", String (head args)])
hPutStrLn stderr result | 269 | false | true | 0 | 16 | 91 | 130 | 60 | 70 | null | null |
tolysz/postgresql-simple | src/Database/PostgreSQL/Simple/TypeInfo/Static.hs | bsd-3-clause | varbit :: TypeInfo
varbit = Basic {
typoid = Oid 1562,
typcategory = 'V',
typdelim = ',',
typname = "varbit"
} | 141 | varbit :: TypeInfo
varbit = Basic {
typoid = Oid 1562,
typcategory = 'V',
typdelim = ',',
typname = "varbit"
} | 141 | varbit = Basic {
typoid = Oid 1562,
typcategory = 'V',
typdelim = ',',
typname = "varbit"
} | 122 | false | true | 0 | 7 | 51 | 40 | 24 | 16 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- AMP additions
joinMName, apAName, pureAName, alternativeClassName :: Name
joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey | 151 | joinMName, apAName, pureAName, alternativeClassName :: Name
joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey | 133 | joinMName = varQual gHC_BASE (fsLit "join") joinMIdKey | 72 | true | true | 0 | 7 | 35 | 31 | 19 | 12 | null | null |
asilvestre/haskell-neo4j-rest-client | tests/IntegrationTests.hs | mit | -- | Default Neo4j host
host :: Hostname
host = "localhost" | 59 | host :: Hostname
host = "localhost" | 35 | host = "localhost" | 18 | true | true | 0 | 4 | 10 | 12 | 7 | 5 | null | null |
karamellpelle/grid | source/Game/Run/Iteration/Memory.hs | gpl-3.0 | iterationMemoryMode' :: UInt -> Iteration' RunWorld
iterationMemoryMode' peak =
modeIteration peak noOutput $ defaultStep doMemory $ \peak run b -> do
-- handle Peak
let mem = runMemoryWorld run
peak' = max (runMemoryPeak run) (memoryLevelIx mem)
run' = run { runMemoryPeak = peak' }
-- look at MemoryWorld
case runMemoryStack run' of
-- MemoryMode finished. this should not happen, since we assume
-- an "infinite" (UInt) amount of levels :)
[] -> do
return (run', b, [])
_ -> do
-- handle escape
sceneHandleEscape (runScene run)
(return (run', b, [iterationMemoryMode' peak])) $ do
-- grab screenshot
run'' <- screenshotMemory run'
-- save RunWorld
saveRunWorld run''
-- report score.
-- fixme: this causes the problem that score is only
-- reported if manually escaping from MemoryMode and
-- peak has strictly increased. but new peak is never
-- lost, since it is always written to RunWorld
unless (peak == peak') $ do
sendScore run''
-- comment gameplay
run''' <- commentMemoryEscape run''
return (run''', b, [])
where
setMessage run str =
runMessageClearPush run str
sendScore run = do
let score = 2 * runMemoryPeak run + if runSpecialIsCompleted run
then 1 else 0
playersSendScore valuePlayersScoreMemoryMode (fI score) | 1,870 | iterationMemoryMode' :: UInt -> Iteration' RunWorld
iterationMemoryMode' peak =
modeIteration peak noOutput $ defaultStep doMemory $ \peak run b -> do
-- handle Peak
let mem = runMemoryWorld run
peak' = max (runMemoryPeak run) (memoryLevelIx mem)
run' = run { runMemoryPeak = peak' }
-- look at MemoryWorld
case runMemoryStack run' of
-- MemoryMode finished. this should not happen, since we assume
-- an "infinite" (UInt) amount of levels :)
[] -> do
return (run', b, [])
_ -> do
-- handle escape
sceneHandleEscape (runScene run)
(return (run', b, [iterationMemoryMode' peak])) $ do
-- grab screenshot
run'' <- screenshotMemory run'
-- save RunWorld
saveRunWorld run''
-- report score.
-- fixme: this causes the problem that score is only
-- reported if manually escaping from MemoryMode and
-- peak has strictly increased. but new peak is never
-- lost, since it is always written to RunWorld
unless (peak == peak') $ do
sendScore run''
-- comment gameplay
run''' <- commentMemoryEscape run''
return (run''', b, [])
where
setMessage run str =
runMessageClearPush run str
sendScore run = do
let score = 2 * runMemoryPeak run + if runSpecialIsCompleted run
then 1 else 0
playersSendScore valuePlayersScoreMemoryMode (fI score) | 1,870 | iterationMemoryMode' peak =
modeIteration peak noOutput $ defaultStep doMemory $ \peak run b -> do
-- handle Peak
let mem = runMemoryWorld run
peak' = max (runMemoryPeak run) (memoryLevelIx mem)
run' = run { runMemoryPeak = peak' }
-- look at MemoryWorld
case runMemoryStack run' of
-- MemoryMode finished. this should not happen, since we assume
-- an "infinite" (UInt) amount of levels :)
[] -> do
return (run', b, [])
_ -> do
-- handle escape
sceneHandleEscape (runScene run)
(return (run', b, [iterationMemoryMode' peak])) $ do
-- grab screenshot
run'' <- screenshotMemory run'
-- save RunWorld
saveRunWorld run''
-- report score.
-- fixme: this causes the problem that score is only
-- reported if manually escaping from MemoryMode and
-- peak has strictly increased. but new peak is never
-- lost, since it is always written to RunWorld
unless (peak == peak') $ do
sendScore run''
-- comment gameplay
run''' <- commentMemoryEscape run''
return (run''', b, [])
where
setMessage run str =
runMessageClearPush run str
sendScore run = do
let score = 2 * runMemoryPeak run + if runSpecialIsCompleted run
then 1 else 0
playersSendScore valuePlayersScoreMemoryMode (fI score) | 1,818 | false | true | 1 | 23 | 838 | 326 | 161 | 165 | null | null |
C0DEHERO/Hgamelaunch | Hgamelaunch/Prompts.hs | mit | loginPrompt :: IO (Maybe (Text,Text))
loginPrompt = do
user <- askPrompt "your username"
pass <- askPrompt "your password"
return $ (,) <$> user <*> pass | 159 | loginPrompt :: IO (Maybe (Text,Text))
loginPrompt = do
user <- askPrompt "your username"
pass <- askPrompt "your password"
return $ (,) <$> user <*> pass | 159 | loginPrompt = do
user <- askPrompt "your username"
pass <- askPrompt "your password"
return $ (,) <$> user <*> pass | 121 | false | true | 0 | 10 | 30 | 64 | 31 | 33 | null | null |
Erdwolf/autotool-bonn | src/Haskell/SmallCheck.hs | gpl-2.0 | run :: Testable b
=> Instance
-> ( a -> b )
-> a
-> [[String]]
run i f a =
let p = f a
results = take ( tests_run $ driver i ) $ do
s <- [ 0 .. ]
evaluate p s
failures = take ( failures_shown $ driver i) $ do
res <- results
guard $ ok res == Just False
return $ arguments res
in failures | 390 | run :: Testable b
=> Instance
-> ( a -> b )
-> a
-> [[String]]
run i f a =
let p = f a
results = take ( tests_run $ driver i ) $ do
s <- [ 0 .. ]
evaluate p s
failures = take ( failures_shown $ driver i) $ do
res <- results
guard $ ok res == Just False
return $ arguments res
in failures | 390 | run i f a =
let p = f a
results = take ( tests_run $ driver i ) $ do
s <- [ 0 .. ]
evaluate p s
failures = take ( failures_shown $ driver i) $ do
res <- results
guard $ ok res == Just False
return $ arguments res
in failures | 310 | false | true | 0 | 14 | 174 | 167 | 78 | 89 | null | null |
h-core/haskell-random | palindrome.hs | mit | numstrings (x:xs) = [x | x <- show x] : numstrings xs | 53 | numstrings (x:xs) = [x | x <- show x] : numstrings xs | 53 | numstrings (x:xs) = [x | x <- show x] : numstrings xs | 53 | false | false | 0 | 9 | 11 | 37 | 18 | 19 | null | null |
green-haskell/ghc | compiler/simplCore/CallArity.hs | bsd-3-clause | resDel :: Var -> CallArityRes -> CallArityRes
resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 98 | resDel :: Var -> CallArityRes -> CallArityRes
resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 98 | resDel v (g, ae) = (g `delNode` v, ae `delVarEnv` v) | 52 | false | true | 0 | 6 | 17 | 48 | 28 | 20 | null | null |
fibsifan/pandoc | src/Text/Pandoc/Readers/Org.hs | gpl-2.0 | commaEscaped :: String -> String
commaEscaped (',':cs@('*':_)) = cs | 71 | commaEscaped :: String -> String
commaEscaped (',':cs@('*':_)) = cs | 71 | commaEscaped (',':cs@('*':_)) = cs | 38 | false | true | 1 | 12 | 12 | 43 | 20 | 23 | null | null |
GaloisInc/galua | galua/src/Galua/Arguments.hs | mit | boolArgument :: VM -> Int -> SV.SizedVector Value -> IO Bool
boolArgument vm i args =
do mb <- select vm i args
case mb of
Just x -> return (valueBool x)
Nothing -> return False | 198 | boolArgument :: VM -> Int -> SV.SizedVector Value -> IO Bool
boolArgument vm i args =
do mb <- select vm i args
case mb of
Just x -> return (valueBool x)
Nothing -> return False | 198 | boolArgument vm i args =
do mb <- select vm i args
case mb of
Just x -> return (valueBool x)
Nothing -> return False | 137 | false | true | 0 | 13 | 56 | 91 | 40 | 51 | null | null |
mrkkrp/stack | src/Stack/Constants.hs | bsd-3-clause | -- | Deprecated option name for the global stack root.
--
-- Deprecated since stack-1.1.0.
--
-- TODO: Remove occurences of this variable and use 'stackRootOptionName' only
-- after an appropriate deprecation period.
deprecatedStackRootOptionName :: String
deprecatedStackRootOptionName = "global-stack-root" | 308 | deprecatedStackRootOptionName :: String
deprecatedStackRootOptionName = "global-stack-root" | 91 | deprecatedStackRootOptionName = "global-stack-root" | 51 | true | true | 0 | 4 | 38 | 17 | 12 | 5 | null | null |
peter-fogg/pardoc | src/Text/Pandoc/Readers/Docx.hs | gpl-2.0 | bodyPartToBlocks :: BodyPart -> DocxContext Blocks
bodyPartToBlocks (Paragraph pPr parparts)
| not $ null $ codeDivs `intersect` (pStyle pPr) =
return
$ parStyleToTransform pPr
$ codeBlock
$ concatMap parPartToString parparts
| Just (style, n) <- pHeading pPr = do
ils <- local (\s-> s{docxInHeaderBlock=True}) $
(concatReduce <$> mapM parPartToInlines parparts)
makeHeaderAnchor $
headerWith ("", delete style (pStyle pPr), []) n ils
| otherwise = do
ils <- concatReduce <$> mapM parPartToInlines parparts >>=
(return . fromList . trimLineBreaks . normalizeSpaces . toList)
dropIls <- gets docxDropCap
let ils' = dropIls <> ils
if dropCap pPr
then do modify $ \s -> s { docxDropCap = ils' }
return mempty
else do modify $ \s -> s { docxDropCap = mempty }
return $ case isNull ils' of
True -> mempty
_ -> parStyleToTransform pPr $ para ils' | 986 | bodyPartToBlocks :: BodyPart -> DocxContext Blocks
bodyPartToBlocks (Paragraph pPr parparts)
| not $ null $ codeDivs `intersect` (pStyle pPr) =
return
$ parStyleToTransform pPr
$ codeBlock
$ concatMap parPartToString parparts
| Just (style, n) <- pHeading pPr = do
ils <- local (\s-> s{docxInHeaderBlock=True}) $
(concatReduce <$> mapM parPartToInlines parparts)
makeHeaderAnchor $
headerWith ("", delete style (pStyle pPr), []) n ils
| otherwise = do
ils <- concatReduce <$> mapM parPartToInlines parparts >>=
(return . fromList . trimLineBreaks . normalizeSpaces . toList)
dropIls <- gets docxDropCap
let ils' = dropIls <> ils
if dropCap pPr
then do modify $ \s -> s { docxDropCap = ils' }
return mempty
else do modify $ \s -> s { docxDropCap = mempty }
return $ case isNull ils' of
True -> mempty
_ -> parStyleToTransform pPr $ para ils' | 986 | bodyPartToBlocks (Paragraph pPr parparts)
| not $ null $ codeDivs `intersect` (pStyle pPr) =
return
$ parStyleToTransform pPr
$ codeBlock
$ concatMap parPartToString parparts
| Just (style, n) <- pHeading pPr = do
ils <- local (\s-> s{docxInHeaderBlock=True}) $
(concatReduce <$> mapM parPartToInlines parparts)
makeHeaderAnchor $
headerWith ("", delete style (pStyle pPr), []) n ils
| otherwise = do
ils <- concatReduce <$> mapM parPartToInlines parparts >>=
(return . fromList . trimLineBreaks . normalizeSpaces . toList)
dropIls <- gets docxDropCap
let ils' = dropIls <> ils
if dropCap pPr
then do modify $ \s -> s { docxDropCap = ils' }
return mempty
else do modify $ \s -> s { docxDropCap = mempty }
return $ case isNull ils' of
True -> mempty
_ -> parStyleToTransform pPr $ para ils' | 935 | false | true | 1 | 16 | 282 | 347 | 169 | 178 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Clusters/Delete.hs | mpl-2.0 | -- | Required. The Dataproc region in which to handle the request.
prcdRegion :: Lens' ProjectsRegionsClustersDelete Text
prcdRegion
= lens _prcdRegion (\ s a -> s{_prcdRegion = a}) | 183 | prcdRegion :: Lens' ProjectsRegionsClustersDelete Text
prcdRegion
= lens _prcdRegion (\ s a -> s{_prcdRegion = a}) | 116 | prcdRegion
= lens _prcdRegion (\ s a -> s{_prcdRegion = a}) | 61 | true | true | 0 | 9 | 29 | 43 | 22 | 21 | null | null |
ennocramer/hindent | src/HIndent/Pretty.hs | bsd-3-clause | decl (InlineSig _ inline _ name) = do
write "{-# "
unless inline $ write "NO"
write "INLINE "
pretty name
write " #-}" | 130 | decl (InlineSig _ inline _ name) = do
write "{-# "
unless inline $ write "NO"
write "INLINE "
pretty name
write " #-}" | 130 | decl (InlineSig _ inline _ name) = do
write "{-# "
unless inline $ write "NO"
write "INLINE "
pretty name
write " #-}" | 130 | false | false | 0 | 8 | 35 | 58 | 23 | 35 | null | null |
thomasjm/hrtree | Util.hs | mit | getLHV (LeafNode idRects) = maximum $ map (hilbertDistanceOfRect . getRect) idRects | 83 | getLHV (LeafNode idRects) = maximum $ map (hilbertDistanceOfRect . getRect) idRects | 83 | getLHV (LeafNode idRects) = maximum $ map (hilbertDistanceOfRect . getRect) idRects | 83 | false | false | 0 | 8 | 10 | 31 | 15 | 16 | null | null |
PerinatalLab/library_of_functions | neuralnetwork.hs | mit | -- ([weights], b) [predictors] -> ([weights], b, [[activations]])
feedForward :: ([Double], Double) -> [Double] -> [[Double]]
feedForward (wts, b) preds = [preds, [activate(weigh preds wts b)]] | 195 | feedForward :: ([Double], Double) -> [Double] -> [[Double]]
feedForward (wts, b) preds = [preds, [activate(weigh preds wts b)]] | 127 | feedForward (wts, b) preds = [preds, [activate(weigh preds wts b)]] | 67 | true | true | 0 | 9 | 27 | 71 | 41 | 30 | null | null |
AndrewRademacher/scotty-cass-test | src/Actions/User.hs | mit | putUser = undefined | 19 | putUser = undefined | 19 | putUser = undefined | 19 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
eallik/ghcjs-famous | src/JavaScript/Famous/Highlevel.hs | mit | addToRenderNode β· Renderable (JSRef r) β JSRef r β RenderNode β IO RenderNode
addToRenderNode = fms_RenderNode_add | 114 | addToRenderNode β· Renderable (JSRef r) β JSRef r β RenderNode β IO RenderNode
addToRenderNode = fms_RenderNode_add | 114 | addToRenderNode = fms_RenderNode_add | 36 | false | true | 0 | 8 | 15 | 38 | 18 | 20 | null | null |
yliu120/K3 | src/Language/K3/TypeSystem/Manifestation/BranchSemiElimination.hs | apache-2.0 | _getBoundConstructor :: ( ConstraintConstructor2 a b
, ConstraintConstructor2 b a)
=> BoundType -> a -> b -> Constraint
_getBoundConstructor LowerBound = (<:) | 203 | _getBoundConstructor :: ( ConstraintConstructor2 a b
, ConstraintConstructor2 b a)
=> BoundType -> a -> b -> Constraint
_getBoundConstructor LowerBound = (<:) | 203 | _getBoundConstructor LowerBound = (<:) | 38 | false | true | 0 | 8 | 66 | 47 | 25 | 22 | null | null |
bwalkowi/RBT | dist/build/autogen/Paths_cloud.hs | bsd-3-clause | catchIO = Exception.catch | 25 | catchIO = Exception.catch | 25 | catchIO = Exception.catch | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
gwright83/Wheeler | src/Math/Symbolic/Wheeler/Canonicalize.hs | bsd-3-clause | isDivideByZero :: Expr -> Bool
isDivideByZero (Const (Q _ 0)) = True | 68 | isDivideByZero :: Expr -> Bool
isDivideByZero (Const (Q _ 0)) = True | 68 | isDivideByZero (Const (Q _ 0)) = True | 37 | false | true | 0 | 9 | 11 | 32 | 16 | 16 | null | null |
Gabriel439/fficxx | lib/FFICXX/Generate/Code/Cpp.hs | bsd-2-clause | -----
-----------------
genAllCppHeaderInclude :: ClassImportHeader -> String
genAllCppHeaderInclude header =
intercalateWith connRet (\x->"#include \""++x++"\"") $
cihIncludedHPkgHeadersInCPP header
++ cihIncludedCPkgHeaders header | 255 | genAllCppHeaderInclude :: ClassImportHeader -> String
genAllCppHeaderInclude header =
intercalateWith connRet (\x->"#include \""++x++"\"") $
cihIncludedHPkgHeadersInCPP header
++ cihIncludedCPkgHeaders header | 227 | genAllCppHeaderInclude header =
intercalateWith connRet (\x->"#include \""++x++"\"") $
cihIncludedHPkgHeadersInCPP header
++ cihIncludedCPkgHeaders header | 173 | true | true | 2 | 9 | 42 | 60 | 29 | 31 | null | null |
ygale/yesod | yesod-core/Yesod/Routes/TH/RenderRoute.hs | mit | -- | A more general version of 'mkRenderRouteInstance' which takes an
-- additional context.
mkRenderRouteInstance' :: Cxt -> Type -> [ResourceTree Type] -> Q [Dec]
mkRenderRouteInstance' cxt typ ress = do
cls <- mkRenderRouteClauses ress
let (cons, decs) = mkRouteCons ress
return $ InstanceD cxt (ConT ''RenderRoute `AppT` typ)
[ DataInstD [] ''Route [typ] cons clazzes
, FunD (mkName "renderRoute") cls
] : decs
where
clazzes = [''Show, ''Eq, ''Read] | 496 | mkRenderRouteInstance' :: Cxt -> Type -> [ResourceTree Type] -> Q [Dec]
mkRenderRouteInstance' cxt typ ress = do
cls <- mkRenderRouteClauses ress
let (cons, decs) = mkRouteCons ress
return $ InstanceD cxt (ConT ''RenderRoute `AppT` typ)
[ DataInstD [] ''Route [typ] cons clazzes
, FunD (mkName "renderRoute") cls
] : decs
where
clazzes = [''Show, ''Eq, ''Read] | 402 | mkRenderRouteInstance' cxt typ ress = do
cls <- mkRenderRouteClauses ress
let (cons, decs) = mkRouteCons ress
return $ InstanceD cxt (ConT ''RenderRoute `AppT` typ)
[ DataInstD [] ''Route [typ] cons clazzes
, FunD (mkName "renderRoute") cls
] : decs
where
clazzes = [''Show, ''Eq, ''Read] | 330 | true | true | 0 | 13 | 112 | 163 | 83 | 80 | null | null |
eugenkiss/loopgotowhile | src/Language/LoopGotoWhile/While/Transform.hs | bsd-3-clause | -- v0 := v1
toStrictStat' (Assign v0 (Var v1)) = return $
Assign v0 (AOp "+" (Var v1) (Const 0)) | 100 | toStrictStat' (Assign v0 (Var v1)) = return $
Assign v0 (AOp "+" (Var v1) (Const 0)) | 88 | toStrictStat' (Assign v0 (Var v1)) = return $
Assign v0 (AOp "+" (Var v1) (Const 0)) | 88 | true | false | 0 | 10 | 23 | 55 | 27 | 28 | null | null |
noteed/humming | bin/humming.hs | bsd-3-clause | main :: IO ()
main = (runCmd =<<) $ cmdArgs $
modes
[ cmdCreate
, cmdDrop
, cmdEnqueue
, cmdCount
, cmdDelete
, cmdLock
, cmdUnlockDeads
, cmdListen
, cmdNotify
, cmdWork
, cmdSchedule
, cmdPlan
]
&= summary versionString
&= program "humming" | 300 | main :: IO ()
main = (runCmd =<<) $ cmdArgs $
modes
[ cmdCreate
, cmdDrop
, cmdEnqueue
, cmdCount
, cmdDelete
, cmdLock
, cmdUnlockDeads
, cmdListen
, cmdNotify
, cmdWork
, cmdSchedule
, cmdPlan
]
&= summary versionString
&= program "humming" | 300 | main = (runCmd =<<) $ cmdArgs $
modes
[ cmdCreate
, cmdDrop
, cmdEnqueue
, cmdCount
, cmdDelete
, cmdLock
, cmdUnlockDeads
, cmdListen
, cmdNotify
, cmdWork
, cmdSchedule
, cmdPlan
]
&= summary versionString
&= program "humming" | 286 | false | true | 4 | 7 | 100 | 85 | 48 | 37 | null | null |
jtapolczai/wumpus | Agent/Intelligent/Perception.hs | apache-2.0 | perception _ _ (MsgGlobalPerception d) =
[AMTemperature $ d ^. temperature,
AMTime $ d ^. time] | 102 | perception _ _ (MsgGlobalPerception d) =
[AMTemperature $ d ^. temperature,
AMTime $ d ^. time] | 102 | perception _ _ (MsgGlobalPerception d) =
[AMTemperature $ d ^. temperature,
AMTime $ d ^. time] | 102 | false | false | 0 | 7 | 22 | 41 | 21 | 20 | null | null |
cessationoftime/leksah | src/IDE/TextEditor/CodeMirror.hs | gpl-2.0 | codeMirror :: CM JSObjectRef
codeMirror = cmObject . snd <$> ask | 64 | codeMirror :: CM JSObjectRef
codeMirror = cmObject . snd <$> ask | 64 | codeMirror = cmObject . snd <$> ask | 35 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.