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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
marcellussiegburg/autotool | yesod/Handler/Gruppen.hs | gpl-2.0 | postGruppenR :: VorlesungId -> Handler Html
postGruppenR vorlesungId = do
authId <- requireAuthId
vorlesung <- runDB $ get404 vorlesungId
gruppen <- runDB $ selectList [GruppeVorlesungId ==. vorlesungId] []
einschreibungen <- runDB $ selectKeysList [EinschreibungId <-. map (EinschreibungKey authId . entityKey) ... | 925 | postGruppenR :: VorlesungId -> Handler Html
postGruppenR vorlesungId = do
authId <- requireAuthId
vorlesung <- runDB $ get404 vorlesungId
gruppen <- runDB $ selectList [GruppeVorlesungId ==. vorlesungId] []
einschreibungen <- runDB $ selectKeysList [EinschreibungId <-. map (EinschreibungKey authId . entityKey) ... | 925 | postGruppenR vorlesungId = do
authId <- requireAuthId
vorlesung <- runDB $ get404 vorlesungId
gruppen <- runDB $ selectList [GruppeVorlesungId ==. vorlesungId] []
einschreibungen <- runDB $ selectKeysList [EinschreibungId <-. map (EinschreibungKey authId . entityKey) gruppen] []
let gs `haben` es = map (\g ->... | 881 | false | true | 0 | 16 | 143 | 321 | 152 | 169 | null | null |
kmate/raw-feldspar-mcs | examples/Channel.hs | bsd-3-clause | -- test = vectors 5
testAll = do
icompileAll `onParallella` test
let modules = compileAll `onParallella` test
forM_ modules $ \(name, contents) -> do
let name' = if name Prelude.== "main" then "host" else name
writeFile (name' Prelude.++ ".c") contents | 281 | testAll = do
icompileAll `onParallella` test
let modules = compileAll `onParallella` test
forM_ modules $ \(name, contents) -> do
let name' = if name Prelude.== "main" then "host" else name
writeFile (name' Prelude.++ ".c") contents | 260 | testAll = do
icompileAll `onParallella` test
let modules = compileAll `onParallella` test
forM_ modules $ \(name, contents) -> do
let name' = if name Prelude.== "main" then "host" else name
writeFile (name' Prelude.++ ".c") contents | 260 | true | false | 0 | 15 | 68 | 92 | 48 | 44 | null | null |
roberth/uu-helium | test/typeerrors/Heuristics/AppNotABinFunction2.hs | gpl-3.0 | test :: Bool -> Bool -> Bool
test x y = (x && y) `not` (x || y) | 63 | test :: Bool -> Bool -> Bool
test x y = (x && y) `not` (x || y) | 63 | test x y = (x && y) `not` (x || y) | 34 | false | true | 0 | 8 | 17 | 49 | 25 | 24 | null | null |
maarons/Cortex | Miranda/CommitRaw.hs | agpl-3.0 | getValueHash (Commit (_, Set hash, _, _)) = return hash | 55 | getValueHash (Commit (_, Set hash, _, _)) = return hash | 55 | getValueHash (Commit (_, Set hash, _, _)) = return hash | 55 | false | false | 0 | 9 | 9 | 33 | 17 | 16 | null | null |
lwchkg/sunlight-x | test/code-snippets/haskell.hs | apache-2.0 | fits n NoDoc = False | 34 | fits n NoDoc = False | 34 | fits n NoDoc = False | 34 | false | false | 0 | 5 | 18 | 12 | 5 | 7 | null | null |
pgj/bead | src/Bead/Controller/Pages.hs | bsd-3-clause | courseOverview ck = View . CourseOverview ck | 50 | courseOverview ck = View . CourseOverview ck | 50 | courseOverview ck = View . CourseOverview ck | 50 | false | false | 0 | 6 | 12 | 16 | 7 | 9 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Feature.hs | bsd-3-clause | unCreate :: Ptr FeaturePtr -> IO Feature
unCreate p = do
fid <- fromIntegral <$> [C.exp|int { (*$(feature_ptr* p))->id() }|]
geometry <- Geometry.unsafeNewMaybe $ \g ->
[C.block|void {
auto feat = *$(feature_ptr *p);
if (! geometry::is_empty(feat->get_geometry()) ) {
*$(geometry_t **g) = new geome... | 1,079 | unCreate :: Ptr FeaturePtr -> IO Feature
unCreate p = do
fid <- fromIntegral <$> [C.exp|int { (*$(feature_ptr* p))->id() }|]
geometry <- Geometry.unsafeNewMaybe $ \g ->
[C.block|void {
auto feat = *$(feature_ptr *p);
if (! geometry::is_empty(feat->get_geometry()) ) {
*$(geometry_t **g) = new geome... | 1,079 | unCreate p = do
fid <- fromIntegral <$> [C.exp|int { (*$(feature_ptr* p))->id() }|]
geometry <- Geometry.unsafeNewMaybe $ \g ->
[C.block|void {
auto feat = *$(feature_ptr *p);
if (! geometry::is_empty(feat->get_geometry()) ) {
*$(geometry_t **g) = new geometry_t(feat->get_geometry());
} else {... | 1,038 | false | true | 0 | 15 | 269 | 234 | 119 | 115 | null | null |
spacekitteh/smcghc | compiler/cmm/CLabel.hs | bsd-3-clause | addLabelSize label _
= label | 32 | addLabelSize label _
= label | 32 | addLabelSize label _
= label | 32 | false | false | 0 | 5 | 8 | 11 | 5 | 6 | null | null |
sordina/wai | auto-update/test/Control/DebounceSpec.hs | bsd-2-clause | spec :: Spec
spec = describe "mkDebounce" $ do
describe "Leading edge" $ do
it "works for a single event" $ do
(ref, debounced, baton, returnFromWait) <- getDebounce leadingEdge
debounced
waitUntil 5 $ readIORef ref >>= (`shouldBe` 1)
returnFromWait
... | 1,938 | spec :: Spec
spec = describe "mkDebounce" $ do
describe "Leading edge" $ do
it "works for a single event" $ do
(ref, debounced, baton, returnFromWait) <- getDebounce leadingEdge
debounced
waitUntil 5 $ readIORef ref >>= (`shouldBe` 1)
returnFromWait
... | 1,938 | spec = describe "mkDebounce" $ do
describe "Leading edge" $ do
it "works for a single event" $ do
(ref, debounced, baton, returnFromWait) <- getDebounce leadingEdge
debounced
waitUntil 5 $ readIORef ref >>= (`shouldBe` 1)
returnFromWait
pause
... | 1,925 | false | true | 2 | 15 | 752 | 507 | 245 | 262 | null | null |
Gabriel439/Haskell-Dhall-Library | dhall/tests/Dhall/Test/Tutorial.hs | bsd-3-clause | _Interpolation_0 :: TestTree
_Interpolation_0 = Test.Tasty.HUnit.testCase "Example #0" (do
e <- Util.code
" let name = \"John Doe\" \n\
\in let age = 21 \n\
\in \"My name is ${name} and my age is ${Natural/show a... | 403 | _Interpolation_0 :: TestTree
_Interpolation_0 = Test.Tasty.HUnit.testCase "Example #0" (do
e <- Util.code
" let name = \"John Doe\" \n\
\in let age = 21 \n\
\in \"My name is ${name} and my age is ${Natural/show a... | 403 | _Interpolation_0 = Test.Tasty.HUnit.testCase "Example #0" (do
e <- Util.code
" let name = \"John Doe\" \n\
\in let age = 21 \n\
\in \"My name is ${name} and my age is ${Natural/show age}\"\n"
Util.assertNorma... | 374 | false | true | 0 | 11 | 160 | 45 | 22 | 23 | null | null |
alphaHeavy/cabal | Cabal/Distribution/Simple/UHC.hs | bsd-3-clause | uhcTarget, uhcTargetVariant :: String
uhcTarget = "bc" | 61 | uhcTarget, uhcTargetVariant :: String
uhcTarget = "bc" | 61 | uhcTarget = "bc" | 23 | false | true | 0 | 4 | 13 | 13 | 8 | 5 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/DiffCheck.hs | bsd-3-clause | diffLines n (Both i _ : d) = diffLines n' d where n' = n + i -- length ls | 102 | diffLines n (Both i _ : d) = diffLines n' d where n' = n + i -- length ls | 102 | diffLines n (Both i _ : d) = diffLines n' d where n' = n + i -- length ls | 102 | false | false | 0 | 7 | 48 | 42 | 20 | 22 | null | null |
jokusi/Astview | src/gui/Language/Astview/Gui/Actions.hs | mit | -- |similar to @whenJust@, but value is inside a monad
whenJustM :: Monad m => m(Maybe a) -> (a -> m ()) -> m ()
whenJustM val action = do
m <- val
whenJust m action
-- |returns the text in given text buffer | 212 | whenJustM :: Monad m => m(Maybe a) -> (a -> m ()) -> m ()
whenJustM val action = do
m <- val
whenJust m action
-- |returns the text in given text buffer | 157 | whenJustM val action = do
m <- val
whenJust m action
-- |returns the text in given text buffer | 99 | true | true | 0 | 11 | 48 | 74 | 35 | 39 | null | null |
tpsinnem/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | entries :: IBCFile -> [Entry]
entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
makeEntry "sourcefile" (sourcefile i),
makeEntry "ibc_imports" (ibc_imports i),
makeEntry "ibc_importdirs" (ibc_importdirs i),
make... | 3,247 | entries :: IBCFile -> [Entry]
entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
makeEntry "sourcefile" (sourcefile i),
makeEntry "ibc_imports" (ibc_imports i),
makeEntry "ibc_importdirs" (ibc_importdirs i),
make... | 3,247 | entries i = catMaybes [Just $ toEntry "ver" 0 (encode $ ver i),
makeEntry "sourcefile" (sourcefile i),
makeEntry "ibc_imports" (ibc_imports i),
makeEntry "ibc_importdirs" (ibc_importdirs i),
makeEntry "ibc_implicits" (ibc_im... | 3,217 | false | true | 0 | 11 | 1,335 | 717 | 356 | 361 | null | null |
wrengr/bytestring-trie | dev/Test/Main.hs | bsd-3-clause | test_Intersect :: Tasty.TestTree
test_Intersect =
Tasty.testGroup "intersectBy"
[ testEqual "intersectL" (tLeft `T.intersectL` tRight) tLeftResult
, testEqual "intersectR" (tLeft `T.intersectR` tRight) tRightResult
]
where
-- Trivial regression example
a, b, c :: S.ByteString
a = packC2W... | 753 | test_Intersect :: Tasty.TestTree
test_Intersect =
Tasty.testGroup "intersectBy"
[ testEqual "intersectL" (tLeft `T.intersectL` tRight) tLeftResult
, testEqual "intersectR" (tLeft `T.intersectR` tRight) tRightResult
]
where
-- Trivial regression example
a, b, c :: S.ByteString
a = packC2W... | 753 | test_Intersect =
Tasty.testGroup "intersectBy"
[ testEqual "intersectL" (tLeft `T.intersectL` tRight) tLeftResult
, testEqual "intersectR" (tLeft `T.intersectR` tRight) tRightResult
]
where
-- Trivial regression example
a, b, c :: S.ByteString
a = packC2W "a"
b = packC2W "b"
c = ... | 720 | false | true | 0 | 10 | 175 | 223 | 132 | 91 | null | null |
5outh/textlunky | src/TextlunkyParser.hs | mit | parseRope = parseUnary rope Rope | 44 | parseRope = parseUnary rope Rope | 44 | parseRope = parseUnary rope Rope | 44 | false | false | 1 | 5 | 16 | 15 | 5 | 10 | null | null |
geophf/1HaskellADay | exercises/HAD/Data/SymbolTable/Compiler.hs | mit | {--
gives a well-formatted SymbolTable String -> type-value Map representation
*Main> converter $ sequence ("hi", [1..10]) ~>
[" (\"hi\",S1) , (\"hi\",S2) , (\"hi\",S3) , (\"hi\",S4) , (\"hi\",S5) , (\"hi\",S6)",
" , (\"hi\",S7) , (\"hi\",S8) , (\"hi\",S9) , (\"hi\",S10)"]
--}
-- so we need to ensure to have Dat... | 510 | imports :: [String]
imports = ["import Data.Array","import Data.Map (Map)",
"import qualified Data.Map as Map","import Data.Maybe (fromMaybe)"] | 146 | imports = ["import Data.Array","import Data.Map (Map)",
"import qualified Data.Map as Map","import Data.Maybe (fromMaybe)"] | 126 | true | true | 0 | 5 | 80 | 28 | 18 | 10 | null | null |
rockdragon/julia-programming | code/haskell/RecursiveContents.hs | mit | main = do
putStrLn "please input the path:"
topDir <- getLine
files <- getRecursiveContents topDir
forM files putStrLn | 126 | main = do
putStrLn "please input the path:"
topDir <- getLine
files <- getRecursiveContents topDir
forM files putStrLn | 126 | main = do
putStrLn "please input the path:"
topDir <- getLine
files <- getRecursiveContents topDir
forM files putStrLn | 126 | false | false | 1 | 9 | 25 | 41 | 15 | 26 | null | null |
rbtcollins/causes | LaunchpadClient/Auth.hs | apache-2.0 | tempOrAccessToken :: (Control.MonadBaseControl IO m, MonadIO m) =>
OA.OAuth ->
ReaderT SqlBackend m (Bool, Token)
tempOrAccessToken oa =
do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds... | 910 | tempOrAccessToken :: (Control.MonadBaseControl IO m, MonadIO m) =>
OA.OAuth ->
ReaderT SqlBackend m (Bool, Token)
tempOrAccessToken oa =
do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds... | 910 | tempOrAccessToken oa =
do
maybeServer <- getBy $ UniqueServer "Launchpad"
case maybeServer of
Nothing -> do
temp_creds <- trace "requesting temporary credentials" (withManager $ \manager -> OA.getTemporaryCredential oa manager)
-- TODO: have something report... | 754 | false | true | 0 | 19 | 271 | 234 | 114 | 120 | null | null |
ihc/futhark | src/futhark-test.hs | isc | structTestConfig :: FutharkConfig
structTestConfig = newFutharkConfig { futharkWarn = False } | 93 | structTestConfig :: FutharkConfig
structTestConfig = newFutharkConfig { futharkWarn = False } | 93 | structTestConfig = newFutharkConfig { futharkWarn = False } | 59 | false | true | 0 | 6 | 10 | 19 | 11 | 8 | null | null |
agustinmista/mdviewer | app/Show.hs | gpl-3.0 | abortDialog :: Window -> IO ()
abortDialog window = do
dialog <- messageDialogNew (Just window) [] MessageError ButtonsOk
("An internal error happened. Aborting" :: String)
_ <- dialogRun dialog
widgetDestroy dialog
exitFailure | 266 | abortDialog :: Window -> IO ()
abortDialog window = do
dialog <- messageDialogNew (Just window) [] MessageError ButtonsOk
("An internal error happened. Aborting" :: String)
_ <- dialogRun dialog
widgetDestroy dialog
exitFailure | 266 | abortDialog window = do
dialog <- messageDialogNew (Just window) [] MessageError ButtonsOk
("An internal error happened. Aborting" :: String)
_ <- dialogRun dialog
widgetDestroy dialog
exitFailure | 234 | false | true | 0 | 10 | 70 | 74 | 34 | 40 | null | null |
keithodulaigh/Hets | mini/Main.hs | gpl-2.0 | main = do putStrLn "Enter spec\n"
s <- readLn
p s | 69 | main = do putStrLn "Enter spec\n"
s <- readLn
p s | 69 | main = do putStrLn "Enter spec\n"
s <- readLn
p s | 69 | false | false | 0 | 7 | 30 | 25 | 10 | 15 | null | null |
oprdyn/technique | src/Lookup.hs | mit | storeResource :: S.ByteString -> S.ByteString -> IO ()
storeResource d' t' =
bracket
(connect settings)
(\r -> runRedis r $ quit)
(\r -> runRedis r $ writeResource d' t') | 184 | storeResource :: S.ByteString -> S.ByteString -> IO ()
storeResource d' t' =
bracket
(connect settings)
(\r -> runRedis r $ quit)
(\r -> runRedis r $ writeResource d' t') | 184 | storeResource d' t' =
bracket
(connect settings)
(\r -> runRedis r $ quit)
(\r -> runRedis r $ writeResource d' t') | 129 | false | true | 0 | 8 | 42 | 83 | 40 | 43 | null | null |
akiradeveloper/msgpack-nim | GenTests/app/Main.hs | mit | msgShow (MsgBin32 xs) = "Bin32(@[" ++ binShow xs ++ "])" | 56 | msgShow (MsgBin32 xs) = "Bin32(@[" ++ binShow xs ++ "])" | 56 | msgShow (MsgBin32 xs) = "Bin32(@[" ++ binShow xs ++ "])" | 56 | false | false | 0 | 7 | 9 | 26 | 12 | 14 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmProf.hs | bsd-3-clause | ccsType :: DynFlags -> CmmType -- Type of a cost-centre stack
ccsType = bWord | 77 | ccsType :: DynFlags -> CmmType
ccsType = bWord | 46 | ccsType = bWord | 15 | true | true | 0 | 5 | 13 | 16 | 9 | 7 | null | null |
brendanhay/gogol | gogol-tagmanager/gen/Network/Google/Resource/TagManager/Accounts/Containers/Workspaces/Tags/Update.hs | mpl-2.0 | -- | V1 error format.
acwtucXgafv :: Lens' AccountsContainersWorkspacesTagsUpdate (Maybe Xgafv)
acwtucXgafv
= lens _acwtucXgafv (\ s a -> s{_acwtucXgafv = a}) | 160 | acwtucXgafv :: Lens' AccountsContainersWorkspacesTagsUpdate (Maybe Xgafv)
acwtucXgafv
= lens _acwtucXgafv (\ s a -> s{_acwtucXgafv = a}) | 138 | acwtucXgafv
= lens _acwtucXgafv (\ s a -> s{_acwtucXgafv = a}) | 64 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
bitemyapp/dejafu | tests/Tests/Logger.hs | mit | -- | Create a new logger with no internal log.
initLogger :: MonadConc m => m (Logger m)
initLogger = do
cmd <- newEmptyCVar
logg <- newCVar []
let l = Logger cmd logg
void . fork $ logger l
return l | 209 | initLogger :: MonadConc m => m (Logger m)
initLogger = do
cmd <- newEmptyCVar
logg <- newCVar []
let l = Logger cmd logg
void . fork $ logger l
return l | 162 | initLogger = do
cmd <- newEmptyCVar
logg <- newCVar []
let l = Logger cmd logg
void . fork $ logger l
return l | 120 | true | true | 0 | 11 | 51 | 87 | 37 | 50 | null | null |
danr/hipspec | examples/old-examples/hip/Expr.hs | gpl-3.0 | boolEq x y = False | 18 | boolEq x y = False | 18 | boolEq x y = False | 18 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
trobertson/merch | src/Merchandise/Types/Item.hs | bsd-3-clause | -- creates an empty Equipment
newEquipment :: Equipment
newEquipment = Equipment { _outfit = Nothing
, _armor = Nothing
, _weapon = Nothing
, _jewelry = Nothing } | 241 | newEquipment :: Equipment
newEquipment = Equipment { _outfit = Nothing
, _armor = Nothing
, _weapon = Nothing
, _jewelry = Nothing } | 211 | newEquipment = Equipment { _outfit = Nothing
, _armor = Nothing
, _weapon = Nothing
, _jewelry = Nothing } | 185 | true | true | 0 | 7 | 106 | 48 | 26 | 22 | null | null |
beni55/fay | src/Fay/Types/ModulePath.hs | bsd-3-clause | -- | Converting a QName to a ModulePath is only relevant for constructors since
-- they can conflict with module names.
mkModulePathFromQName :: QName a -> ModulePath
mkModulePathFromQName (Qual _ (ModuleName _ m) n) = mkModulePath $ ModuleName F.noI $ m ++ "." ++ unname n | 273 | mkModulePathFromQName :: QName a -> ModulePath
mkModulePathFromQName (Qual _ (ModuleName _ m) n) = mkModulePath $ ModuleName F.noI $ m ++ "." ++ unname n | 153 | mkModulePathFromQName (Qual _ (ModuleName _ m) n) = mkModulePath $ ModuleName F.noI $ m ++ "." ++ unname n | 106 | true | true | 0 | 10 | 45 | 69 | 33 | 36 | null | null |
drx/petal | Typechecker.hs | mit | tciseq psi i (TForall a t) =
tciseq psi i t | 47 | tciseq psi i (TForall a t) =
tciseq psi i t | 47 | tciseq psi i (TForall a t) =
tciseq psi i t | 47 | false | false | 0 | 7 | 14 | 28 | 13 | 15 | null | null |
hvr/jhc | src/Deriving/Traverse.hs | mit | isRight _ = False | 17 | isRight _ = False | 17 | isRight _ = False | 17 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
GaloisInc/halvm-ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | ruleArity (Rule {ru_args = args}) = length args | 52 | ruleArity (Rule {ru_args = args}) = length args | 52 | ruleArity (Rule {ru_args = args}) = length args | 52 | false | false | 0 | 8 | 12 | 25 | 12 | 13 | null | null |
j-rock/lambduh | src/Language/Parse.hs | mit | identifier :: Parser Text
identifier = do l <- letter
ls <- many (letter <|> digit <|> char '_')
return $ T.pack (l:ls)
--so far, first term must be parenthesized lest we incur an infinite loop | 226 | identifier :: Parser Text
identifier = do l <- letter
ls <- many (letter <|> digit <|> char '_')
return $ T.pack (l:ls)
--so far, first term must be parenthesized lest we incur an infinite loop | 226 | identifier = do l <- letter
ls <- many (letter <|> digit <|> char '_')
return $ T.pack (l:ls)
--so far, first term must be parenthesized lest we incur an infinite loop | 200 | false | true | 0 | 12 | 68 | 71 | 32 | 39 | null | null |
mcmaniac/ghc | compiler/codeGen/CgForeignCall.hs | bsd-3-clause | stack_STACK = closureField oFFSET_StgStack_stack | 49 | stack_STACK = closureField oFFSET_StgStack_stack | 49 | stack_STACK = closureField oFFSET_StgStack_stack | 49 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
temoto/nginx-lint | NginxLint/Main.hs | mit | processFile :: (NgFile -> IO ()) -> FilePath -> IO ()
processFile fun fname = do
result <- parseFromFile parseFile fname
case result of
Left err -> do
print err
exitFailure
Right ngfile -> fun ngfile | 251 | processFile :: (NgFile -> IO ()) -> FilePath -> IO ()
processFile fun fname = do
result <- parseFromFile parseFile fname
case result of
Left err -> do
print err
exitFailure
Right ngfile -> fun ngfile | 251 | processFile fun fname = do
result <- parseFromFile parseFile fname
case result of
Left err -> do
print err
exitFailure
Right ngfile -> fun ngfile | 197 | false | true | 0 | 12 | 87 | 90 | 40 | 50 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 1516 = 1515 | 11 | 1516 = 1515 | 11 | 1516 = 1515 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
Saulzar/reflex | src/Reflex/Class.hs | bsd-3-clause | -- | This function converts a 'DMap' whose elements are 'Dynamic's into a
-- 'Dynamic' 'DMap'. Its implementation is more efficient than doing the same
-- through the use of multiple uses of 'zipDynWith' or 'Applicative' operators.
distributeDMapOverDynPureG
:: forall t k q v. (Reflex t, GCompare k)
=> (forall a. ... | 929 | distributeDMapOverDynPureG
:: forall t k q v. (Reflex t, GCompare k)
=> (forall a. q a -> Dynamic t (v a))
-> DMap k q -> Dynamic t (DMap k v)
distributeDMapOverDynPureG nt dm = case DMap.toList dm of
[] -> constDyn DMap.empty
[k :=> v] -> DMap.singleton k <$> nt v
_ ->
let getInitial = DMap.traverseWit... | 696 | distributeDMapOverDynPureG nt dm = case DMap.toList dm of
[] -> constDyn DMap.empty
[k :=> v] -> DMap.singleton k <$> nt v
_ ->
let getInitial = DMap.traverseWithKey (\_ -> sample . current . nt) dm
edmPre = mergeG getCompose $ DMap.map (Compose . updated . nt) dm
result = unsafeBuildDynamic g... | 547 | true | true | 0 | 19 | 213 | 285 | 142 | 143 | null | null |
kwangkim/pigment | src-web/hs/Cochon/Reactify.hs | mit | pairHelper (DPAIR a b) = a : pairHelper b | 41 | pairHelper (DPAIR a b) = a : pairHelper b | 41 | pairHelper (DPAIR a b) = a : pairHelper b | 41 | false | false | 2 | 6 | 8 | 27 | 11 | 16 | null | null |
silkapp/tagsoup | dead/parser/Compiler/OptimiseLp.hs | bsd-3-clause | ---------------------------------------------------------------------
-- Remove adjacent strings for primitive calls
collapsePrimArgs :: Program -> Program
collapsePrimArgs = transformBi f
where
f (Prim name args) = Prim name (g args)
f x = x
g (Lit x:Lit y:xs) = g $ Lit (x++y) : x... | 485 | collapsePrimArgs :: Program -> Program
collapsePrimArgs = transformBi f
where
f (Prim name args) = Prim name (g args)
f x = x
g (Lit x:Lit y:xs) = g $ Lit (x++y) : xs
g (x:xs) = x : g xs
g [] = []
---------------------------------------------------------------------... | 367 | collapsePrimArgs = transformBi f
where
f (Prim name args) = Prim name (g args)
f x = x
g (Lit x:Lit y:xs) = g $ Lit (x++y) : xs
g (x:xs) = x : g xs
g [] = []
---------------------------------------------------------------------
-- Remove rules that are unreachable f... | 328 | true | true | 4 | 12 | 116 | 137 | 69 | 68 | null | null |
uemurax/carettah | Carettah.hs | gpl-2.0 | markdown :: String -> P.Pandoc
markdown = P.readMarkdown P.def{ P.readerStandalone = True } | 91 | markdown :: String -> P.Pandoc
markdown = P.readMarkdown P.def{ P.readerStandalone = True } | 91 | markdown = P.readMarkdown P.def{ P.readerStandalone = True } | 60 | false | true | 0 | 7 | 12 | 34 | 18 | 16 | null | null |
davideGiovannini/scheme-repl | src/Evaluation/Primitives.hs | bsd-3-clause | head_ [DottedList (x : _) _] = return x | 39 | head_ [DottedList (x : _) _] = return x | 39 | head_ [DottedList (x : _) _] = return x | 39 | false | false | 0 | 8 | 8 | 28 | 13 | 15 | null | null |
dewey92/number-to-bahasa | src/Main.hs | mit | puluhan ['0',s] = satuan s | 26 | puluhan ['0',s] = satuan s | 26 | puluhan ['0',s] = satuan s | 26 | false | false | 0 | 6 | 4 | 18 | 9 | 9 | null | null |
tdammers/resourcerer | app/Main.hs | bsd-3-clause | main :: IO ()
main = do
resource <- makeRootResource
port <- fromMaybe 5000 . fmap read <$> lookupEnv "PORT"
run port (resourceToApplication resource) | 162 | main :: IO ()
main = do
resource <- makeRootResource
port <- fromMaybe 5000 . fmap read <$> lookupEnv "PORT"
run port (resourceToApplication resource) | 162 | main = do
resource <- makeRootResource
port <- fromMaybe 5000 . fmap read <$> lookupEnv "PORT"
run port (resourceToApplication resource) | 148 | false | true | 0 | 11 | 35 | 67 | 28 | 39 | null | null |
vvmann/tyckiting-bot | clients/haskell/src/Tyckiting/AI/Joker.hs | mit | safeMinimumBy f xs@(_:_) = Just $ minimumBy f xs | 48 | safeMinimumBy f xs@(_:_) = Just $ minimumBy f xs | 48 | safeMinimumBy f xs@(_:_) = Just $ minimumBy f xs | 48 | false | false | 0 | 8 | 8 | 30 | 15 | 15 | null | null |
iu-parfunc/containers | Data/Sequence.hs | bsd-3-clause | partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which... | 346 | partition :: (a -> Bool) -> Seq a -> (Seq a, Seq a)
partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which... | 346 | partition p = foldl part (empty, empty)
where
part (xs, ys) x
| p x = (xs |> x, ys)
| otherwise = (xs, ys |> x)
-- | /O(n)/. The 'filter' function takes a predicate @p@ and a sequence
-- @xs@ and returns a sequence of those elements which satisfy the
-- predicate. | 294 | false | true | 0 | 10 | 96 | 128 | 63 | 65 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 261326 = 4380 | 33 | getValueFromProduct 261326 = 4380 | 33 | getValueFromProduct 261326 = 4380 | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
bstamour/weather | src/Net/Weather.hs | bsd-3-clause | getProperty :: FromJSON a => Text -> Value -> Maybe a
getProperty property (Object v) = do
val <- H.lookup property v
case fromJSON val of
Error _ -> Nothing
Success x -> Just x | 189 | getProperty :: FromJSON a => Text -> Value -> Maybe a
getProperty property (Object v) = do
val <- H.lookup property v
case fromJSON val of
Error _ -> Nothing
Success x -> Just x | 189 | getProperty property (Object v) = do
val <- H.lookup property v
case fromJSON val of
Error _ -> Nothing
Success x -> Just x | 135 | false | true | 0 | 10 | 46 | 85 | 38 | 47 | null | null |
NightRa/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f } | 72 | ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f } | 72 | ibc i (IBCAccess n a) f = return f { ibc_access = (n,a) : ibc_access f } | 72 | false | false | 0 | 9 | 16 | 47 | 23 | 24 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type/List.hs | gpl-3.0 | toListC (CCons x xs) = x:toListC xs | 35 | toListC (CCons x xs) = x:toListC xs | 35 | toListC (CCons x xs) = x:toListC xs | 35 | false | false | 0 | 7 | 6 | 24 | 11 | 13 | null | null |
anton-k/language-css | src/Language/Css/Build/Tags.hs | bsd-3-clause | -- | @label@ tag
label :: Sel'
label = ident "label" | 52 | label :: Sel'
label = ident "label" | 35 | label = ident "label" | 21 | true | true | 0 | 6 | 10 | 22 | 9 | 13 | null | null |
acowley/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | runCoreM :: HscEnv
-> RuleBase
-> UniqSupply
-> Module
-> ModuleSet
-> PrintUnqualified
-> SrcSpan
-> CoreM a
-> IO (a, SimplCount)
runCoreM hsc_env rule_base us mod orph_imps print_unqual loc m
= do { glbls <- saveLinkerGlobals
; liftM ex... | 1,206 | runCoreM :: HscEnv
-> RuleBase
-> UniqSupply
-> Module
-> ModuleSet
-> PrintUnqualified
-> SrcSpan
-> CoreM a
-> IO (a, SimplCount)
runCoreM hsc_env rule_base us mod orph_imps print_unqual loc m
= do { glbls <- saveLinkerGlobals
; liftM ex... | 1,206 | runCoreM hsc_env rule_base us mod orph_imps print_unqual loc m
= do { glbls <- saveLinkerGlobals
; liftM extract $ runIOEnv (reader glbls) $ unCoreM m state }
where
reader glbls = CoreReader {
cr_hsc_env = hsc_env,
cr_rule_base = rule_base,
cr_module = mod,
... | 1,002 | false | true | 2 | 15 | 476 | 251 | 131 | 120 | null | null |
DavidAlphaFox/darcs | src/Darcs/Util/Exception.hs | gpl-2.0 | prettyException :: SomeException
-> String
prettyException e | Just ioe <- fromException e, isUserError ioe = ioeGetErrorString ioe | 147 | prettyException :: SomeException
-> String
prettyException e | Just ioe <- fromException e, isUserError ioe = ioeGetErrorString ioe | 147 | prettyException e | Just ioe <- fromException e, isUserError ioe = ioeGetErrorString ioe | 88 | false | true | 0 | 9 | 33 | 44 | 19 | 25 | null | null |
hansonkd/snap-boiler-plate | SnapApp/Forms.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Our Forms using Digestive Functors
------------------------------------------------------------------------------
-- | Change Passwords
newPassForm :: OpenIdUser -> Form T.Text AppHandler T.Text
newPassForm user = validateM checkPassword... | 909 | newPassForm :: OpenIdUser -> Form T.Text AppHandler T.Text
newPassForm user = validateM checkPassword $ (,) <$> "originalPass" .: checkM "Wrong Password" rightPassword (text Nothing)
<*> "passphrase" .: passwordConfirmer
where rightPasswo... | 690 | newPassForm user = validateM checkPassword $ (,) <$> "originalPass" .: checkM "Wrong Password" rightPassword (text Nothing)
<*> "passphrase" .: passwordConfirmer
where rightPassword pw = confirmOIDPassphrase user pw
... | 631 | true | true | 0 | 13 | 301 | 139 | 70 | 69 | null | null |
benkolera/haskell-chess | tests/main.hs | bsd-2-clause | __ = Nothing | 12 | __ = Nothing | 12 | __ = Nothing | 12 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
natepisarski/modmaster | Modmaster/Client.hs | bsd-3-clause | setRegister :: String -> String -> String -> IO ()
setRegister prog reg val = do
flines <- CIO.filelines config
let registerDirectory = conf flines "registers"
testRegister registerDirectory prog reg val | 209 | setRegister :: String -> String -> String -> IO ()
setRegister prog reg val = do
flines <- CIO.filelines config
let registerDirectory = conf flines "registers"
testRegister registerDirectory prog reg val | 209 | setRegister prog reg val = do
flines <- CIO.filelines config
let registerDirectory = conf flines "registers"
testRegister registerDirectory prog reg val | 158 | false | true | 0 | 11 | 36 | 78 | 34 | 44 | null | null |
project-horizon/framework | src/lib/Language/JavaScript/DSL/Operators/Comparison.hs | mit | (.==) (DOM.Object l) (DOM.Object r) = DOM.BooleanLiteral (l == r) | 81 | (.==) (DOM.Object l) (DOM.Object r) = DOM.BooleanLiteral (l == r) | 81 | (.==) (DOM.Object l) (DOM.Object r) = DOM.BooleanLiteral (l == r) | 81 | false | false | 1 | 8 | 25 | 43 | 21 | 22 | null | null |
fmapfmapfmap/amazonka | amazonka-s3/test/Test/AWS/Gen/S3.hs | mpl-2.0 | testGetBucketNotificationConfigurationResponse :: NotificationConfiguration -> TestTree
testGetBucketNotificationConfigurationResponse = res
"GetBucketNotificationConfigurationResponse"
"fixture/GetBucketNotificationConfigurationResponse.proto"
s3
(Proxy :: Proxy GetBucketNotificationConfiguration) | 315 | testGetBucketNotificationConfigurationResponse :: NotificationConfiguration -> TestTree
testGetBucketNotificationConfigurationResponse = res
"GetBucketNotificationConfigurationResponse"
"fixture/GetBucketNotificationConfigurationResponse.proto"
s3
(Proxy :: Proxy GetBucketNotificationConfiguration) | 315 | testGetBucketNotificationConfigurationResponse = res
"GetBucketNotificationConfigurationResponse"
"fixture/GetBucketNotificationConfigurationResponse.proto"
s3
(Proxy :: Proxy GetBucketNotificationConfiguration) | 227 | false | true | 0 | 6 | 30 | 36 | 17 | 19 | null | null |
reiddraper/cauterize | src/Cauterize/Dynamic/Meta/Unpack.hs | bsd-3-clause | dynamicMetaUnpackFromHeader :: Spec.Spec -> MetaHeader -> B.ByteString -> Either T.Text (MetaType, B.ByteString)
dynamicMetaUnpackFromHeader spec (MetaHeader _ tag) b = case runGetState p b 0 of
Right r -> Right r
... | 562 | dynamicMetaUnpackFromHeader :: Spec.Spec -> MetaHeader -> B.ByteString -> Either T.Text (MetaType, B.ByteString)
dynamicMetaUnpackFromHeader spec (MetaHeader _ tag) b = case runGetState p b 0 of
Right r -> Right r
... | 562 | dynamicMetaUnpackFromHeader spec (MetaHeader _ tag) b = case runGetState p b 0 of
Right r -> Right r
Left e -> Left $ T.pack e
where
p = case tag `M.lookup` m of
Nothing -> fail $ "Invalid... | 449 | false | true | 2 | 13 | 213 | 181 | 85 | 96 | null | null |
takoeight0821/malgo | src/Malgo/Refine/Space.hs | bsd-3-clause | -- | subtraction of s1 and s2
subtract :: MonadReader RefineEnv m => Space -> Space -> m Space
subtract Empty _ = pure Empty | 124 | subtract :: MonadReader RefineEnv m => Space -> Space -> m Space
subtract Empty _ = pure Empty | 94 | subtract Empty _ = pure Empty | 29 | true | true | 0 | 8 | 24 | 40 | 19 | 21 | null | null |
IreneKnapp/direct-binary-files | BinaryFiles.hs | mit | throwImplementation
:: (Monad (m context),
Monad m',
MonadSerial m,
SerializationFailure failure)
=> ((internals
-> context
-> [(Int, String)]
-> Window
-> m' (Either (Int, [(Int, String)], SomeSerializationFailure)
(internals, a)))
-> m conte... | 522 | throwImplementation
:: (Monad (m context),
Monad m',
MonadSerial m,
SerializationFailure failure)
=> ((internals
-> context
-> [(Int, String)]
-> Window
-> m' (Either (Int, [(Int, String)], SomeSerializationFailure)
(internals, a)))
-> m conte... | 522 | throwImplementation constructor failure = do
offset <- primitiveTell
constructor $ \_ _ tags _ ->
return $ Left (offset, tags, toSerializationFailure failure) | 166 | false | true | 0 | 20 | 149 | 186 | 97 | 89 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/AcceptVpcPeeringConnection.hs | mpl-2.0 | -- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have the
-- required permissions, the error response is 'DryRunOperation'. Otherwise, it is 'UnauthorizedOperation'.
avpcDryRun :: Lens' AcceptVpcPeeringConnection (Maybe ... | 387 | avpcDryRun :: Lens' AcceptVpcPeeringConnection (Maybe Bool)
avpcDryRun = lens _avpcDryRun (\s a -> s { _avpcDryRun = a }) | 121 | avpcDryRun = lens _avpcDryRun (\s a -> s { _avpcDryRun = a }) | 61 | true | true | 0 | 9 | 57 | 48 | 27 | 21 | null | null |
bitemyapp/blpapi-hs | examples/AuthorizationHelper.hs | mit | throwOnError (Left str) = fail str | 34 | throwOnError (Left str) = fail str | 34 | throwOnError (Left str) = fail str | 34 | false | false | 0 | 6 | 5 | 19 | 8 | 11 | null | null |
toonn/quintessence | src/Lexer.hs | bsd-2-clause | braces :: Parser a -> Parser a
braces = between (Mp.char '{') (Mp.char '}') | 75 | braces :: Parser a -> Parser a
braces = between (Mp.char '{') (Mp.char '}') | 75 | braces = between (Mp.char '{') (Mp.char '}') | 44 | false | true | 0 | 8 | 13 | 42 | 20 | 22 | null | null |
vikraman/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | isListCompExpr PArrComp = True | 39 | isListCompExpr PArrComp = True | 39 | isListCompExpr PArrComp = True | 39 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
Philonous/pontarius-xmpp | source/Network/Xmpp/IM/Message.hs | bsd-3-clause | imToElements :: InstantMessage -> [Element]
imToElements im = pickle xpIM (sanitizeIM im) | 89 | imToElements :: InstantMessage -> [Element]
imToElements im = pickle xpIM (sanitizeIM im) | 89 | imToElements im = pickle xpIM (sanitizeIM im) | 45 | false | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
anttisalonen/starrover2 | src/SpaceState/Game.hs | mit | drawSpace :: StateT SpaceState IO ()
drawSpace = do
state <- State.get
modify $ modCameraState $ modCamZoom $ (+ (camzoomdelta $ camstate state))
modify $ modCameraState $ modCamera $ setZoom $ clamp 30 250 $ (camzoom $ camstate state) + (400 * (length2 $ velocity (tri state)))
modify $ modCameraState $ modCame... | 472 | drawSpace :: StateT SpaceState IO ()
drawSpace = do
state <- State.get
modify $ modCameraState $ modCamZoom $ (+ (camzoomdelta $ camstate state))
modify $ modCameraState $ modCamera $ setZoom $ clamp 30 250 $ (camzoom $ camstate state) + (400 * (length2 $ velocity (tri state)))
modify $ modCameraState $ modCame... | 472 | drawSpace = do
state <- State.get
modify $ modCameraState $ modCamZoom $ (+ (camzoomdelta $ camstate state))
modify $ modCameraState $ modCamera $ setZoom $ clamp 30 250 $ (camzoom $ camstate state) + (400 * (length2 $ velocity (tri state)))
modify $ modCameraState $ modCamera $ setCentre $ Entity.position (tri... | 435 | false | true | 1 | 15 | 84 | 203 | 96 | 107 | null | null |
spacekitteh/smcghc | compiler/nativeGen/SPARC/Ppr.hs | bsd-3-clause | pprInstr (FNEG size reg1 reg2)
= pprSizeRegReg (sLit "fneg") size reg1 reg2 | 83 | pprInstr (FNEG size reg1 reg2)
= pprSizeRegReg (sLit "fneg") size reg1 reg2 | 83 | pprInstr (FNEG size reg1 reg2)
= pprSizeRegReg (sLit "fneg") size reg1 reg2 | 83 | false | false | 0 | 7 | 19 | 34 | 16 | 18 | null | null |
nevrenato/Hets_Fork | OWL2/Keywords.hs | gpl-2.0 | predefDataProp :: [String]
predefDataProp = [topDataProp, bottomDataProp] | 73 | predefDataProp :: [String]
predefDataProp = [topDataProp, bottomDataProp] | 73 | predefDataProp = [topDataProp, bottomDataProp] | 46 | false | true | 0 | 5 | 6 | 20 | 12 | 8 | null | null |
oldmanmike/ghc | compiler/simplCore/SimplEnv.hs | bsd-3-clause | ------------------
substIdType :: SimplEnv -> Id -> Id
substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env, seCvSubst = cv_env }) id
| (isEmptyVarEnv tv_env && isEmptyVarEnv cv_env)
|| isEmptyVarSet (tyCoVarsOfType old_ty)
= id
| otherwise = Id.setIdType id (Type.substTy (TCvSubst in_scope tv_env ... | 546 | substIdType :: SimplEnv -> Id -> Id
substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env, seCvSubst = cv_env }) id
| (isEmptyVarEnv tv_env && isEmptyVarEnv cv_env)
|| isEmptyVarSet (tyCoVarsOfType old_ty)
= id
| otherwise = Id.setIdType id (Type.substTy (TCvSubst in_scope tv_env cv_env) old_ty)
... | 527 | substIdType (SimplEnv { seInScope = in_scope, seTvSubst = tv_env, seCvSubst = cv_env }) id
| (isEmptyVarEnv tv_env && isEmptyVarEnv cv_env)
|| isEmptyVarSet (tyCoVarsOfType old_ty)
= id
| otherwise = Id.setIdType id (Type.substTy (TCvSubst in_scope tv_env cv_env) old_ty)
-- The tyCoVarsOfType i... | 491 | true | true | 10 | 11 | 139 | 145 | 68 | 77 | null | null |
jean-edouard/xclibs | xchwebsocket/Network/WebSocket.hs | lgpl-2.1 | sendAll :: WebSocket -> B.ByteString -> IO ()
sendAll s buf =
send s buf >>= \sent ->
when (sent < B.length buf) $
sendAll s (B.drop sent buf) | 168 | sendAll :: WebSocket -> B.ByteString -> IO ()
sendAll s buf =
send s buf >>= \sent ->
when (sent < B.length buf) $
sendAll s (B.drop sent buf) | 168 | sendAll s buf =
send s buf >>= \sent ->
when (sent < B.length buf) $
sendAll s (B.drop sent buf) | 122 | false | true | 0 | 12 | 54 | 79 | 38 | 41 | null | null |
blender/Rome | tests/Tests.hs | mit | prop_filterRomeFileEntriesByPlatforms_filters :: [RomefileEntry] -> [RomefileEntry] -> Bool
prop_filterRomeFileEntriesByPlatforms_filters base filteringValues =
null $ (base `filterRomeFileEntriesByPlatforms` filteringValues) `intersect` filteringValues | 255 | prop_filterRomeFileEntriesByPlatforms_filters :: [RomefileEntry] -> [RomefileEntry] -> Bool
prop_filterRomeFileEntriesByPlatforms_filters base filteringValues =
null $ (base `filterRomeFileEntriesByPlatforms` filteringValues) `intersect` filteringValues | 255 | prop_filterRomeFileEntriesByPlatforms_filters base filteringValues =
null $ (base `filterRomeFileEntriesByPlatforms` filteringValues) `intersect` filteringValues | 163 | false | true | 0 | 8 | 19 | 49 | 28 | 21 | null | null |
cblp/discourse-to-gitter | src/Data/String/X.hs | gpl-3.0 | dropPrefix :: String -> String -> String
dropPrefix = drop . length | 67 | dropPrefix :: String -> String -> String
dropPrefix = drop . length | 67 | dropPrefix = drop . length | 26 | false | true | 1 | 8 | 11 | 31 | 13 | 18 | null | null |
spacekitteh/smcghc | compiler/codeGen/StgCmmHeap.hs | bsd-3-clause | genericGC :: Bool -> FCode a -> FCode a
genericGC checkYield code
= do updfr_sz <- getUpdFrameOff
lretry <- newLabelC
emitLabel lretry
call <- mkCall generic_gc (GC, GC) [] [] updfr_sz []
heapCheck False checkYield (call <*> mkBranch lretry) code | 276 | genericGC :: Bool -> FCode a -> FCode a
genericGC checkYield code
= do updfr_sz <- getUpdFrameOff
lretry <- newLabelC
emitLabel lretry
call <- mkCall generic_gc (GC, GC) [] [] updfr_sz []
heapCheck False checkYield (call <*> mkBranch lretry) code | 276 | genericGC checkYield code
= do updfr_sz <- getUpdFrameOff
lretry <- newLabelC
emitLabel lretry
call <- mkCall generic_gc (GC, GC) [] [] updfr_sz []
heapCheck False checkYield (call <*> mkBranch lretry) code | 236 | false | true | 0 | 10 | 69 | 104 | 48 | 56 | null | null |
acple/renzu | src/Renzu/Setter.hs | bsd-3-clause | over :: Setter s t a b -> (a -> b) -> s -> t
-- ((a -> b) -> (s -> t)) -> (a -> b) -> (s -> t)
over = id | 109 | over :: Setter s t a b -> (a -> b) -> s -> t
over = id | 54 | over = id | 9 | true | true | 0 | 8 | 38 | 40 | 21 | 19 | null | null |
aburnett88/HSat | tests-src/Test/Make/Instances/CNF/Internal.hs | mit | genCNFInit :: Int -> Gen CNFInit
genCNFInit i = do
varsAppearTwice <- arbitrary
(maxVar,sizes) <- if varsAppearTwice then
liftA2 (,) word1 listSizes else do
sizes <- listSizes
maxVar <- if null sizes then word1 else
... | 732 | genCNFInit :: Int -> Gen CNFInit
genCNFInit i = do
varsAppearTwice <- arbitrary
(maxVar,sizes) <- if varsAppearTwice then
liftA2 (,) word1 listSizes else do
sizes <- listSizes
maxVar <- if null sizes then word1 else
... | 732 | genCNFInit i = do
varsAppearTwice <- arbitrary
(maxVar,sizes) <- if varsAppearTwice then
liftA2 (,) word1 listSizes else do
sizes <- listSizes
maxVar <- if null sizes then word1 else
choose (maximum sizes, max... | 697 | false | true | 2 | 16 | 279 | 239 | 113 | 126 | null | null |
kadena-io/pact | src/Pact/Docgen.hs | bsd-3-clause | renderProperties :: Handle -> IO ()
renderProperties h = do
hPutStrLn h "# Property and Invariant Functions {#properties-and-invariants}"
hPutStrLn h ""
hPutStrLn h "These are functions available in properties and invariants -- not necessarily in executable Pact code. All of these functions are available in prope... | 3,669 | renderProperties :: Handle -> IO ()
renderProperties h = do
hPutStrLn h "# Property and Invariant Functions {#properties-and-invariants}"
hPutStrLn h ""
hPutStrLn h "These are functions available in properties and invariants -- not necessarily in executable Pact code. All of these functions are available in prope... | 3,669 | renderProperties h = do
hPutStrLn h "# Property and Invariant Functions {#properties-and-invariants}"
hPutStrLn h ""
hPutStrLn h "These are functions available in properties and invariants -- not necessarily in executable Pact code. All of these functions are available in properties, but only a subset are availab... | 3,633 | false | true | 21 | 32 | 1,143 | 956 | 455 | 501 | null | null |
kadena-io/pact | tests/GasModelSpec.hs | bsd-3-clause | genWithSeed :: Int -> Gen a -> Gen a
genWithSeed i (MkGen g) = MkGen (\_ n -> g (mkQCGen i) n) | 94 | genWithSeed :: Int -> Gen a -> Gen a
genWithSeed i (MkGen g) = MkGen (\_ n -> g (mkQCGen i) n) | 94 | genWithSeed i (MkGen g) = MkGen (\_ n -> g (mkQCGen i) n) | 57 | false | true | 0 | 10 | 21 | 60 | 29 | 31 | null | null |
lucas8/netlist-compiler | compil.hs | mit | readMemory _ r 8 d =
putStrLn $ "movq (%" ++ d ++ ",%"
++ r ++ ",1), %rdi" | 104 | readMemory _ r 8 d =
putStrLn $ "movq (%" ++ d ++ ",%"
++ r ++ ",1), %rdi" | 104 | readMemory _ r 8 d =
putStrLn $ "movq (%" ++ d ++ ",%"
++ r ++ ",1), %rdi" | 104 | false | false | 0 | 9 | 48 | 35 | 17 | 18 | null | null |
yoo-e/weixin-mp-sdk | WeiXin/PublicPlatform/Material.hs | mit | wxppBatchGetDurableToSrc' :: (WxppApiMonad env m)
=> (Int
-> m (WxppBatchGetDurableResult a)
) -- ^ 这个函数可以从前面的函数应用上部分参数后得到, Int 参数是 offset
-> SourceC m (WxppBatchGetDurableResult a)
wxppBatchGetDurableToS... | 725 | wxppBatchGetDurableToSrc' :: (WxppApiMonad env m)
=> (Int
-> m (WxppBatchGetDurableResult a)
) -- ^ 这个函数可以从前面的函数应用上部分参数后得到, Int 参数是 offset
-> SourceC m (WxppBatchGetDurableResult a)
wxppBatchGetDurableToS... | 725 | wxppBatchGetDurableToSrc' get_by_offset = go 0
where
go offset = do
result <- lift $ get_by_offset offset
let items = wxppBatchGetDurableResultItems result
if null items
then return ()
else do
yield result
... | 427 | false | true | 1 | 13 | 319 | 153 | 68 | 85 | null | null |
GaloisInc/ivory | ivory/src/Ivory/Language/Array.hs | bsd-3-clause | fromIx :: ANat n => Ix n -> IxRep
fromIx = wrapExpr . unwrapExpr | 64 | fromIx :: ANat n => Ix n -> IxRep
fromIx = wrapExpr . unwrapExpr | 64 | fromIx = wrapExpr . unwrapExpr | 30 | false | true | 1 | 8 | 13 | 37 | 15 | 22 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- | Assuming 32 bit user-ids
uidpoolUidMax :: Integer
uidpoolUidMax = 2 ^ 32 - 1 | 81 | uidpoolUidMax :: Integer
uidpoolUidMax = 2 ^ 32 - 1 | 51 | uidpoolUidMax = 2 ^ 32 - 1 | 26 | true | true | 2 | 6 | 15 | 28 | 12 | 16 | null | null |
melted/idris-lua | src/IRTS/CodegenLua.hs | isc | cgOp LWriteStr [_,s] = pfuncall "io.output(io.stdout):write" [s] | 64 | cgOp LWriteStr [_,s] = pfuncall "io.output(io.stdout):write" [s] | 64 | cgOp LWriteStr [_,s] = pfuncall "io.output(io.stdout):write" [s] | 64 | false | false | 0 | 6 | 6 | 27 | 13 | 14 | null | null |
spechub/Hets | FreeCAD/HetPrinter.hs | gpl-2.0 | printBO :: BaseObject -> Doc
printBO (Box h w l) = hcat [text "BBox", lparen, sepByCommas [pretty l, pretty w, pretty h], rparen] | 129 | printBO :: BaseObject -> Doc
printBO (Box h w l) = hcat [text "BBox", lparen, sepByCommas [pretty l, pretty w, pretty h], rparen] | 129 | printBO (Box h w l) = hcat [text "BBox", lparen, sepByCommas [pretty l, pretty w, pretty h], rparen] | 100 | false | true | 0 | 9 | 22 | 72 | 35 | 37 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/ChangeLogs/List.hs | mpl-2.0 | -- | Select only change logs whose object ID, user name, old or new values
-- match the search string.
cllSearchString :: Lens' ChangeLogsList (Maybe Text)
cllSearchString
= lens _cllSearchString
(\ s a -> s{_cllSearchString = a}) | 238 | cllSearchString :: Lens' ChangeLogsList (Maybe Text)
cllSearchString
= lens _cllSearchString
(\ s a -> s{_cllSearchString = a}) | 135 | cllSearchString
= lens _cllSearchString
(\ s a -> s{_cllSearchString = a}) | 82 | true | true | 2 | 9 | 44 | 56 | 26 | 30 | null | null |
BartAdv/Idris-dev | src/Idris/Output.hs | bsd-3-clause | iPrintFunTypes bnd n overloads = do ist <- getIState
let ppo = ppOptionIst ist
let infixes = idris_infixes ist
let output = vsep (map (uncurry (ppOverload ppo infixes)) overloads)
... | 474 | iPrintFunTypes bnd n overloads = do ist <- getIState
let ppo = ppOptionIst ist
let infixes = idris_infixes ist
let output = vsep (map (uncurry (ppOverload ppo infixes)) overloads)
... | 474 | iPrintFunTypes bnd n overloads = do ist <- getIState
let ppo = ppOptionIst ist
let infixes = idris_infixes ist
let output = vsep (map (uncurry (ppOverload ppo infixes)) overloads)
... | 474 | false | false | 3 | 16 | 216 | 140 | 59 | 81 | null | null |
DarkEld3r/hGitStats | gitWrappers/Revwalk.hs | bsd-3-clause | topologicalOids :: Repository -> IO [Oid]
topologicalOids repository = assert (repository /= nullPtr)
withHeadId repository (nextTopologicalOids repository) | 158 | topologicalOids :: Repository -> IO [Oid]
topologicalOids repository = assert (repository /= nullPtr)
withHeadId repository (nextTopologicalOids repository) | 158 | topologicalOids repository = assert (repository /= nullPtr)
withHeadId repository (nextTopologicalOids repository) | 116 | false | true | 0 | 7 | 18 | 48 | 23 | 25 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT39.hs | gpl-3.0 | [] `intersect` ys = [] | 22 | [] `intersect` ys = [] | 22 | [] `intersect` ys = [] | 22 | false | false | 0 | 6 | 4 | 18 | 9 | 9 | null | null |
bgamari/kd-tree | Test.hs | bsd-3-clause | axesV3 :: V3 String
axesV3 = V3 "x" "y" "z" | 43 | axesV3 :: V3 String
axesV3 = V3 "x" "y" "z" | 43 | axesV3 = V3 "x" "y" "z" | 23 | false | true | 0 | 5 | 9 | 21 | 10 | 11 | null | null |
h-core/haskell-random | cc_validation.hs | mit | --Sum digits, using toDigits' to split all digits into 1 character
sumDigits :: (Integral a) => [a] -> a
sumDigits x = sum (toDigits' x) | 136 | sumDigits :: (Integral a) => [a] -> a
sumDigits x = sum (toDigits' x) | 69 | sumDigits x = sum (toDigits' x) | 31 | true | true | 0 | 7 | 24 | 40 | 21 | 19 | null | null |
cartazio/arithmoi | Math/NumberTheory/Primes/Sieve/Eratosthenes.hs | mit | -- | List of primes in the form of a list of 'PrimeSieve's, more compact than
-- 'primes', thus it may be better to use @'psieveList' >>= 'primeList'@
-- than keeping the list of primes alive during the entire run.
psieveList :: [PrimeSieve]
psieveList = makeSieves plim sqlim 0 0 cache
where
plim = 4801 -... | 1,351 | psieveList :: [PrimeSieve]
psieveList = makeSieves plim sqlim 0 0 cache
where
plim = 4801 -- prime #647, 644 of them to use
sqlim = plim*plim
cache = runSTUArray $ do
sieve <- sieveTo (4801 :: Integer)
new <- unsafeNewArray_ (0,1287) :: ST s (STUArray s Int Word64)
let fill j i... | 1,132 | psieveList = makeSieves plim sqlim 0 0 cache
where
plim = 4801 -- prime #647, 644 of them to use
sqlim = plim*plim
cache = runSTUArray $ do
sieve <- sieveTo (4801 :: Integer)
new <- unsafeNewArray_ (0,1287) :: ST s (STUArray s Int Word64)
let fill j indx
| 1279 < ... | 1,105 | true | true | 0 | 28 | 542 | 379 | 189 | 190 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/HaskellSuite.hs | bsd-3-clause | hstoolVersion :: Verbosity -> FilePath -> IO (Maybe Version)
hstoolVersion = findProgramVersion "--hspkg-version" id | 116 | hstoolVersion :: Verbosity -> FilePath -> IO (Maybe Version)
hstoolVersion = findProgramVersion "--hspkg-version" id | 116 | hstoolVersion = findProgramVersion "--hspkg-version" id | 55 | false | true | 0 | 9 | 13 | 33 | 16 | 17 | null | null |
ShellShoccar-jpn/Open-usp-Tukubai | COMMANDS.HS/mdate.hs | mit | fDEP f1 sign f2 wds = BS.unwords [ g f1 sign f2 nw | nw <- zip [1..] wds ]
where d1 = BS.unpack $ wds !! (f1-1)
d2 = read $ BS.unpack $ wds !! (f2-1)
diff = if sign == '+' then d2 else d2*(-1)
ds = BS.unpack $ toDayStr $ dayAhead (Day... | 591 | fDEP f1 sign f2 wds = BS.unwords [ g f1 sign f2 nw | nw <- zip [1..] wds ]
where d1 = BS.unpack $ wds !! (f1-1)
d2 = read $ BS.unpack $ wds !! (f2-1)
diff = if sign == '+' then d2 else d2*(-1)
ds = BS.unpack $ toDayStr $ dayAhead (Day... | 591 | fDEP f1 sign f2 wds = BS.unwords [ g f1 sign f2 nw | nw <- zip [1..] wds ]
where d1 = BS.unpack $ wds !! (f1-1)
d2 = read $ BS.unpack $ wds !! (f2-1)
diff = if sign == '+' then d2 else d2*(-1)
ds = BS.unpack $ toDayStr $ dayAhead (Day... | 591 | false | false | 0 | 11 | 304 | 224 | 116 | 108 | null | null |
harendra-kumar/asyncly | benchmark/StreamDOps.hs | bsd-3-clause | filterScan n = composeN n $ S.scanl' (+) 0 . S.filter (<= maxBound) | 67 | filterScan n = composeN n $ S.scanl' (+) 0 . S.filter (<= maxBound) | 67 | filterScan n = composeN n $ S.scanl' (+) 0 . S.filter (<= maxBound) | 67 | false | false | 0 | 8 | 12 | 38 | 19 | 19 | null | null |
Helkafen/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | maybeParen :: Int -- Precedence of context
-> Int -- Precedence of top-level operator
-> LaTeX -> LaTeX -- Wrap in parens if (ctxt >= op)
maybeParen ctxt_prec op_prec p | ctxt_prec >= op_prec = parens p
| otherwise = p | 303 | maybeParen :: Int -- Precedence of context
-> Int -- Precedence of top-level operator
-> LaTeX -> LaTeX
maybeParen ctxt_prec op_prec p | ctxt_prec >= op_prec = parens p
| otherwise = p | 268 | maybeParen ctxt_prec op_prec p | ctxt_prec >= op_prec = parens p
| otherwise = p | 122 | true | true | 0 | 8 | 125 | 55 | 27 | 28 | null | null |
bgold-cosmos/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | slidebus :: Pattern Int -> Pattern Double -> ControlPattern
slidebus busid pat = (pF "slide" pat) # (pI "^slide" busid) | 119 | slidebus :: Pattern Int -> Pattern Double -> ControlPattern
slidebus busid pat = (pF "slide" pat) # (pI "^slide" busid) | 119 | slidebus busid pat = (pF "slide" pat) # (pI "^slide" busid) | 59 | false | true | 2 | 8 | 19 | 57 | 25 | 32 | null | null |
cirquit/Personal-Repository | Haskell/Gloss/mandelbrot/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/Paths_mandelbrot.hs | mit | sysconfdir = "/home/rewrite/Documents/Personal-Repository/Haskell/Gloss/mandelbrot/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/etc" | 136 | sysconfdir = "/home/rewrite/Documents/Personal-Repository/Haskell/Gloss/mandelbrot/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/etc" | 136 | sysconfdir = "/home/rewrite/Documents/Personal-Repository/Haskell/Gloss/mandelbrot/.stack-work/install/x86_64-linux/lts-3.14/7.10.2/etc" | 136 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
Zekka/whidgle | src/Whidgle/Dijkstra.hs | mit | unInfinite (Only a) = a | 23 | unInfinite (Only a) = a | 23 | unInfinite (Only a) = a | 23 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkForInLs = verify checkForInLs "for f in $(ls *.mp3); do mplayer \"$f\"; done" | 87 | prop_checkForInLs = verify checkForInLs "for f in $(ls *.mp3); do mplayer \"$f\"; done" | 87 | prop_checkForInLs = verify checkForInLs "for f in $(ls *.mp3); do mplayer \"$f\"; done" | 87 | false | false | 0 | 5 | 12 | 11 | 5 | 6 | null | null |
ltcmelo/psychec | formalism/muC.hs | bsd-3-clause | integer = Token.integer lexer | 29 | integer = Token.integer lexer | 29 | integer = Token.integer lexer | 29 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.