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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lfairy/robot | Test/Robot/Internal/XTest.hs | apache-2.0 | -- | Split the input list into chunks of size @k@. The last chunk may be
-- shorter than the other chunks, depending on the length of the input.
-- Exammples:
--
-- > chunksOf 2 [1..6] == [[1, 2], [3, 4], [5, 6]]
-- > chunksOf 3 "Hello, world!" == ["Hel", "lo,", " wo", "rld", "!"]
--
chunksOf :: Int -> [a] -> [[a]]
chunksOf k = unfoldr $ \xs -> case xs of
[] -> Nothing
_ -> Just (splitAt k xs)
-- | Return a structure mapping keysyms to their keycode. | 465 | chunksOf :: Int -> [a] -> [[a]]
chunksOf k = unfoldr $ \xs -> case xs of
[] -> Nothing
_ -> Just (splitAt k xs)
-- | Return a structure mapping keysyms to their keycode. | 180 | chunksOf k = unfoldr $ \xs -> case xs of
[] -> Nothing
_ -> Just (splitAt k xs)
-- | Return a structure mapping keysyms to their keycode. | 148 | true | true | 0 | 12 | 104 | 77 | 44 | 33 | null | null |
GaloisInc/galua | galua/src/Galua/Names/Eval.hs | mit | lookupInTable :: NameResolveEnv -> Value -> Reference (Table Value) -> IO Value
lookupInTable eenv key ref =
do res <- getTableRaw (referenceVal ref) key
case res of
Nil -> indexFromMetaTable eenv False (Table ref) key
v -> return v | 255 | lookupInTable :: NameResolveEnv -> Value -> Reference (Table Value) -> IO Value
lookupInTable eenv key ref =
do res <- getTableRaw (referenceVal ref) key
case res of
Nil -> indexFromMetaTable eenv False (Table ref) key
v -> return v | 255 | lookupInTable eenv key ref =
do res <- getTableRaw (referenceVal ref) key
case res of
Nil -> indexFromMetaTable eenv False (Table ref) key
v -> return v | 175 | false | true | 0 | 12 | 61 | 97 | 45 | 52 | null | null |
haskell-tinc/hpack | test/Hpack/ConfigSpec.hs | mit | withPackageConfig_ :: String -> (Package -> Expectation) -> Expectation
withPackageConfig_ content = withPackageConfig content (return ()) | 138 | withPackageConfig_ :: String -> (Package -> Expectation) -> Expectation
withPackageConfig_ content = withPackageConfig content (return ()) | 138 | withPackageConfig_ content = withPackageConfig content (return ()) | 66 | false | true | 0 | 9 | 15 | 47 | 22 | 25 | null | null |
mbudde/jana | src/Jana/Error.hs | bsd-3-clause | newFileError :: String -> Message -> JanaError
newFileError filename
= newErrorMessage (newPos filename 0 0) | 110 | newFileError :: String -> Message -> JanaError
newFileError filename
= newErrorMessage (newPos filename 0 0) | 110 | newFileError filename
= newErrorMessage (newPos filename 0 0) | 63 | false | true | 0 | 7 | 16 | 35 | 17 | 18 | null | null |
nevrenato/Hets_Fork | CommonLogic/Analysis.hs | gpl-2.0 | propsOfPhrase (AS.Comment_text _ txt _) = propsOfFormula txt | 60 | propsOfPhrase (AS.Comment_text _ txt _) = propsOfFormula txt | 60 | propsOfPhrase (AS.Comment_text _ txt _) = propsOfFormula txt | 60 | false | false | 0 | 8 | 7 | 24 | 11 | 13 | null | null |
jystic/pointfree | Plugin/Pl/Transform.hs | mit | transform :: Expr -> Expr
transform = transform' . alphaRename . unLet | 70 | transform :: Expr -> Expr
transform = transform' . alphaRename . unLet | 70 | transform = transform' . alphaRename . unLet | 44 | false | true | 0 | 6 | 11 | 23 | 12 | 11 | null | null |
jean-edouard/manager | disksync/Types.hs | gpl-2.0 | stringOfReason ImageFailLocalChecksumNotFoundUsb = "local-checksum-not-found-usb" | 81 | stringOfReason ImageFailLocalChecksumNotFoundUsb = "local-checksum-not-found-usb" | 81 | stringOfReason ImageFailLocalChecksumNotFoundUsb = "local-checksum-not-found-usb" | 81 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Pochoir/Pochoir | src/PShow.hs | gpl-3.0 | transStmts :: [Stmt] -> (Expr -> Expr) -> [Stmt]
transStmts [] _ = [] | 69 | transStmts :: [Stmt] -> (Expr -> Expr) -> [Stmt]
transStmts [] _ = [] | 69 | transStmts [] _ = [] | 20 | false | true | 0 | 9 | 13 | 47 | 23 | 24 | null | null |
best-coloc-ever/twitch-cast | streamer/app/Server/Stream.hs | mit | insertStream :: Stream -> ServerState -> ServerState
insertStream stream state@ServerState{streams} =
state { streams = insert (stream # channel) stream streams } | 164 | insertStream :: Stream -> ServerState -> ServerState
insertStream stream state@ServerState{streams} =
state { streams = insert (stream # channel) stream streams } | 164 | insertStream stream state@ServerState{streams} =
state { streams = insert (stream # channel) stream streams } | 111 | false | true | 0 | 10 | 23 | 63 | 31 | 32 | null | null |
emwap/feldspar-language | make_travis_yml.hs | bsd-3-clause | putStrLnInfo :: String -> IO ()
putStrLnInfo m = hPutStrLn stderr ("*INFO* " ++ m) | 82 | putStrLnInfo :: String -> IO ()
putStrLnInfo m = hPutStrLn stderr ("*INFO* " ++ m) | 82 | putStrLnInfo m = hPutStrLn stderr ("*INFO* " ++ m) | 50 | false | true | 0 | 7 | 14 | 35 | 17 | 18 | null | null |
plow-technologies/live-vdom | src/LiveVDom/TH.hs | mit | toLiveVDomTH (PLiveInterpText t) = return $ AppE (VarE 'buildLiveVText) t | 73 | toLiveVDomTH (PLiveInterpText t) = return $ AppE (VarE 'buildLiveVText) t | 73 | toLiveVDomTH (PLiveInterpText t) = return $ AppE (VarE 'buildLiveVText) t | 73 | false | false | 0 | 8 | 9 | 31 | 15 | 16 | null | null |
brendanhay/gogol | gogol-dialogflow/gen/Network/Google/Resource/DialogFlow/Projects/Locations/Agents/Flows/Pages/Create.hs | mpl-2.0 | -- | V1 error format.
plafpcXgafv :: Lens' ProjectsLocationsAgentsFlowsPagesCreate (Maybe Xgafv)
plafpcXgafv
= lens _plafpcXgafv (\ s a -> s{_plafpcXgafv = a}) | 161 | plafpcXgafv :: Lens' ProjectsLocationsAgentsFlowsPagesCreate (Maybe Xgafv)
plafpcXgafv
= lens _plafpcXgafv (\ s a -> s{_plafpcXgafv = a}) | 139 | plafpcXgafv
= lens _plafpcXgafv (\ s a -> s{_plafpcXgafv = a}) | 64 | true | true | 0 | 9 | 23 | 48 | 25 | 23 | null | null |
peter-fogg/pardoc | src/Text/Pandoc/Writers/Man.hs | gpl-2.0 | inlineToMan opts (Math InlineMath str) =
inlineListToMan opts $ texMathToInlines InlineMath str | 97 | inlineToMan opts (Math InlineMath str) =
inlineListToMan opts $ texMathToInlines InlineMath str | 97 | inlineToMan opts (Math InlineMath str) =
inlineListToMan opts $ texMathToInlines InlineMath str | 97 | false | false | 0 | 7 | 13 | 31 | 14 | 17 | null | null |
massysett/pipes-cliff | pipes-cliff/lib/Pipes/Cliff/Core.hs | bsd-3-clause | convertCmdSpec :: CmdSpec -> Process.CmdSpec
convertCmdSpec (ShellCommand s) = Process.ShellCommand s | 101 | convertCmdSpec :: CmdSpec -> Process.CmdSpec
convertCmdSpec (ShellCommand s) = Process.ShellCommand s | 101 | convertCmdSpec (ShellCommand s) = Process.ShellCommand s | 56 | false | true | 0 | 6 | 10 | 35 | 16 | 19 | null | null |
ekmett/ghc | compiler/llvmGen/Llvm/PpLlvm.hs | bsd-3-clause | -- | Print out a list of LLVM metadata.
ppLlvmMetas :: [MetaDecl] -> SDoc
ppLlvmMetas metas = vcat $ map ppLlvmMeta metas | 121 | ppLlvmMetas :: [MetaDecl] -> SDoc
ppLlvmMetas metas = vcat $ map ppLlvmMeta metas | 81 | ppLlvmMetas metas = vcat $ map ppLlvmMeta metas | 47 | true | true | 0 | 6 | 21 | 31 | 16 | 15 | null | null |
jordanemedlock/fungen | Graphics/UI/Fungen/Util.hs | bsd-3-clause | addNoInvisibility (a:as) = (a, Nothing):(addNoInvisibility as) | 62 | addNoInvisibility (a:as) = (a, Nothing):(addNoInvisibility as) | 62 | addNoInvisibility (a:as) = (a, Nothing):(addNoInvisibility as) | 62 | false | false | 0 | 7 | 5 | 33 | 17 | 16 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpHasSideEffects UnsafeFreezeByteArrayOp = True | 51 | primOpHasSideEffects UnsafeFreezeByteArrayOp = True | 51 | primOpHasSideEffects UnsafeFreezeByteArrayOp = True | 51 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
khajavi/pandoc | src/Text/Pandoc/Readers/Markdown.hs | gpl-2.0 | superscript :: GenParser Char ParserState Inline
superscript = failIfStrict >> enclosed (char '^') (char '^')
(notFollowedBy spaceChar >> inline) >>= -- may not contain Space
return . Superscript | 224 | superscript :: GenParser Char ParserState Inline
superscript = failIfStrict >> enclosed (char '^') (char '^')
(notFollowedBy spaceChar >> inline) >>= -- may not contain Space
return . Superscript | 224 | superscript = failIfStrict >> enclosed (char '^') (char '^')
(notFollowedBy spaceChar >> inline) >>= -- may not contain Space
return . Superscript | 175 | false | true | 1 | 9 | 56 | 65 | 30 | 35 | null | null |
sumitsahrawat/IHaskell | ihaskell-display/ihaskell-widgets/src/IHaskell/Display/Widgets/Types.hs | mit | -- | Store a numeric value, with verification mechanism for its range.
ranged :: (SingI f, Num (FieldType f), Ord (FieldType f), Typeable (FieldType f))
=> Sing f -> (FieldType f, FieldType f) -> AttrVal (FieldType f) -> Attr f
ranged s range x = Attr x (rangeCheck range) (reflect s) | 291 | ranged :: (SingI f, Num (FieldType f), Ord (FieldType f), Typeable (FieldType f))
=> Sing f -> (FieldType f, FieldType f) -> AttrVal (FieldType f) -> Attr f
ranged s range x = Attr x (rangeCheck range) (reflect s) | 220 | ranged s range x = Attr x (rangeCheck range) (reflect s) | 56 | true | true | 0 | 11 | 57 | 122 | 60 | 62 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT21.hs | gpl-3.0 | False || x = x | 14 | False || x = x | 14 | False || x = x | 14 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
mvr/cf | src/Math/ContinuedFraction.hs | mit | hom (n0, _n1,
d0, _d1) (CF []) = valueToCF $ frac (n0, d0) | 63 | hom (n0, _n1,
d0, _d1) (CF []) = valueToCF $ frac (n0, d0) | 63 | hom (n0, _n1,
d0, _d1) (CF []) = valueToCF $ frac (n0, d0) | 63 | false | false | 1 | 9 | 17 | 47 | 24 | 23 | null | null |
pbl64k/HackerRank-Contests | 2014-10-10-FP/Infer/i.accepted.hs | bsd-2-clause | env_vt = [
--("fix", Arr [Arr [FVar 0] (FVar 0)] (FVar 0)),
("head", Arr [List (FVar 0)] (FVar 0)),
("tail", Arr [List (FVar 0)] (List (FVar 0))),
("nil", List (FVar 0)),
("cons", Arr [FVar 0, List (FVar 0)] (List (FVar 0))),
("cons_curry", Arr [FVar 0] (Arr [List (FVar 0)] (List (FVar 0)))),
("map", Arr [Arr [FVar 0] (FVar 1), List (FVar 0)] (List (FVar 1))),
("map_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [List (FVar 0)] (List (FVar 1)))),
("one", Int),
("zero", Int),
("succ", Arr [Int] Int),
("plus", Arr [Int, Int] Int),
("eq", Arr [FVar 0, FVar 0] Bool),
("eq_curry", Arr [FVar 0] (Arr [FVar 0] Bool)),
("not", Arr [Bool] Bool),
("true", Bool),
("false", Bool),
("pair", Arr [FVar 0, FVar 1] (Pair (FVar 0) (FVar 1))),
("pair_curry", Arr [FVar 0] (Arr [FVar 1] (Pair (FVar 0) (FVar 1)))),
("first", Arr [Pair (FVar 0) (FVar 1)] (FVar 0)),
("second", Arr [Pair (FVar 0) (FVar 1)] (FVar 1)),
("id", Arr [FVar 0] (FVar 0)),
("const", Arr [FVar 0] (Arr [FVar 1] (FVar 0))),
("apply", Arr [Arr [FVar 0] (FVar 1), FVar 0] (FVar 1)),
("apply_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [FVar 0] (FVar 1))),
("choose", Arr [FVar 0, FVar 0] (FVar 0)),
("choose_curry", Arr [FVar 0] (Arr [FVar 0] (FVar 0)))
] | 1,317 | env_vt = [
--("fix", Arr [Arr [FVar 0] (FVar 0)] (FVar 0)),
("head", Arr [List (FVar 0)] (FVar 0)),
("tail", Arr [List (FVar 0)] (List (FVar 0))),
("nil", List (FVar 0)),
("cons", Arr [FVar 0, List (FVar 0)] (List (FVar 0))),
("cons_curry", Arr [FVar 0] (Arr [List (FVar 0)] (List (FVar 0)))),
("map", Arr [Arr [FVar 0] (FVar 1), List (FVar 0)] (List (FVar 1))),
("map_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [List (FVar 0)] (List (FVar 1)))),
("one", Int),
("zero", Int),
("succ", Arr [Int] Int),
("plus", Arr [Int, Int] Int),
("eq", Arr [FVar 0, FVar 0] Bool),
("eq_curry", Arr [FVar 0] (Arr [FVar 0] Bool)),
("not", Arr [Bool] Bool),
("true", Bool),
("false", Bool),
("pair", Arr [FVar 0, FVar 1] (Pair (FVar 0) (FVar 1))),
("pair_curry", Arr [FVar 0] (Arr [FVar 1] (Pair (FVar 0) (FVar 1)))),
("first", Arr [Pair (FVar 0) (FVar 1)] (FVar 0)),
("second", Arr [Pair (FVar 0) (FVar 1)] (FVar 1)),
("id", Arr [FVar 0] (FVar 0)),
("const", Arr [FVar 0] (Arr [FVar 1] (FVar 0))),
("apply", Arr [Arr [FVar 0] (FVar 1), FVar 0] (FVar 1)),
("apply_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [FVar 0] (FVar 1))),
("choose", Arr [FVar 0, FVar 0] (FVar 0)),
("choose_curry", Arr [FVar 0] (Arr [FVar 0] (FVar 0)))
] | 1,317 | env_vt = [
--("fix", Arr [Arr [FVar 0] (FVar 0)] (FVar 0)),
("head", Arr [List (FVar 0)] (FVar 0)),
("tail", Arr [List (FVar 0)] (List (FVar 0))),
("nil", List (FVar 0)),
("cons", Arr [FVar 0, List (FVar 0)] (List (FVar 0))),
("cons_curry", Arr [FVar 0] (Arr [List (FVar 0)] (List (FVar 0)))),
("map", Arr [Arr [FVar 0] (FVar 1), List (FVar 0)] (List (FVar 1))),
("map_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [List (FVar 0)] (List (FVar 1)))),
("one", Int),
("zero", Int),
("succ", Arr [Int] Int),
("plus", Arr [Int, Int] Int),
("eq", Arr [FVar 0, FVar 0] Bool),
("eq_curry", Arr [FVar 0] (Arr [FVar 0] Bool)),
("not", Arr [Bool] Bool),
("true", Bool),
("false", Bool),
("pair", Arr [FVar 0, FVar 1] (Pair (FVar 0) (FVar 1))),
("pair_curry", Arr [FVar 0] (Arr [FVar 1] (Pair (FVar 0) (FVar 1)))),
("first", Arr [Pair (FVar 0) (FVar 1)] (FVar 0)),
("second", Arr [Pair (FVar 0) (FVar 1)] (FVar 1)),
("id", Arr [FVar 0] (FVar 0)),
("const", Arr [FVar 0] (Arr [FVar 1] (FVar 0))),
("apply", Arr [Arr [FVar 0] (FVar 1), FVar 0] (FVar 1)),
("apply_curry", Arr [Arr [FVar 0] (FVar 1)] (Arr [FVar 0] (FVar 1))),
("choose", Arr [FVar 0, FVar 0] (FVar 0)),
("choose_curry", Arr [FVar 0] (Arr [FVar 0] (FVar 0)))
] | 1,317 | false | false | 0 | 13 | 323 | 883 | 472 | 411 | null | null |
gbaz/haskell-platform | hptool/src/Main.hs | bsd-3-clause | flags :: [OptDescr (Either a Flags)]
flags = [ Option ['i'] ["info"] (NoArg $ Right Info)
"Show info on what gets included in this HP release"
, Option [] ["prefix"] (ReqArg (Right . Prefix) "DIR")
"Set installation prefix (only for Posix builds)"
, Option ['f'] ["full"] (NoArg $ Right Full)
"Do a full (rather than minimal) build of the platform."
] | 438 | flags :: [OptDescr (Either a Flags)]
flags = [ Option ['i'] ["info"] (NoArg $ Right Info)
"Show info on what gets included in this HP release"
, Option [] ["prefix"] (ReqArg (Right . Prefix) "DIR")
"Set installation prefix (only for Posix builds)"
, Option ['f'] ["full"] (NoArg $ Right Full)
"Do a full (rather than minimal) build of the platform."
] | 438 | flags = [ Option ['i'] ["info"] (NoArg $ Right Info)
"Show info on what gets included in this HP release"
, Option [] ["prefix"] (ReqArg (Right . Prefix) "DIR")
"Set installation prefix (only for Posix builds)"
, Option ['f'] ["full"] (NoArg $ Right Full)
"Do a full (rather than minimal) build of the platform."
] | 401 | false | true | 0 | 10 | 147 | 113 | 60 | 53 | null | null |
daniel-j-h/hosrm-qa | src/Args.hs | bsd-3-clause | fetchOptionsParser :: ParserInfo FetchOptions
fetchOptionsParser = info (helper <*> arguments) (fullDesc <> progDesc "Fetch Routes")
where
arguments = FetchOptions
<$> (T.pack <$> strOption (long "host" <> help "Server Host") <|> pure "router.project-osrm.org")
<*> (option auto (long "port" <> help "Server Port") <|> pure 80)
<*> (T.pack <$> strOption (long "store" <> help "Store Path") <|> pure "store.sqlite3") | 451 | fetchOptionsParser :: ParserInfo FetchOptions
fetchOptionsParser = info (helper <*> arguments) (fullDesc <> progDesc "Fetch Routes")
where
arguments = FetchOptions
<$> (T.pack <$> strOption (long "host" <> help "Server Host") <|> pure "router.project-osrm.org")
<*> (option auto (long "port" <> help "Server Port") <|> pure 80)
<*> (T.pack <$> strOption (long "store" <> help "Store Path") <|> pure "store.sqlite3") | 451 | fetchOptionsParser = info (helper <*> arguments) (fullDesc <> progDesc "Fetch Routes")
where
arguments = FetchOptions
<$> (T.pack <$> strOption (long "host" <> help "Server Host") <|> pure "router.project-osrm.org")
<*> (option auto (long "port" <> help "Server Port") <|> pure 80)
<*> (T.pack <$> strOption (long "store" <> help "Store Path") <|> pure "store.sqlite3") | 405 | false | true | 10 | 12 | 92 | 162 | 75 | 87 | null | null |
uduki/hsQt | Qtc/Enums/Gui/QFont.hs | bsd-2-clause | eTimes :: QFontStyleHint
eTimes
= ieQFontStyleHint $ 1 | 56 | eTimes :: QFontStyleHint
eTimes
= ieQFontStyleHint $ 1 | 56 | eTimes
= ieQFontStyleHint $ 1 | 31 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
kmate/HaRe | old/testing/refacFunDef/Scope1.hs | bsd-3-clause | f = 1 + 2 where square2 = 45 | 28 | f = 1 + 2 where square2 = 45 | 28 | f = 1 + 2 where square2 = 45 | 28 | false | false | 0 | 7 | 8 | 21 | 10 | 11 | null | null |
chreekat/snowdrift | Handler/Project/Signup.hs | agpl-3.0 | getProjectSignupR :: Handler Html
getProjectSignupR = do
licenses <- runDB fetchLicensesDB
render <- getUrlRender
(project_signup_form, _) <- generateFormPost $
projectSignupForm render licenses
defaultLayout $ do
snowdriftTitle "Project Sign Up"
$(widgetFile "project_signup") | 319 | getProjectSignupR :: Handler Html
getProjectSignupR = do
licenses <- runDB fetchLicensesDB
render <- getUrlRender
(project_signup_form, _) <- generateFormPost $
projectSignupForm render licenses
defaultLayout $ do
snowdriftTitle "Project Sign Up"
$(widgetFile "project_signup") | 319 | getProjectSignupR = do
licenses <- runDB fetchLicensesDB
render <- getUrlRender
(project_signup_form, _) <- generateFormPost $
projectSignupForm render licenses
defaultLayout $ do
snowdriftTitle "Project Sign Up"
$(widgetFile "project_signup") | 285 | false | true | 0 | 12 | 72 | 76 | 34 | 42 | null | null |
meoblast001/lexical-analyser-generator | src/FollowTable.hs | mit | mergeEntriesOfOneKey entries =
let (FollowTableEntry key _) = head entries
gotos = nub $ concat $ map (\(FollowTableEntry _ g) -> g) entries
in Just $ FollowTableEntry key gotos | 187 | mergeEntriesOfOneKey entries =
let (FollowTableEntry key _) = head entries
gotos = nub $ concat $ map (\(FollowTableEntry _ g) -> g) entries
in Just $ FollowTableEntry key gotos | 187 | mergeEntriesOfOneKey entries =
let (FollowTableEntry key _) = head entries
gotos = nub $ concat $ map (\(FollowTableEntry _ g) -> g) entries
in Just $ FollowTableEntry key gotos | 187 | false | false | 2 | 14 | 38 | 76 | 36 | 40 | null | null |
Peaker/gridview | src/Graphics/GridView/CellArray.hs | bsd-3-clause | startComputing :: CellArray a -> Int -> IO ()
startComputing (CellArray array) i = Cell.startComputing $ array ! i | 114 | startComputing :: CellArray a -> Int -> IO ()
startComputing (CellArray array) i = Cell.startComputing $ array ! i | 114 | startComputing (CellArray array) i = Cell.startComputing $ array ! i | 68 | false | true | 0 | 8 | 18 | 48 | 23 | 25 | null | null |
rueshyna/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/Orders/Refund.hs | mpl-2.0 | -- | Multipart request metadata.
orPayload :: Lens' OrdersRefund OrdersRefundRequest
orPayload
= lens _orPayload (\ s a -> s{_orPayload = a}) | 143 | orPayload :: Lens' OrdersRefund OrdersRefundRequest
orPayload
= lens _orPayload (\ s a -> s{_orPayload = a}) | 110 | orPayload
= lens _orPayload (\ s a -> s{_orPayload = a}) | 58 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
trenta3/zeno-0.2.0.1 | src/Zeno/Expression.hs | mit | showBindings (NonRec bind) = do
bind' <- showBinding bind
i <- indentation
return $ i ++ "let " ++ bind' | 113 | showBindings (NonRec bind) = do
bind' <- showBinding bind
i <- indentation
return $ i ++ "let " ++ bind' | 113 | showBindings (NonRec bind) = do
bind' <- showBinding bind
i <- indentation
return $ i ++ "let " ++ bind' | 113 | false | false | 0 | 9 | 28 | 47 | 21 | 26 | null | null |
kawamuray/ganeti | test/hs/Test/Ganeti/JQueue.hs | gpl-2.0 | prop_InputOpCode :: MetaOpCode -> Int -> Property
prop_InputOpCode meta i =
conjoin [ readJSON (showJSON valid) ==? Text.JSON.Ok valid
, readJSON (showJSON invalid) ==? Text.JSON.Ok invalid
]
where valid = ValidOpCode meta
invalid = InvalidOpCode (showJSON i)
-- | Tests 'extractOpSummary'. | 329 | prop_InputOpCode :: MetaOpCode -> Int -> Property
prop_InputOpCode meta i =
conjoin [ readJSON (showJSON valid) ==? Text.JSON.Ok valid
, readJSON (showJSON invalid) ==? Text.JSON.Ok invalid
]
where valid = ValidOpCode meta
invalid = InvalidOpCode (showJSON i)
-- | Tests 'extractOpSummary'. | 329 | prop_InputOpCode meta i =
conjoin [ readJSON (showJSON valid) ==? Text.JSON.Ok valid
, readJSON (showJSON invalid) ==? Text.JSON.Ok invalid
]
where valid = ValidOpCode meta
invalid = InvalidOpCode (showJSON i)
-- | Tests 'extractOpSummary'. | 279 | false | true | 1 | 10 | 79 | 97 | 48 | 49 | null | null |
bgamari/text | benchmarks/haskell/Benchmarks/Programs/Fold.hs | bsd-2-clause | paragraphs :: T.Text -> [Paragraph]
paragraphs = splitParagraphs . map T.words . T.lines
where
splitParagraphs ls = case break null ls of
([], []) -> []
(p, []) -> [concat p]
(p, lr) -> concat p : splitParagraphs (dropWhile null lr) | 264 | paragraphs :: T.Text -> [Paragraph]
paragraphs = splitParagraphs . map T.words . T.lines
where
splitParagraphs ls = case break null ls of
([], []) -> []
(p, []) -> [concat p]
(p, lr) -> concat p : splitParagraphs (dropWhile null lr) | 264 | paragraphs = splitParagraphs . map T.words . T.lines
where
splitParagraphs ls = case break null ls of
([], []) -> []
(p, []) -> [concat p]
(p, lr) -> concat p : splitParagraphs (dropWhile null lr) | 228 | false | true | 2 | 11 | 72 | 133 | 64 | 69 | null | null |
BakerSmithA/Metal | src/Syntax/Bexp.hs | mit | -- Parses a boolean expression, allowing for parenthesis to specify the
-- intended parse. The EBNF syntax of boolean expressions is:
-- Bexp : 'True'
-- | 'False'
-- | 'not' Bexp
-- | Bexp 'and' Bexp
-- | Bexp 'or' Bexp
-- | DerivedValue '==' DerivedValue
-- | DerivedValue '<=' DerivedValue
bexp :: ParserM Bexp
bexp = makeExprParser bexp' bexpOps | 386 | bexp :: ParserM Bexp
bexp = makeExprParser bexp' bexpOps | 56 | bexp = makeExprParser bexp' bexpOps | 35 | true | true | 0 | 6 | 97 | 35 | 19 | 16 | null | null |
Mahdi89/eTeak | src/Dot.hs | bsd-3-clause | showToken :: DotToken -> String
showToken (DotString _ str) = "\"" ++ escapeString "" str ++ "\"" | 101 | showToken :: DotToken -> String
showToken (DotString _ str) = "\"" ++ escapeString "" str ++ "\"" | 97 | showToken (DotString _ str) = "\"" ++ escapeString "" str ++ "\"" | 65 | false | true | 0 | 7 | 20 | 39 | 19 | 20 | null | null |
holoed/Junior | lib/transformers-0.4.3.0/Control/Monad/Trans/RWS/Lazy.hs | apache-2.0 | -- | Fetch the value of the environment.
ask :: (Monoid w, Monad m) => RWST r w s m r
ask = RWST $ \ r s -> return (r, s, mempty) | 129 | ask :: (Monoid w, Monad m) => RWST r w s m r
ask = RWST $ \ r s -> return (r, s, mempty) | 88 | ask = RWST $ \ r s -> return (r, s, mempty) | 43 | true | true | 2 | 7 | 32 | 67 | 34 | 33 | null | null |
hexenroehrling/hs-scheduler | src/RunParse.hs | gpl-3.0 | pFloat :: Monad m => ParserCommon m Float
pFloat = lexeme L.float | 65 | pFloat :: Monad m => ParserCommon m Float
pFloat = lexeme L.float | 65 | pFloat = lexeme L.float | 23 | false | true | 0 | 6 | 11 | 28 | 13 | 15 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | coercibleDataConKey = mkPreludeDataConUnique 32 | 67 | coercibleDataConKey = mkPreludeDataConUnique 32 | 67 | coercibleDataConKey = mkPreludeDataConUnique 32 | 67 | false | false | 0 | 5 | 23 | 9 | 4 | 5 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSYS_SWAP_BUTTONS :: Int
wxSYS_SWAP_BUTTONS = 37 | 49 | wxSYS_SWAP_BUTTONS :: Int
wxSYS_SWAP_BUTTONS = 37 | 49 | wxSYS_SWAP_BUTTONS = 37 | 23 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
jgoerzen/blogcvt | S9Y.hs | gpl-2.0 | writeNodeCats :: Connection -> [Node] -> [(Integer, Integer)] -> IO ()
writeNodeCats dbh nodes cats =
do sth <- prepare dbh "INSERT INTO serendipity_entrycat (entryid, categoryid) VALUES (?, ?)"
mapM_ (addcats sth) catstoprocess
mapM_ (add0cat sth) nodeswithoutcats
finish sth
commit dbh
where seennodes = map nid nodes
catstoprocess = filter (\(nid, tid) -> nid `elem` seennodes) cats
nodeswithoutcats = filter (\node -> not (nid node `elem` (map fst catstoprocess))) nodes
addcats sth (nid, tid) =
do infoM "" $ "Node " ++ show nid ++ ": Adding category " ++
show tid
execute sth [toSql nid, toSql tid]
add0cat sth node =
do infoM "" $ "Node " ++ show (nid node) ++ ": Adding 0 category"
execute sth [toSql (nid node), toSql (0::Integer)] | 906 | writeNodeCats :: Connection -> [Node] -> [(Integer, Integer)] -> IO ()
writeNodeCats dbh nodes cats =
do sth <- prepare dbh "INSERT INTO serendipity_entrycat (entryid, categoryid) VALUES (?, ?)"
mapM_ (addcats sth) catstoprocess
mapM_ (add0cat sth) nodeswithoutcats
finish sth
commit dbh
where seennodes = map nid nodes
catstoprocess = filter (\(nid, tid) -> nid `elem` seennodes) cats
nodeswithoutcats = filter (\node -> not (nid node `elem` (map fst catstoprocess))) nodes
addcats sth (nid, tid) =
do infoM "" $ "Node " ++ show nid ++ ": Adding category " ++
show tid
execute sth [toSql nid, toSql tid]
add0cat sth node =
do infoM "" $ "Node " ++ show (nid node) ++ ": Adding 0 category"
execute sth [toSql (nid node), toSql (0::Integer)] | 906 | writeNodeCats dbh nodes cats =
do sth <- prepare dbh "INSERT INTO serendipity_entrycat (entryid, categoryid) VALUES (?, ?)"
mapM_ (addcats sth) catstoprocess
mapM_ (add0cat sth) nodeswithoutcats
finish sth
commit dbh
where seennodes = map nid nodes
catstoprocess = filter (\(nid, tid) -> nid `elem` seennodes) cats
nodeswithoutcats = filter (\node -> not (nid node `elem` (map fst catstoprocess))) nodes
addcats sth (nid, tid) =
do infoM "" $ "Node " ++ show nid ++ ": Adding category " ++
show tid
execute sth [toSql nid, toSql tid]
add0cat sth node =
do infoM "" $ "Node " ++ show (nid node) ++ ": Adding 0 category"
execute sth [toSql (nid node), toSql (0::Integer)] | 835 | false | true | 4 | 12 | 289 | 316 | 155 | 161 | null | null |
uduki/hsQt | Qtc/Network/QHttpRequestHeader.hs | bsd-2-clause | qHttpRequestHeader_delete :: QHttpRequestHeader a -> IO ()
qHttpRequestHeader_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QHttpRequestHeader_delete cobj_x0 | 164 | qHttpRequestHeader_delete :: QHttpRequestHeader a -> IO ()
qHttpRequestHeader_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QHttpRequestHeader_delete cobj_x0 | 164 | qHttpRequestHeader_delete x0
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QHttpRequestHeader_delete cobj_x0 | 105 | false | true | 2 | 8 | 22 | 46 | 20 | 26 | null | null |
fmapfmapfmap/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DeleteVPNConnectionRoute.hs | mpl-2.0 | -- | Creates a value of 'DeleteVPNConnectionRouteResponse' with the minimum fields required to make a request.
--
deleteVPNConnectionRouteResponse
:: DeleteVPNConnectionRouteResponse
deleteVPNConnectionRouteResponse = DeleteVPNConnectionRouteResponse' | 255 | deleteVPNConnectionRouteResponse
:: DeleteVPNConnectionRouteResponse
deleteVPNConnectionRouteResponse = DeleteVPNConnectionRouteResponse' | 141 | deleteVPNConnectionRouteResponse = DeleteVPNConnectionRouteResponse' | 68 | true | true | 1 | 5 | 26 | 17 | 8 | 9 | null | null |
NorfairKing/eden | src/Parser.hs | gpl-2.0 | parseGenerateTestsTarget :: Parser GenerationTarget
parseGenerateTestsTarget = Tests
<$> argument str (help "the language to generate the tests for"
<> metavar "LANGUAGE") | 195 | parseGenerateTestsTarget :: Parser GenerationTarget
parseGenerateTestsTarget = Tests
<$> argument str (help "the language to generate the tests for"
<> metavar "LANGUAGE") | 195 | parseGenerateTestsTarget = Tests
<$> argument str (help "the language to generate the tests for"
<> metavar "LANGUAGE") | 143 | false | true | 0 | 9 | 44 | 36 | 17 | 19 | null | null |
davidfontenot/haskell-stuff | StateExample.hs | gpl-2.0 | transitions = [(1,'c',1), (1,'a',2), (2,'b',3), (3,'a',2), (3,'c',1)] | 69 | transitions = [(1,'c',1), (1,'a',2), (2,'b',3), (3,'a',2), (3,'c',1)] | 69 | transitions = [(1,'c',1), (1,'a',2), (2,'b',3), (3,'a',2), (3,'c',1)] | 69 | false | false | 0 | 6 | 6 | 66 | 43 | 23 | null | null |
jdve/xchat-plugin | src/Main.hs | gpl-2.0 | defHType = "()" | 20 | defHType = "()" | 20 | defHType = "()" | 20 | false | false | 1 | 5 | 7 | 10 | 3 | 7 | null | null |
TomMD/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | gHC_FINGERPRINT_TYPE :: Module
gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type") | 97 | gHC_FINGERPRINT_TYPE :: Module
gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type") | 97 | gHC_FINGERPRINT_TYPE = mkBaseModule (fsLit "GHC.Fingerprint.Type") | 66 | false | true | 0 | 7 | 7 | 20 | 10 | 10 | null | null |
tittoassini/flat | src/Flat/Decoder/Prim.hs | bsd-3-clause | -- |Return the 16 most significant bits
dBE16 :: Get Word16
dBE16 = Get $ \endPtr s -> do
ensureBits endPtr s 16
!w1 <- toBE16 <$> peek (castPtr $ currPtr s)
!w <- if usedBits s == 0
then return w1
else do
!(w2::Word8) <- peek (currPtr s `plusPtr` 2)
return $ w1 `unsafeShiftL` usedBits s .|. fromIntegral (w2 `shR` (8-usedBits s))
return $ GetResult (s {currPtr=currPtr s `plusPtr` 2}) w
| 437 | dBE16 :: Get Word16
dBE16 = Get $ \endPtr s -> do
ensureBits endPtr s 16
!w1 <- toBE16 <$> peek (castPtr $ currPtr s)
!w <- if usedBits s == 0
then return w1
else do
!(w2::Word8) <- peek (currPtr s `plusPtr` 2)
return $ w1 `unsafeShiftL` usedBits s .|. fromIntegral (w2 `shR` (8-usedBits s))
return $ GetResult (s {currPtr=currPtr s `plusPtr` 2}) w
| 397 | dBE16 = Get $ \endPtr s -> do
ensureBits endPtr s 16
!w1 <- toBE16 <$> peek (castPtr $ currPtr s)
!w <- if usedBits s == 0
then return w1
else do
!(w2::Word8) <- peek (currPtr s `plusPtr` 2)
return $ w1 `unsafeShiftL` usedBits s .|. fromIntegral (w2 `shR` (8-usedBits s))
return $ GetResult (s {currPtr=currPtr s `plusPtr` 2}) w
| 377 | true | true | 2 | 18 | 120 | 197 | 96 | 101 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_SQL_SQLPLUS_COMMENT :: Int
wxSTC_SQL_SQLPLUS_COMMENT = 13 | 63 | wxSTC_SQL_SQLPLUS_COMMENT :: Int
wxSTC_SQL_SQLPLUS_COMMENT = 13 | 63 | wxSTC_SQL_SQLPLUS_COMMENT = 13 | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
ornicar/haskant | src/Search.hs | mit | bfsClosestInSet :: World -> S.Set Point -> Point -> Maybe Point
bfsClosestInSet w terSet from | S.null terSet = Nothing
| otherwise = explore $ Q.fromList id [from]
where explore q = Q.deque q >>= withPoint
withPoint (p, nq) = if p `S.member` terSet then Just p else explore newQueue
where newQueue = Q.enqueMany (pointOpenNeighbors w p) nq | 391 | bfsClosestInSet :: World -> S.Set Point -> Point -> Maybe Point
bfsClosestInSet w terSet from | S.null terSet = Nothing
| otherwise = explore $ Q.fromList id [from]
where explore q = Q.deque q >>= withPoint
withPoint (p, nq) = if p `S.member` terSet then Just p else explore newQueue
where newQueue = Q.enqueMany (pointOpenNeighbors w p) nq | 391 | bfsClosestInSet w terSet from | S.null terSet = Nothing
| otherwise = explore $ Q.fromList id [from]
where explore q = Q.deque q >>= withPoint
withPoint (p, nq) = if p `S.member` terSet then Just p else explore newQueue
where newQueue = Q.enqueMany (pointOpenNeighbors w p) nq | 327 | false | true | 1 | 9 | 108 | 160 | 74 | 86 | null | null |
kathawala/symdiff | cublas/Foreign/CUDA/Cublas/TH.hs | gpl-3.0 | funname :: CDeclaration a -> String
funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 123 | funname :: CDeclaration a -> String
funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 123 | funname (CDecl _ [(Just (CDeclr (Just ident ) _ _ _ _), _, _)] _) = identToString ident | 87 | false | true | 0 | 14 | 23 | 69 | 35 | 34 | null | null |
cbpark/lhef-tools | src/HEP/Data/LHEF/PipesUtil.hs | bsd-3-clause | getLHEFEvent :: Monad m => Producer ByteString m () -> Producer Event m ()
getLHEFEvent s = do (r, s') <- lift $ runStateT (parse lhefEvent) s
case r of Just (Right ev) -> yield ev >> getLHEFEvent s'
_ -> return () | 278 | getLHEFEvent :: Monad m => Producer ByteString m () -> Producer Event m ()
getLHEFEvent s = do (r, s') <- lift $ runStateT (parse lhefEvent) s
case r of Just (Right ev) -> yield ev >> getLHEFEvent s'
_ -> return () | 278 | getLHEFEvent s = do (r, s') <- lift $ runStateT (parse lhefEvent) s
case r of Just (Right ev) -> yield ev >> getLHEFEvent s'
_ -> return () | 203 | false | true | 0 | 12 | 106 | 114 | 53 | 61 | null | null |
OliverFlecke/Funci | src/Parser.hs | bsd-3-clause | parseString :: (Read a, Show a, Num a) => String -> Either (Exception a) (Program a)
parseString s = lexer s >>= parse | 118 | parseString :: (Read a, Show a, Num a) => String -> Either (Exception a) (Program a)
parseString s = lexer s >>= parse | 118 | parseString s = lexer s >>= parse | 33 | false | true | 0 | 10 | 22 | 68 | 32 | 36 | null | null |
deontologician/orbRPG | Game/OrbRPG/Combinations.hs | gpl-3.0 | L Mu @>> P Blue = P Red | 23 | L Mu @>> P Blue = P Red | 23 | L Mu @>> P Blue = P Red | 23 | false | false | 3 | 6 | 7 | 23 | 9 | 14 | null | null |
rodrigofegui/UnB | 2017.2/Linguagens de Programação/Trab 2_Ver 2/Tst_F6LAE.hs | gpl-3.0 | ref_1 = [("x", NumV 42, 1),
("x", ExpV (Add (Num 3) (Num 8)), nivelInit)] | 86 | ref_1 = [("x", NumV 42, 1),
("x", ExpV (Add (Num 3) (Num 8)), nivelInit)] | 86 | ref_1 = [("x", NumV 42, 1),
("x", ExpV (Add (Num 3) (Num 8)), nivelInit)] | 86 | false | false | 1 | 11 | 26 | 59 | 31 | 28 | null | null |
dmbarbour/Sirea | src/Sirea/Trans/Error.hs | bsd-3-clause | -- | Force an error
raiseError :: (BSum b) => ErrorB e b e y
raiseError = wrapError binl | 88 | raiseError :: (BSum b) => ErrorB e b e y
raiseError = wrapError binl | 68 | raiseError = wrapError binl | 27 | true | true | 0 | 7 | 18 | 38 | 18 | 20 | null | null |
ssaavedra/liquidhaskell | src/Language/Haskell/Liquid/Types/RefType.hs | bsd-3-clause | ofType_ (ForAllTy α τ)
| isKindVar α
= ofType_ τ
| otherwise
= RAllT (rTyVar α) $ ofType_ τ | 99 | ofType_ (ForAllTy α τ)
| isKindVar α
= ofType_ τ
| otherwise
= RAllT (rTyVar α) $ ofType_ τ | 99 | ofType_ (ForAllTy α τ)
| isKindVar α
= ofType_ τ
| otherwise
= RAllT (rTyVar α) $ ofType_ τ | 99 | false | false | 2 | 8 | 26 | 58 | 24 | 34 | null | null |
5outh/Elm | src/Type/Inference.hs | bsd-3-clause | format :: (ModuleName.Canonical, Module.ADTs) -> [CanonicalAdt]
format (home, adts) =
map canonical (Map.toList adts)
where
canonical :: (String, AdtInfo String) -> CanonicalAdt
canonical (name, (tvars, ctors)) =
( toVar name
, (tvars, map (first toVar) ctors)
)
toVar :: String -> Var.Canonical
toVar name =
Var.fromModule home name | 388 | format :: (ModuleName.Canonical, Module.ADTs) -> [CanonicalAdt]
format (home, adts) =
map canonical (Map.toList adts)
where
canonical :: (String, AdtInfo String) -> CanonicalAdt
canonical (name, (tvars, ctors)) =
( toVar name
, (tvars, map (first toVar) ctors)
)
toVar :: String -> Var.Canonical
toVar name =
Var.fromModule home name | 388 | format (home, adts) =
map canonical (Map.toList adts)
where
canonical :: (String, AdtInfo String) -> CanonicalAdt
canonical (name, (tvars, ctors)) =
( toVar name
, (tvars, map (first toVar) ctors)
)
toVar :: String -> Var.Canonical
toVar name =
Var.fromModule home name | 324 | false | true | 0 | 9 | 102 | 148 | 78 | 70 | null | null |
nevrenato/HetsAlloy | Driver/Options.hs | gpl-2.0 | verboseS = "verbose" | 20 | verboseS = "verbose" | 20 | verboseS = "verbose" | 20 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
danr/hipspec | examples/old-examples/hip/ZenoLists.hs | gpl-3.0 | sort (x:xs) = insort x (sort xs) | 32 | sort (x:xs) = insort x (sort xs) | 32 | sort (x:xs) = insort x (sort xs) | 32 | false | false | 0 | 6 | 6 | 29 | 13 | 16 | null | null |
iu-parfunc/containers | Data/Sequence.hs | bsd-3-clause | -- | /O(n)/. Convert a given sequence length and a function representing that
-- sequence into a sequence.
fromFunction :: Int -> (Int -> a) -> Seq a
fromFunction len f | len < 0 = error "Data.Sequence.fromFunction called with negative len"
| len == 0 = empty
| otherwise = Seq $ create (lift_elem f) 1 0 len
where
create :: (Int -> a) -> Int -> Int -> Int -> FingerTree a
create b{-tree_builder-} s{-tree_size-} i{-start_index-} trees = i `seq` s `seq` case trees of
1 -> Single $ b i
2 -> Deep (2*s) (One (b i)) Empty (One (b (i+s)))
3 -> Deep (3*s) (createTwo i) Empty (One (b (i+2*s)))
4 -> Deep (4*s) (createTwo i) Empty (createTwo (i+2*s))
5 -> Deep (5*s) (createThree i) Empty (createTwo (i+3*s))
6 -> Deep (6*s) (createThree i) Empty (createThree (i+3*s))
_ -> case trees `quotRem` 3 of
(trees', 1) -> Deep (trees*s) (createTwo i)
(create mb (3*s) (i+2*s) (trees'-1))
(createTwo (i+(2+3*(trees'-1))*s))
(trees', 2) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-1))
(createTwo (i+(3+3*(trees'-1))*s))
(trees', _) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-2))
(createThree (i+(3+3*(trees'-2))*s))
where
createTwo j = Two (b j) (b (j + s))
{-# INLINE createTwo #-}
createThree j = Three (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE createThree #-}
mb j = Node3 (3*s) (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE mb #-}
lift_elem :: (Int -> a) -> (Int -> Elem a)
#if __GLASGOW_HASKELL__ >= 708
lift_elem g = coerce g
#else
lift_elem g = Elem . g
#endif
{-# INLINE lift_elem #-}
-- | /O(n)/. Create a sequence consisting of the elements of an 'Array'.
-- Note that the resulting sequence elements may be evaluated lazily (as on GHC),
-- so you must force the entire structure to be sure that the original array
-- can be garbage-collected. | 2,166 | fromFunction :: Int -> (Int -> a) -> Seq a
fromFunction len f | len < 0 = error "Data.Sequence.fromFunction called with negative len"
| len == 0 = empty
| otherwise = Seq $ create (lift_elem f) 1 0 len
where
create :: (Int -> a) -> Int -> Int -> Int -> FingerTree a
create b{-tree_builder-} s{-tree_size-} i{-start_index-} trees = i `seq` s `seq` case trees of
1 -> Single $ b i
2 -> Deep (2*s) (One (b i)) Empty (One (b (i+s)))
3 -> Deep (3*s) (createTwo i) Empty (One (b (i+2*s)))
4 -> Deep (4*s) (createTwo i) Empty (createTwo (i+2*s))
5 -> Deep (5*s) (createThree i) Empty (createTwo (i+3*s))
6 -> Deep (6*s) (createThree i) Empty (createThree (i+3*s))
_ -> case trees `quotRem` 3 of
(trees', 1) -> Deep (trees*s) (createTwo i)
(create mb (3*s) (i+2*s) (trees'-1))
(createTwo (i+(2+3*(trees'-1))*s))
(trees', 2) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-1))
(createTwo (i+(3+3*(trees'-1))*s))
(trees', _) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-2))
(createThree (i+(3+3*(trees'-2))*s))
where
createTwo j = Two (b j) (b (j + s))
{-# INLINE createTwo #-}
createThree j = Three (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE createThree #-}
mb j = Node3 (3*s) (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE mb #-}
lift_elem :: (Int -> a) -> (Int -> Elem a)
#if __GLASGOW_HASKELL__ >= 708
lift_elem g = coerce g
#else
lift_elem g = Elem . g
#endif
{-# INLINE lift_elem #-}
-- | /O(n)/. Create a sequence consisting of the elements of an 'Array'.
-- Note that the resulting sequence elements may be evaluated lazily (as on GHC),
-- so you must force the entire structure to be sure that the original array
-- can be garbage-collected. | 2,059 | fromFunction len f | len < 0 = error "Data.Sequence.fromFunction called with negative len"
| len == 0 = empty
| otherwise = Seq $ create (lift_elem f) 1 0 len
where
create :: (Int -> a) -> Int -> Int -> Int -> FingerTree a
create b{-tree_builder-} s{-tree_size-} i{-start_index-} trees = i `seq` s `seq` case trees of
1 -> Single $ b i
2 -> Deep (2*s) (One (b i)) Empty (One (b (i+s)))
3 -> Deep (3*s) (createTwo i) Empty (One (b (i+2*s)))
4 -> Deep (4*s) (createTwo i) Empty (createTwo (i+2*s))
5 -> Deep (5*s) (createThree i) Empty (createTwo (i+3*s))
6 -> Deep (6*s) (createThree i) Empty (createThree (i+3*s))
_ -> case trees `quotRem` 3 of
(trees', 1) -> Deep (trees*s) (createTwo i)
(create mb (3*s) (i+2*s) (trees'-1))
(createTwo (i+(2+3*(trees'-1))*s))
(trees', 2) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-1))
(createTwo (i+(3+3*(trees'-1))*s))
(trees', _) -> Deep (trees*s) (createThree i)
(create mb (3*s) (i+3*s) (trees'-2))
(createThree (i+(3+3*(trees'-2))*s))
where
createTwo j = Two (b j) (b (j + s))
{-# INLINE createTwo #-}
createThree j = Three (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE createThree #-}
mb j = Node3 (3*s) (b j) (b (j + s)) (b (j + 2*s))
{-# INLINE mb #-}
lift_elem :: (Int -> a) -> (Int -> Elem a)
#if __GLASGOW_HASKELL__ >= 708
lift_elem g = coerce g
#else
lift_elem g = Elem . g
#endif
{-# INLINE lift_elem #-}
-- | /O(n)/. Create a sequence consisting of the elements of an 'Array'.
-- Note that the resulting sequence elements may be evaluated lazily (as on GHC),
-- so you must force the entire structure to be sure that the original array
-- can be garbage-collected. | 2,016 | true | true | 5 | 21 | 700 | 970 | 497 | 473 | null | null |
alexbiehl/hoop | hadoop-protos/src/Hadoop/Protos/HdfsProtos/HdfsFileStatusProto/FileType.hs | mit | toMaybe'Enum _ = Prelude'.Nothing | 33 | toMaybe'Enum _ = Prelude'.Nothing | 33 | toMaybe'Enum _ = Prelude'.Nothing | 33 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
bjpop/blip | bliplib/src/Blip/Marshal.hs | bsd-3-clause | writeCodeObject other = error $ "writeCodeObject called on non code object: " ++ show other | 91 | writeCodeObject other = error $ "writeCodeObject called on non code object: " ++ show other | 91 | writeCodeObject other = error $ "writeCodeObject called on non code object: " ++ show other | 91 | false | false | 3 | 6 | 14 | 24 | 9 | 15 | null | null |
BeautifulDestinations/fb | src/Facebook/Object/Marketing/AdCreative.hs | bsd-3-clause | unPolicyUrl_ :: PolicyUrl_ -> Text
unPolicyUrl_ (PolicyUrl_ x) = x | 66 | unPolicyUrl_ :: PolicyUrl_ -> Text
unPolicyUrl_ (PolicyUrl_ x) = x | 66 | unPolicyUrl_ (PolicyUrl_ x) = x | 31 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
thalerjonathan/phd | coding/papers/pfe/Shared/SIR.hs | gpl-3.0 | sirAggregateToString :: (Double, Double, Double) -> String
sirAggregateToString (susceptibleCount, infectedCount, recoveredCount) =
printf "%f" susceptibleCount
++ "," ++ printf "%f" infectedCount
++ "," ++ printf "%f" recoveredCount
++ ";" | 248 | sirAggregateToString :: (Double, Double, Double) -> String
sirAggregateToString (susceptibleCount, infectedCount, recoveredCount) =
printf "%f" susceptibleCount
++ "," ++ printf "%f" infectedCount
++ "," ++ printf "%f" recoveredCount
++ ";" | 248 | sirAggregateToString (susceptibleCount, infectedCount, recoveredCount) =
printf "%f" susceptibleCount
++ "," ++ printf "%f" infectedCount
++ "," ++ printf "%f" recoveredCount
++ ";" | 189 | false | true | 10 | 6 | 36 | 84 | 38 | 46 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/course/2014-10-edx-delft-fp101x-intro-to-fp-erik-meijer/lab5-pmc.hs | unlicense | ex1 :: Concurrent ()
ex1 = do atom (putStr "Haskell")
fork (loop $ genRandom 7331)
loop $ genRandom 42
atom (putStrLn "")
-- ===================================
-- Helper Functions
-- =================================== | 247 | ex1 :: Concurrent ()
ex1 = do atom (putStr "Haskell")
fork (loop $ genRandom 7331)
loop $ genRandom 42
atom (putStrLn "")
-- ===================================
-- Helper Functions
-- =================================== | 247 | ex1 = do atom (putStr "Haskell")
fork (loop $ genRandom 7331)
loop $ genRandom 42
atom (putStrLn "")
-- ===================================
-- Helper Functions
-- =================================== | 226 | false | true | 1 | 11 | 56 | 73 | 32 | 41 | null | null |
xcv-/LCC | lib/Language/LCC/TypeChecker.hs | gpl-3.0 | foldInferNothrow :: ExprTypeM ret m => SigReturnGetter m -> TypeFolder m
foldInferNothrow getSigReturn known =
foldl' altSkipErrors (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
altSkipErrors :: Err.ErrorM m
=> m (Maybe Type) -> m (Maybe Type) -> m (Maybe Type)
altSkipErrors acc t =
liftM2 (<|>) acc (t `Err.catching` \_ -> return Nothing) | 433 | foldInferNothrow :: ExprTypeM ret m => SigReturnGetter m -> TypeFolder m
foldInferNothrow getSigReturn known =
foldl' altSkipErrors (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
altSkipErrors :: Err.ErrorM m
=> m (Maybe Type) -> m (Maybe Type) -> m (Maybe Type)
altSkipErrors acc t =
liftM2 (<|>) acc (t `Err.catching` \_ -> return Nothing) | 433 | foldInferNothrow getSigReturn known =
foldl' altSkipErrors (return known) . map exprType'
where
exprType' = exprType (foldInfer getSigReturn) getSigReturn
altSkipErrors :: Err.ErrorM m
=> m (Maybe Type) -> m (Maybe Type) -> m (Maybe Type)
altSkipErrors acc t =
liftM2 (<|>) acc (t `Err.catching` \_ -> return Nothing) | 360 | false | true | 0 | 10 | 100 | 159 | 77 | 82 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/ListSAMLProviders.hs | mpl-2.0 | -- | Creates a value of 'ListSAMLProviders' with the minimum fields required to make a request.
--
listSAMLProviders
:: ListSAMLProviders
listSAMLProviders = ListSAMLProviders' | 180 | listSAMLProviders
:: ListSAMLProviders
listSAMLProviders = ListSAMLProviders' | 81 | listSAMLProviders = ListSAMLProviders' | 38 | true | true | 1 | 5 | 26 | 17 | 8 | 9 | null | null |
wxwxwwxxx/ghc | compiler/utils/Panic.hs | bsd-3-clause | sorryDoc x doc = throwGhcException (PprSorry x doc) | 61 | sorryDoc x doc = throwGhcException (PprSorry x doc) | 61 | sorryDoc x doc = throwGhcException (PprSorry x doc) | 61 | false | false | 1 | 7 | 17 | 26 | 10 | 16 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MBoss32.hs | bsd-3-clause | frameStand260 :: Int
frameStand260 = 473 | 40 | frameStand260 :: Int
frameStand260 = 473 | 40 | frameStand260 = 473 | 19 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
k0001/haskell-opaleye | Opaleye/Internal/Print.hs | bsd-3-clause | ppOffset :: Maybe Int -> Doc
ppOffset Nothing = empty | 53 | ppOffset :: Maybe Int -> Doc
ppOffset Nothing = empty | 53 | ppOffset Nothing = empty | 24 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
diflying/logitext | ClassicalFOL.hs | bsd-3-clause | refineString :: Lazy.ByteString -> IO Lazy.ByteString
refineString s =
case L.parse json' s of
L.Done _ v -> case fromJSON v of
Success a -> E.encode . toJSON <$> refine a
_ -> errorModule "refineString: failed to decode JSON"
_ -> errorModule "refineString: failed to parse JSON"
-- Parsing | 337 | refineString :: Lazy.ByteString -> IO Lazy.ByteString
refineString s =
case L.parse json' s of
L.Done _ v -> case fromJSON v of
Success a -> E.encode . toJSON <$> refine a
_ -> errorModule "refineString: failed to decode JSON"
_ -> errorModule "refineString: failed to parse JSON"
-- Parsing | 337 | refineString s =
case L.parse json' s of
L.Done _ v -> case fromJSON v of
Success a -> E.encode . toJSON <$> refine a
_ -> errorModule "refineString: failed to decode JSON"
_ -> errorModule "refineString: failed to parse JSON"
-- Parsing | 283 | false | true | 0 | 13 | 94 | 101 | 46 | 55 | null | null |
hanshoglund/imitator | src/Music/Imitator/Sound.hs | gpl-3.0 | nvSust z as bs = U.Envelope (z:levels) times curves (Just $ length as) Nothing
where
(times, levels, curves) = unzip3 $ as ++ bs
-- |
-- Create a looped envelope.
--
-- > envSust val2 [(dur2,val2,curve2)..] [(dur2,val2,curve2)..] [(dur2,val2,curve2)..]
--
| 269 | envSust z as bs = U.Envelope (z:levels) times curves (Just $ length as) Nothing
where
(times, levels, curves) = unzip3 $ as ++ bs
-- |
-- Create a looped envelope.
--
-- > envSust val2 [(dur2,val2,curve2)..] [(dur2,val2,curve2)..] [(dur2,val2,curve2)..]
-- | 269 | envSust z as bs = U.Envelope (z:levels) times curves (Just $ length as) Nothing
where
(times, levels, curves) = unzip3 $ as ++ bs
-- |
-- Create a looped envelope.
--
-- > envSust val2 [(dur2,val2,curve2)..] [(dur2,val2,curve2)..] [(dur2,val2,curve2)..]
-- | 269 | false | false | 0 | 8 | 53 | 73 | 40 | 33 | null | null |
adityagupta1089/Project-Euler-Haskell | src/util/Merge.hs | bsd-3-clause | mergeWith :: (a -> a -> a) -> [a] -> a
mergeWith _ [x] = x | 58 | mergeWith :: (a -> a -> a) -> [a] -> a
mergeWith _ [x] = x | 58 | mergeWith _ [x] = x | 19 | false | true | 0 | 8 | 15 | 41 | 22 | 19 | null | null |
teleshoes/taffybar | src/System/Taffybar/DBus.hs | bsd-3-clause | withLogServer :: TaffybarConfig -> TaffybarConfig
withLogServer = appendHook startTaffyLogServer | 96 | withLogServer :: TaffybarConfig -> TaffybarConfig
withLogServer = appendHook startTaffyLogServer | 96 | withLogServer = appendHook startTaffyLogServer | 46 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
np/lens | tests/properties.hs | bsd-3-clause | prism_yin :: Eq a => Prism' s a -> a -> Bool
prism_yin l a = preview l (review l a) == Just a | 93 | prism_yin :: Eq a => Prism' s a -> a -> Bool
prism_yin l a = preview l (review l a) == Just a | 93 | prism_yin l a = preview l (review l a) == Just a | 48 | false | true | 0 | 8 | 23 | 56 | 26 | 30 | null | null |
ramaciotti/dependent-types | tests/test.hs | gpl-3.0 | main = defaultMain tests | 24 | main = defaultMain tests | 24 | main = defaultMain tests | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
DaMSL/K3 | src/Language/K3/Transform/Simplification.hs | apache-2.0 | isENoBetaReduce :: Annotation Expression -> Bool
isENoBetaReduce (EProperty (ePropertyName -> "NoBetaReduce")) = True | 117 | isENoBetaReduce :: Annotation Expression -> Bool
isENoBetaReduce (EProperty (ePropertyName -> "NoBetaReduce")) = True | 117 | isENoBetaReduce (EProperty (ePropertyName -> "NoBetaReduce")) = True | 68 | false | true | 0 | 8 | 12 | 38 | 18 | 20 | null | null |
jlouis/combinatorrent | src/Protocol/BCode.hs | bsd-2-clause | {- Various accessors -}
announce, comment, creationDate :: BCode -> Maybe B.ByteString
announce = search' "announce" | 116 | announce, comment, creationDate :: BCode -> Maybe B.ByteString
announce = search' "announce" | 92 | announce = search' "announce" | 29 | true | true | 0 | 7 | 15 | 28 | 16 | 12 | null | null |
da-x/lamdu | Lamdu/GUI/TypeView.hs | gpl-3.0 | transaction :: Monad m => T m a -> M m a
transaction = egui . ExprGuiM.transaction | 82 | transaction :: Monad m => T m a -> M m a
transaction = egui . ExprGuiM.transaction | 82 | transaction = egui . ExprGuiM.transaction | 41 | false | true | 0 | 7 | 16 | 38 | 18 | 20 | null | null |
gibiansky/IHaskell | src/tests/IHaskell/Test/Eval.hs | mit | evaluationComparing :: (([Display], String) -> IO b) -> String -> IO b
evaluationComparing comparison string = do
let indent (' ':x) = 1 + indent x
indent _ = 0
empty = null . strip
stringLines = filter (not . empty) $ lines string
minIndent = minimum (map indent stringLines)
newString = unlines $ map (drop minIndent) stringLines
eval newString >>= comparison | 395 | evaluationComparing :: (([Display], String) -> IO b) -> String -> IO b
evaluationComparing comparison string = do
let indent (' ':x) = 1 + indent x
indent _ = 0
empty = null . strip
stringLines = filter (not . empty) $ lines string
minIndent = minimum (map indent stringLines)
newString = unlines $ map (drop minIndent) stringLines
eval newString >>= comparison | 395 | evaluationComparing comparison string = do
let indent (' ':x) = 1 + indent x
indent _ = 0
empty = null . strip
stringLines = filter (not . empty) $ lines string
minIndent = minimum (map indent stringLines)
newString = unlines $ map (drop minIndent) stringLines
eval newString >>= comparison | 324 | false | true | 0 | 13 | 95 | 157 | 78 | 79 | null | null |
leroux/packages-haskeline | System/Console/Haskeline/Backend/Terminfo.hs | bsd-2-clause | output :: TermAction -> ActionM ()
output t = Writer.tell t | 59 | output :: TermAction -> ActionM ()
output t = Writer.tell t | 59 | output t = Writer.tell t | 24 | false | true | 0 | 7 | 10 | 28 | 13 | 15 | null | null |
mattias-lundell/timber-llvm | src/Env.hs | bsd-3-clause | findKind env c = findKind0 (kindEnv env ++ kindEnv0 env) c | 83 | findKind env c = findKind0 (kindEnv env ++ kindEnv0 env) c | 83 | findKind env c = findKind0 (kindEnv env ++ kindEnv0 env) c | 83 | false | false | 0 | 8 | 35 | 29 | 13 | 16 | null | null |
hiratara/TypedPerl | src/TypedPerl/Substitute.hs | bsd-3-clause | addSubst :: SubstituteItem -> Substitute -> Substitute
addSubst s1 ss = singleton s1 `compSubst` ss | 99 | addSubst :: SubstituteItem -> Substitute -> Substitute
addSubst s1 ss = singleton s1 `compSubst` ss | 99 | addSubst s1 ss = singleton s1 `compSubst` ss | 44 | false | true | 0 | 6 | 14 | 33 | 17 | 16 | null | null |
tonyday567/mvc-extended | src/Pipes/Extended.hs | mit | fanOutP :: (Monad m) => [Pipe b c m ()] -> Pipe b [c] m ()
fanOutP [p] = p >-> Pipes.map (: []) | 95 | fanOutP :: (Monad m) => [Pipe b c m ()] -> Pipe b [c] m ()
fanOutP [p] = p >-> Pipes.map (: []) | 95 | fanOutP [p] = p >-> Pipes.map (: []) | 36 | false | true | 2 | 9 | 23 | 79 | 40 | 39 | null | null |
justinethier/husk-scheme | hs-src/Language/Scheme/Numerical.hs | mit | numAcos badArgList = throwError $ NumArgs (Just 1) badArgList | 61 | numAcos badArgList = throwError $ NumArgs (Just 1) badArgList | 61 | numAcos badArgList = throwError $ NumArgs (Just 1) badArgList | 61 | false | false | 0 | 8 | 8 | 24 | 11 | 13 | null | null |
elaye/svg-parser | src/Attributes.hs | bsd-3-clause | attrDefs =
[ ("height", height)
, ("width", width)
, ("viewBox", viewBox)
, ("d", d)
] | 96 | attrDefs =
[ ("height", height)
, ("width", width)
, ("viewBox", viewBox)
, ("d", d)
] | 96 | attrDefs =
[ ("height", height)
, ("width", width)
, ("viewBox", viewBox)
, ("d", d)
] | 96 | false | false | 1 | 6 | 24 | 45 | 27 | 18 | null | null |
glutamate/cmdtheline | doc/examples/fail.hs | mit | cmds :: [( Term String, TermInfo )]
cmds =
[ ( ret $ failMsg <$> input
, def' { termName = "msg"
, termDoc = "Print a failure message."
}
)
, ( ret $ failUsage <$> input
, def' { termName = "usage"
, termDoc = "Print a usage message."
}
)
, ( ret $ success <$> input
, def' { termName = "success"
, termDoc = "Print a message to the screen"
}
)
, ( ret $ help <$> value (pos 0 "" posInfo { posName = "TERM" })
, def' { termName = "help"
, termDoc = "Display help for a command."
}
)
] | 621 | cmds :: [( Term String, TermInfo )]
cmds =
[ ( ret $ failMsg <$> input
, def' { termName = "msg"
, termDoc = "Print a failure message."
}
)
, ( ret $ failUsage <$> input
, def' { termName = "usage"
, termDoc = "Print a usage message."
}
)
, ( ret $ success <$> input
, def' { termName = "success"
, termDoc = "Print a message to the screen"
}
)
, ( ret $ help <$> value (pos 0 "" posInfo { posName = "TERM" })
, def' { termName = "help"
, termDoc = "Display help for a command."
}
)
] | 621 | cmds =
[ ( ret $ failMsg <$> input
, def' { termName = "msg"
, termDoc = "Print a failure message."
}
)
, ( ret $ failUsage <$> input
, def' { termName = "usage"
, termDoc = "Print a usage message."
}
)
, ( ret $ success <$> input
, def' { termName = "success"
, termDoc = "Print a message to the screen"
}
)
, ( ret $ help <$> value (pos 0 "" posInfo { posName = "TERM" })
, def' { termName = "help"
, termDoc = "Display help for a command."
}
)
] | 585 | false | true | 0 | 12 | 246 | 168 | 100 | 68 | null | null |
raichoo/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | expl_param = Exp [] Dynamic True | 32 | expl_param = Exp [] Dynamic True | 32 | expl_param = Exp [] Dynamic True | 32 | false | false | 0 | 6 | 5 | 15 | 7 | 8 | null | null |
arekfu/project_euler | p0018/p0018.hs | mit | squarify :: [[Integer]] -> [[Integer]]
squarify x = map (padList (-9999) maxLen) x
where maxLen = maximum $ map length x | 131 | squarify :: [[Integer]] -> [[Integer]]
squarify x = map (padList (-9999) maxLen) x
where maxLen = maximum $ map length x | 131 | squarify x = map (padList (-9999) maxLen) x
where maxLen = maximum $ map length x | 92 | false | true | 0 | 9 | 31 | 64 | 34 | 30 | null | null |
jfischoff/hs-mitsuba | tests/Tests/Mitsuba/Types.hs | bsd-3-clause | case_coating_toXML
= actualCoating `assertElement` [xmlQQ|
<bsdf type="coating">
<float name="intIOR" value="1.7"/>
<float name="extIOR" value="1.0"/>
<bsdf type="roughconductor">
<string name="distribution" value="beckmann"/>
<string name="material" value="Cu"/>
<float name="alpha" value="0.1"/>
<string name="extEta" value="vacuum"/>
<texture name="specularReflectance" type="vertexcolors" />
</bsdf>
<spectrum name="specularReflection" value="1.0"/>
<spectrum name="sigmaA" value="0.0"/>
<float name="thickness" value="1.0"/>
</bsdf>
|] | 644 | case_coating_toXML
= actualCoating `assertElement` [xmlQQ|
<bsdf type="coating">
<float name="intIOR" value="1.7"/>
<float name="extIOR" value="1.0"/>
<bsdf type="roughconductor">
<string name="distribution" value="beckmann"/>
<string name="material" value="Cu"/>
<float name="alpha" value="0.1"/>
<string name="extEta" value="vacuum"/>
<texture name="specularReflectance" type="vertexcolors" />
</bsdf>
<spectrum name="specularReflection" value="1.0"/>
<spectrum name="sigmaA" value="0.0"/>
<float name="thickness" value="1.0"/>
</bsdf>
|] | 644 | case_coating_toXML
= actualCoating `assertElement` [xmlQQ|
<bsdf type="coating">
<float name="intIOR" value="1.7"/>
<float name="extIOR" value="1.0"/>
<bsdf type="roughconductor">
<string name="distribution" value="beckmann"/>
<string name="material" value="Cu"/>
<float name="alpha" value="0.1"/>
<string name="extEta" value="vacuum"/>
<texture name="specularReflectance" type="vertexcolors" />
</bsdf>
<spectrum name="specularReflection" value="1.0"/>
<spectrum name="sigmaA" value="0.0"/>
<float name="thickness" value="1.0"/>
</bsdf>
|] | 644 | false | false | 1 | 5 | 146 | 19 | 11 | 8 | null | null |
upwawet/vision | src/DnD.hs | gpl-3.0 | selectionDataGetStringList =
maybe [] brk <$> selectionDataGet selectionTypeInteger
where brk text = case break (== 0) text of
(name, []) -> [map chr name]
(name, _ : rest) -> map chr name : brk rest | 229 | selectionDataGetStringList =
maybe [] brk <$> selectionDataGet selectionTypeInteger
where brk text = case break (== 0) text of
(name, []) -> [map chr name]
(name, _ : rest) -> map chr name : brk rest | 229 | selectionDataGetStringList =
maybe [] brk <$> selectionDataGet selectionTypeInteger
where brk text = case break (== 0) text of
(name, []) -> [map chr name]
(name, _ : rest) -> map chr name : brk rest | 229 | false | false | 0 | 9 | 64 | 93 | 47 | 46 | null | null |
jstolarek/ghc | libraries/base/Control/Category.hs | bsd-3-clause | -- | Left-to-right composition
(>>>) :: Category cat => cat a b -> cat b c -> cat a c
f >>> g = g . f | 101 | (>>>) :: Category cat => cat a b -> cat b c -> cat a c
f >>> g = g . f | 70 | f >>> g = g . f | 15 | true | true | 0 | 10 | 26 | 54 | 26 | 28 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/SY/Clocked.hs | bsd-3-clause | mealy31 ns od i s1 s2 s3 = comb41 od (stated31 ns i s1 s2 s3) s1 s2 s3 | 70 | mealy31 ns od i s1 s2 s3 = comb41 od (stated31 ns i s1 s2 s3) s1 s2 s3 | 70 | mealy31 ns od i s1 s2 s3 = comb41 od (stated31 ns i s1 s2 s3) s1 s2 s3 | 70 | false | false | 0 | 7 | 18 | 44 | 21 | 23 | null | null |
lgeorget/ogma | server/src/Ogma/Model/Model.hs | mit | createNewUser :: (MonadBaseControl IO m, MonadIO m, Monad m)
=> Text
-> Text
-> SqlPersistT m (Maybe UserId)
createNewUser login email = do
identity <- Auth.newIdentity
insertUnique $ User login identity email | 259 | createNewUser :: (MonadBaseControl IO m, MonadIO m, Monad m)
=> Text
-> Text
-> SqlPersistT m (Maybe UserId)
createNewUser login email = do
identity <- Auth.newIdentity
insertUnique $ User login identity email | 259 | createNewUser login email = do
identity <- Auth.newIdentity
insertUnique $ User login identity email | 108 | false | true | 0 | 10 | 81 | 81 | 39 | 42 | null | null |
castaway/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | pCode :: TagParser [Inline]
pCode = try $ do
(TagOpen open attr) <- pSatisfy $ tagOpen (`elem` ["code","tt"]) (const True)
result <- manyTill pAnyTag (pCloses open)
let ident = fromMaybe "" $ lookup "id" attr
let classes = words $ fromMaybe [] $ lookup "class" attr
let rest = filter (\(x,_) -> x /= "id" && x /= "class") attr
return [Code (ident,classes,rest)
$ intercalate " " $ lines $ innerText result] | 427 | pCode :: TagParser [Inline]
pCode = try $ do
(TagOpen open attr) <- pSatisfy $ tagOpen (`elem` ["code","tt"]) (const True)
result <- manyTill pAnyTag (pCloses open)
let ident = fromMaybe "" $ lookup "id" attr
let classes = words $ fromMaybe [] $ lookup "class" attr
let rest = filter (\(x,_) -> x /= "id" && x /= "class") attr
return [Code (ident,classes,rest)
$ intercalate " " $ lines $ innerText result] | 427 | pCode = try $ do
(TagOpen open attr) <- pSatisfy $ tagOpen (`elem` ["code","tt"]) (const True)
result <- manyTill pAnyTag (pCloses open)
let ident = fromMaybe "" $ lookup "id" attr
let classes = words $ fromMaybe [] $ lookup "class" attr
let rest = filter (\(x,_) -> x /= "id" && x /= "class") attr
return [Code (ident,classes,rest)
$ intercalate " " $ lines $ innerText result] | 399 | false | true | 0 | 16 | 92 | 208 | 103 | 105 | null | null |
nevrenato/HetsAlloy | Fpl/Sign.hs | gpl-2.0 | addConsts :: SignExt -> SignExt
addConsts s = s { constr = addBools $ constr s } | 80 | addConsts :: SignExt -> SignExt
addConsts s = s { constr = addBools $ constr s } | 80 | addConsts s = s { constr = addBools $ constr s } | 48 | false | true | 0 | 8 | 16 | 33 | 17 | 16 | null | null |
nominolo/ghc-phase-plugins | Ghc/Api/V76.hs | bsd-3-clause | runPhase As input_fn dflags hooks
= do
-- LLVM from version 3.0 onwards doesn't support the OS X system
-- assembler, so we use clang as the assembler instead. (#5636)
let whichAsProg | hscTarget dflags == HscLlvm &&
platformOS (targetPlatform dflags) == OSDarwin
= do
llvmVer <- io $ figureLlvmVersion dflags
return $ case llvmVer of
-- using cGccLinkerOpts here but not clear if
-- opt_c isn't a better choice
Just n | n >= 30 ->
(SysTools.runClang, cGccLinkerOpts)
_ -> (SysTools.runAs, getOpts dflags opt_a)
| otherwise
= return (SysTools.runAs, getOpts dflags opt_a)
(as_prog, as_opts) <- whichAsProg
let cmdline_include_paths = includePaths dflags
next_phase <- maybeMergeStub
output_fn <- phaseOutputFilename next_phase
-- we create directories for the object file, because it
-- might be a hierarchical module.
io $ createDirectoryIfMissing True (takeDirectory output_fn)
io $ as_prog dflags
(map SysTools.Option as_opts
++ [ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
-- We only support SparcV9 and better because V8 lacks an atomic CAS
-- instruction so we have to make sure that the assembler accepts the
-- instruction set. Note that the user can still override this
-- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag
-- regardless of the ordering.
--
-- This is a temporary hack.
++ (if platformArch (targetPlatform dflags) == ArchSPARC
then [SysTools.Option "-mcpu=v9"]
else [])
++ [ SysTools.Option "-c"
, SysTools.FileOption "" input_fn
, SysTools.Option "-o"
, SysTools.FileOption "" output_fn
])
return (next_phase, output_fn)
-- This is for calling the assembler on a split assembly file (so a collection
-- of assembly files) | 2,404 | runPhase As input_fn dflags hooks
= do
-- LLVM from version 3.0 onwards doesn't support the OS X system
-- assembler, so we use clang as the assembler instead. (#5636)
let whichAsProg | hscTarget dflags == HscLlvm &&
platformOS (targetPlatform dflags) == OSDarwin
= do
llvmVer <- io $ figureLlvmVersion dflags
return $ case llvmVer of
-- using cGccLinkerOpts here but not clear if
-- opt_c isn't a better choice
Just n | n >= 30 ->
(SysTools.runClang, cGccLinkerOpts)
_ -> (SysTools.runAs, getOpts dflags opt_a)
| otherwise
= return (SysTools.runAs, getOpts dflags opt_a)
(as_prog, as_opts) <- whichAsProg
let cmdline_include_paths = includePaths dflags
next_phase <- maybeMergeStub
output_fn <- phaseOutputFilename next_phase
-- we create directories for the object file, because it
-- might be a hierarchical module.
io $ createDirectoryIfMissing True (takeDirectory output_fn)
io $ as_prog dflags
(map SysTools.Option as_opts
++ [ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
-- We only support SparcV9 and better because V8 lacks an atomic CAS
-- instruction so we have to make sure that the assembler accepts the
-- instruction set. Note that the user can still override this
-- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag
-- regardless of the ordering.
--
-- This is a temporary hack.
++ (if platformArch (targetPlatform dflags) == ArchSPARC
then [SysTools.Option "-mcpu=v9"]
else [])
++ [ SysTools.Option "-c"
, SysTools.FileOption "" input_fn
, SysTools.Option "-o"
, SysTools.FileOption "" output_fn
])
return (next_phase, output_fn)
-- This is for calling the assembler on a split assembly file (so a collection
-- of assembly files) | 2,404 | runPhase As input_fn dflags hooks
= do
-- LLVM from version 3.0 onwards doesn't support the OS X system
-- assembler, so we use clang as the assembler instead. (#5636)
let whichAsProg | hscTarget dflags == HscLlvm &&
platformOS (targetPlatform dflags) == OSDarwin
= do
llvmVer <- io $ figureLlvmVersion dflags
return $ case llvmVer of
-- using cGccLinkerOpts here but not clear if
-- opt_c isn't a better choice
Just n | n >= 30 ->
(SysTools.runClang, cGccLinkerOpts)
_ -> (SysTools.runAs, getOpts dflags opt_a)
| otherwise
= return (SysTools.runAs, getOpts dflags opt_a)
(as_prog, as_opts) <- whichAsProg
let cmdline_include_paths = includePaths dflags
next_phase <- maybeMergeStub
output_fn <- phaseOutputFilename next_phase
-- we create directories for the object file, because it
-- might be a hierarchical module.
io $ createDirectoryIfMissing True (takeDirectory output_fn)
io $ as_prog dflags
(map SysTools.Option as_opts
++ [ SysTools.Option ("-I" ++ p) | p <- cmdline_include_paths ]
-- We only support SparcV9 and better because V8 lacks an atomic CAS
-- instruction so we have to make sure that the assembler accepts the
-- instruction set. Note that the user can still override this
-- (e.g., -mcpu=ultrasparc). GCC picks the "best" -mcpu flag
-- regardless of the ordering.
--
-- This is a temporary hack.
++ (if platformArch (targetPlatform dflags) == ArchSPARC
then [SysTools.Option "-mcpu=v9"]
else [])
++ [ SysTools.Option "-c"
, SysTools.FileOption "" input_fn
, SysTools.Option "-o"
, SysTools.FileOption "" output_fn
])
return (next_phase, output_fn)
-- This is for calling the assembler on a split assembly file (so a collection
-- of assembly files) | 2,404 | false | false | 0 | 20 | 989 | 367 | 182 | 185 | null | null |
ducis/haAni | hs/common/Graphics/Rendering/OpenGL/GL/QueryUtils.hs | gpl-2.0 | getVertexAttribIuInteger4 :: (GLuint -> GLuint -> GLuint -> GLuint -> b) -> AttribLocation -> GetVertexAttribPName -> IO b
getVertexAttribIuInteger4 f (AttribLocation location) n = alloca $ \buf -> do
glGetVertexAttribIuiv location (marshalGetVertexAttribPName n) buf
peek4 f buf
-------------------------------------------------------------------------------- | 367 | getVertexAttribIuInteger4 :: (GLuint -> GLuint -> GLuint -> GLuint -> b) -> AttribLocation -> GetVertexAttribPName -> IO b
getVertexAttribIuInteger4 f (AttribLocation location) n = alloca $ \buf -> do
glGetVertexAttribIuiv location (marshalGetVertexAttribPName n) buf
peek4 f buf
-------------------------------------------------------------------------------- | 367 | getVertexAttribIuInteger4 f (AttribLocation location) n = alloca $ \buf -> do
glGetVertexAttribIuiv location (marshalGetVertexAttribPName n) buf
peek4 f buf
-------------------------------------------------------------------------------- | 244 | false | true | 0 | 11 | 44 | 92 | 45 | 47 | null | null |
adk9/haskell-streamit | Language/StreamIt/Compile.hs | bsd-3-clause | -- | Compiles the given StreamIt file (using strc) to an executable and
-- returns the directory in which the file was generated.
callStrc :: FilePath -> IO (FilePath)
callStrc file = do
fp <- createTempDirectory "." "streamit.d"
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory fp
exitCode <- rawSystem "strc" ["../" ++ file]
S.when (exitCode /= ExitSuccess) $ do
(ignoringIOErrors . removeDirectoryRecursive) fp
fail "strc failed.")
return fp
-- | Compile a generated TBB C++ file (using g++) and returns the directory
-- in which the file was generated | 644 | callStrc :: FilePath -> IO (FilePath)
callStrc file = do
fp <- createTempDirectory "." "streamit.d"
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory fp
exitCode <- rawSystem "strc" ["../" ++ file]
S.when (exitCode /= ExitSuccess) $ do
(ignoringIOErrors . removeDirectoryRecursive) fp
fail "strc failed.")
return fp
-- | Compile a generated TBB C++ file (using g++) and returns the directory
-- in which the file was generated | 511 | callStrc file = do
fp <- createTempDirectory "." "streamit.d"
bracket getCurrentDirectory setCurrentDirectory
(\_ -> do
setCurrentDirectory fp
exitCode <- rawSystem "strc" ["../" ++ file]
S.when (exitCode /= ExitSuccess) $ do
(ignoringIOErrors . removeDirectoryRecursive) fp
fail "strc failed.")
return fp
-- | Compile a generated TBB C++ file (using g++) and returns the directory
-- in which the file was generated | 473 | true | true | 0 | 17 | 148 | 127 | 60 | 67 | null | null |
mrkkrp/stack | src/Stack/SetupCmd.hs | bsd-3-clause | setupParser :: OA.Parser SetupCmdOpts
setupParser = SetupCmdOpts
<$> OA.optional (OA.argument readVersion
(OA.metavar "GHC_VERSION" <>
OA.help ("Version of GHC to install, e.g. 7.10.2. " ++
"The default is to install the version implied by the resolver.")))
<*> OA.boolFlags False
"reinstall"
"reinstalling GHC, even if available (incompatible with --system-ghc)"
OA.idm
<*> OA.optional cabalUpgradeParser
<*> setupYamlCompatParser
<*> OA.optional (OA.strOption
(OA.long "ghc-bindist"
<> OA.metavar "URL"
<> OA.help "Alternate GHC binary distribution (requires custom --ghc-variant)"))
<*> OA.many (OA.strOption
(OA.long "ghcjs-boot-options"
<> OA.metavar "GHCJS_BOOT"
<> OA.help "Additional ghcjs-boot options"))
<*> OA.boolFlags True
"ghcjs-boot-clean"
"Control if ghcjs-boot should have --clean option present"
OA.idm
where
readVersion = do
s <- OA.readerAsk
case parseCompilerVersion ("ghc-" <> T.pack s) of
Nothing ->
case parseCompilerVersion (T.pack s) of
Nothing -> OA.readerError $ "Invalid version: " ++ s
Just x -> return x
Just x -> return x | 1,370 | setupParser :: OA.Parser SetupCmdOpts
setupParser = SetupCmdOpts
<$> OA.optional (OA.argument readVersion
(OA.metavar "GHC_VERSION" <>
OA.help ("Version of GHC to install, e.g. 7.10.2. " ++
"The default is to install the version implied by the resolver.")))
<*> OA.boolFlags False
"reinstall"
"reinstalling GHC, even if available (incompatible with --system-ghc)"
OA.idm
<*> OA.optional cabalUpgradeParser
<*> setupYamlCompatParser
<*> OA.optional (OA.strOption
(OA.long "ghc-bindist"
<> OA.metavar "URL"
<> OA.help "Alternate GHC binary distribution (requires custom --ghc-variant)"))
<*> OA.many (OA.strOption
(OA.long "ghcjs-boot-options"
<> OA.metavar "GHCJS_BOOT"
<> OA.help "Additional ghcjs-boot options"))
<*> OA.boolFlags True
"ghcjs-boot-clean"
"Control if ghcjs-boot should have --clean option present"
OA.idm
where
readVersion = do
s <- OA.readerAsk
case parseCompilerVersion ("ghc-" <> T.pack s) of
Nothing ->
case parseCompilerVersion (T.pack s) of
Nothing -> OA.readerError $ "Invalid version: " ++ s
Just x -> return x
Just x -> return x | 1,370 | setupParser = SetupCmdOpts
<$> OA.optional (OA.argument readVersion
(OA.metavar "GHC_VERSION" <>
OA.help ("Version of GHC to install, e.g. 7.10.2. " ++
"The default is to install the version implied by the resolver.")))
<*> OA.boolFlags False
"reinstall"
"reinstalling GHC, even if available (incompatible with --system-ghc)"
OA.idm
<*> OA.optional cabalUpgradeParser
<*> setupYamlCompatParser
<*> OA.optional (OA.strOption
(OA.long "ghc-bindist"
<> OA.metavar "URL"
<> OA.help "Alternate GHC binary distribution (requires custom --ghc-variant)"))
<*> OA.many (OA.strOption
(OA.long "ghcjs-boot-options"
<> OA.metavar "GHCJS_BOOT"
<> OA.help "Additional ghcjs-boot options"))
<*> OA.boolFlags True
"ghcjs-boot-clean"
"Control if ghcjs-boot should have --clean option present"
OA.idm
where
readVersion = do
s <- OA.readerAsk
case parseCompilerVersion ("ghc-" <> T.pack s) of
Nothing ->
case parseCompilerVersion (T.pack s) of
Nothing -> OA.readerError $ "Invalid version: " ++ s
Just x -> return x
Just x -> return x | 1,332 | false | true | 20 | 16 | 452 | 312 | 149 | 163 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.