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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tolysz/prepare-ghcjs | spec-lts8/cabal/cabal-install/Distribution/Client/Install.hs | bsd-3-clause | updateSandboxTimestampsFile :: UseSandbox -> Maybe SandboxPackageInfo
-> Compiler -> Platform
-> InstallPlan
-> IO ()
updateSandboxTimestampsFile (UseSandbox sandboxDir)
(Just (SandboxPackageInfo _ _ _ allAddSourceDeps))
comp platform installPlan =
withUpdateTimestamps sandboxDir (compilerId comp) platform $ \_ -> do
let allInstalled = [ pkg | InstallPlan.Installed pkg _ _
<- InstallPlan.toList installPlan ]
allSrcPkgs = [ pkg | ReadyPackage (ConfiguredPackage pkg _ _ _) _
<- allInstalled ]
allPaths = [ pth | LocalUnpackedPackage pth
<- map packageSource allSrcPkgs]
allPathsCanonical <- mapM tryCanonicalizePath allPaths
return $! filter (`S.member` allAddSourceDeps) allPathsCanonical | 952 | updateSandboxTimestampsFile :: UseSandbox -> Maybe SandboxPackageInfo
-> Compiler -> Platform
-> InstallPlan
-> IO ()
updateSandboxTimestampsFile (UseSandbox sandboxDir)
(Just (SandboxPackageInfo _ _ _ allAddSourceDeps))
comp platform installPlan =
withUpdateTimestamps sandboxDir (compilerId comp) platform $ \_ -> do
let allInstalled = [ pkg | InstallPlan.Installed pkg _ _
<- InstallPlan.toList installPlan ]
allSrcPkgs = [ pkg | ReadyPackage (ConfiguredPackage pkg _ _ _) _
<- allInstalled ]
allPaths = [ pth | LocalUnpackedPackage pth
<- map packageSource allSrcPkgs]
allPathsCanonical <- mapM tryCanonicalizePath allPaths
return $! filter (`S.member` allAddSourceDeps) allPathsCanonical | 952 | updateSandboxTimestampsFile (UseSandbox sandboxDir)
(Just (SandboxPackageInfo _ _ _ allAddSourceDeps))
comp platform installPlan =
withUpdateTimestamps sandboxDir (compilerId comp) platform $ \_ -> do
let allInstalled = [ pkg | InstallPlan.Installed pkg _ _
<- InstallPlan.toList installPlan ]
allSrcPkgs = [ pkg | ReadyPackage (ConfiguredPackage pkg _ _ _) _
<- allInstalled ]
allPaths = [ pth | LocalUnpackedPackage pth
<- map packageSource allSrcPkgs]
allPathsCanonical <- mapM tryCanonicalizePath allPaths
return $! filter (`S.member` allAddSourceDeps) allPathsCanonical | 750 | false | true | 0 | 17 | 347 | 219 | 108 | 111 | null | null |
Fermat/Gottlob | Language/Syntax.hs | bsd-3-clause | naiveSub p (Name x) (Applica p1 p2) =
let a1 = naiveSub p (Name x) p1
a2 = naiveSub p (Name x) p2 in
Applica a1 a2 | 125 | naiveSub p (Name x) (Applica p1 p2) =
let a1 = naiveSub p (Name x) p1
a2 = naiveSub p (Name x) p2 in
Applica a1 a2 | 125 | naiveSub p (Name x) (Applica p1 p2) =
let a1 = naiveSub p (Name x) p1
a2 = naiveSub p (Name x) p2 in
Applica a1 a2 | 125 | false | false | 0 | 11 | 37 | 74 | 35 | 39 | null | null |
wowofbob/scratch | app/SO/so44514645.hs | gpl-3.0 | main :: IO ()
main = print (decode (exampleJson) :: Maybe VM) | 61 | main :: IO ()
main = print (decode (exampleJson) :: Maybe VM) | 61 | main = print (decode (exampleJson) :: Maybe VM) | 47 | false | true | 0 | 8 | 11 | 40 | 18 | 22 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Readers/HTML.hs | gpl-2.0 | isSpecial '\8220' = True | 24 | isSpecial '\8220' = True | 24 | isSpecial '\8220' = True | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
badp/ganeti | src/Ganeti/HTools/Backend/Text.hs | gpl-2.0 | loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode
, dt, tags ] = loadInst ktn [ name, mem, dsk, vcpus, status,
auto_bal, pnode, snode, dt, tags,
"1" ] | 268 | loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode
, dt, tags ] = loadInst ktn [ name, mem, dsk, vcpus, status,
auto_bal, pnode, snode, dt, tags,
"1" ] | 268 | loadInst ktn [ name, mem, dsk, vcpus, status, auto_bal, pnode, snode
, dt, tags ] = loadInst ktn [ name, mem, dsk, vcpus, status,
auto_bal, pnode, snode, dt, tags,
"1" ] | 268 | false | false | 0 | 6 | 129 | 79 | 49 | 30 | null | null |
karshan/syz | Data/Generics/Zipper.hs | bsd-3-clause | -- | Apply a generic transformation to the hole.
trans :: GenericT -> Zipper a -> Zipper a
trans f (Zipper hole ctxt) = Zipper (f hole) ctxt | 141 | trans :: GenericT -> Zipper a -> Zipper a
trans f (Zipper hole ctxt) = Zipper (f hole) ctxt | 92 | trans f (Zipper hole ctxt) = Zipper (f hole) ctxt | 50 | true | true | 0 | 10 | 28 | 55 | 25 | 30 | null | null |
brendanhay/gogol | gogol-games-management/gen/Network/Google/Resource/GamesManagement/Events/Reset.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
erUploadProtocol :: Lens' EventsReset (Maybe Text)
erUploadProtocol
= lens _erUploadProtocol
(\ s a -> s{_erUploadProtocol = a}) | 198 | erUploadProtocol :: Lens' EventsReset (Maybe Text)
erUploadProtocol
= lens _erUploadProtocol
(\ s a -> s{_erUploadProtocol = a}) | 136 | erUploadProtocol
= lens _erUploadProtocol
(\ s a -> s{_erUploadProtocol = a}) | 85 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
krakrjak/ImplicitCAD | Graphics/Implicit/ExtOpenScad/Parser/Lexer.hs | agpl-3.0 | matchAND :: GenParser Char st String
matchAND = P.reservedOp lexer "&&" >> return "&&" | 86 | matchAND :: GenParser Char st String
matchAND = P.reservedOp lexer "&&" >> return "&&" | 86 | matchAND = P.reservedOp lexer "&&" >> return "&&" | 49 | false | true | 0 | 7 | 13 | 32 | 15 | 17 | null | null |
Gabriel439/suns-search | src/AMQP/Proxy.hs | gpl-3.0 | validMessage :: A.Message -> MaybeT IO ((RoutingKey, CorrelationID), Request)
validMessage message = MaybeT $ do
let correlationID = A.msgCorrelationID message
e = (,)
<$> (note "Message missing \"replyTo\" field" $ A.msgReplyTo message)
<*> (note "Message parse failed" $ decode' $ A.msgBody $ message)
case e of
Left str -> do
warn str
return Nothing
Right (replyTo, req) -> return $ Just ((replyTo, correlationID), req) | 508 | validMessage :: A.Message -> MaybeT IO ((RoutingKey, CorrelationID), Request)
validMessage message = MaybeT $ do
let correlationID = A.msgCorrelationID message
e = (,)
<$> (note "Message missing \"replyTo\" field" $ A.msgReplyTo message)
<*> (note "Message parse failed" $ decode' $ A.msgBody $ message)
case e of
Left str -> do
warn str
return Nothing
Right (replyTo, req) -> return $ Just ((replyTo, correlationID), req) | 508 | validMessage message = MaybeT $ do
let correlationID = A.msgCorrelationID message
e = (,)
<$> (note "Message missing \"replyTo\" field" $ A.msgReplyTo message)
<*> (note "Message parse failed" $ decode' $ A.msgBody $ message)
case e of
Left str -> do
warn str
return Nothing
Right (replyTo, req) -> return $ Just ((replyTo, correlationID), req) | 430 | false | true | 2 | 16 | 149 | 174 | 85 | 89 | null | null |
sdiehl/ghc | compiler/nativeGen/SPARC/CodeGen.hs | bsd-3-clause | stmtToInstrs :: CmmNode e x -> NatM InstrBlock
stmtToInstrs stmt = do
dflags <- getDynFlags
case stmt of
CmmComment s -> return (unitOL (COMMENT s))
CmmTick {} -> return nilOL
CmmUnwind {} -> return nilOL
CmmAssign reg src
| isFloatType ty -> assignReg_FltCode format reg src
| isWord64 ty -> assignReg_I64Code reg src
| otherwise -> assignReg_IntCode format reg src
where ty = cmmRegType dflags reg
format = cmmTypeFormat ty
CmmStore addr src
| isFloatType ty -> assignMem_FltCode format addr src
| isWord64 ty -> assignMem_I64Code addr src
| otherwise -> assignMem_IntCode format addr src
where ty = cmmExprType dflags src
format = cmmTypeFormat ty
CmmUnsafeForeignCall target result_regs args
-> genCCall target result_regs args
CmmBranch id -> genBranch id
CmmCondBranch arg true false _ -> do
b1 <- genCondJump true arg
b2 <- genBranch false
return (b1 `appOL` b2)
CmmSwitch arg ids -> do dflags <- getDynFlags
genSwitch dflags arg ids
CmmCall { cml_target = arg } -> genJump arg
_
-> panic "stmtToInstrs: statement should have been cps'd away"
{-
Now, given a tree (the argument to a CmmLoad) that references memory,
produce a suitable addressing mode.
A Rule of the Game (tm) for Amodes: use of the addr bit must
immediately follow use of the code part, since the code part puts
values in registers which the addr then refers to. So you can't put
anything in between, lest it overwrite some of those registers. If
you need to do some other computation between the code part and use of
the addr bit, first store the effective address from the amode in a
temporary, then do the other computation, and then use the temporary:
code
LEA amode, tmp
... other computation ...
... (tmp) ...
-}
-- | Convert a BlockId to some CmmStatic data | 2,015 | stmtToInstrs :: CmmNode e x -> NatM InstrBlock
stmtToInstrs stmt = do
dflags <- getDynFlags
case stmt of
CmmComment s -> return (unitOL (COMMENT s))
CmmTick {} -> return nilOL
CmmUnwind {} -> return nilOL
CmmAssign reg src
| isFloatType ty -> assignReg_FltCode format reg src
| isWord64 ty -> assignReg_I64Code reg src
| otherwise -> assignReg_IntCode format reg src
where ty = cmmRegType dflags reg
format = cmmTypeFormat ty
CmmStore addr src
| isFloatType ty -> assignMem_FltCode format addr src
| isWord64 ty -> assignMem_I64Code addr src
| otherwise -> assignMem_IntCode format addr src
where ty = cmmExprType dflags src
format = cmmTypeFormat ty
CmmUnsafeForeignCall target result_regs args
-> genCCall target result_regs args
CmmBranch id -> genBranch id
CmmCondBranch arg true false _ -> do
b1 <- genCondJump true arg
b2 <- genBranch false
return (b1 `appOL` b2)
CmmSwitch arg ids -> do dflags <- getDynFlags
genSwitch dflags arg ids
CmmCall { cml_target = arg } -> genJump arg
_
-> panic "stmtToInstrs: statement should have been cps'd away"
{-
Now, given a tree (the argument to a CmmLoad) that references memory,
produce a suitable addressing mode.
A Rule of the Game (tm) for Amodes: use of the addr bit must
immediately follow use of the code part, since the code part puts
values in registers which the addr then refers to. So you can't put
anything in between, lest it overwrite some of those registers. If
you need to do some other computation between the code part and use of
the addr bit, first store the effective address from the amode in a
temporary, then do the other computation, and then use the temporary:
code
LEA amode, tmp
... other computation ...
... (tmp) ...
-}
-- | Convert a BlockId to some CmmStatic data | 2,015 | stmtToInstrs stmt = do
dflags <- getDynFlags
case stmt of
CmmComment s -> return (unitOL (COMMENT s))
CmmTick {} -> return nilOL
CmmUnwind {} -> return nilOL
CmmAssign reg src
| isFloatType ty -> assignReg_FltCode format reg src
| isWord64 ty -> assignReg_I64Code reg src
| otherwise -> assignReg_IntCode format reg src
where ty = cmmRegType dflags reg
format = cmmTypeFormat ty
CmmStore addr src
| isFloatType ty -> assignMem_FltCode format addr src
| isWord64 ty -> assignMem_I64Code addr src
| otherwise -> assignMem_IntCode format addr src
where ty = cmmExprType dflags src
format = cmmTypeFormat ty
CmmUnsafeForeignCall target result_regs args
-> genCCall target result_regs args
CmmBranch id -> genBranch id
CmmCondBranch arg true false _ -> do
b1 <- genCondJump true arg
b2 <- genBranch false
return (b1 `appOL` b2)
CmmSwitch arg ids -> do dflags <- getDynFlags
genSwitch dflags arg ids
CmmCall { cml_target = arg } -> genJump arg
_
-> panic "stmtToInstrs: statement should have been cps'd away"
{-
Now, given a tree (the argument to a CmmLoad) that references memory,
produce a suitable addressing mode.
A Rule of the Game (tm) for Amodes: use of the addr bit must
immediately follow use of the code part, since the code part puts
values in registers which the addr then refers to. So you can't put
anything in between, lest it overwrite some of those registers. If
you need to do some other computation between the code part and use of
the addr bit, first store the effective address from the amode in a
temporary, then do the other computation, and then use the temporary:
code
LEA amode, tmp
... other computation ...
... (tmp) ...
-}
-- | Convert a BlockId to some CmmStatic data | 1,968 | false | true | 0 | 14 | 573 | 391 | 176 | 215 | null | null |
stefan-hoeck/labeled-graph | test/GraphQC.hs | bsd-3-clause | smallEdge ∷ Gen Edge
smallEdge = fmap getSmallEdge arbitrary | 60 | smallEdge ∷ Gen Edge
smallEdge = fmap getSmallEdge arbitrary | 60 | smallEdge = fmap getSmallEdge arbitrary | 39 | false | true | 0 | 6 | 8 | 25 | 10 | 15 | null | null |
nushio3/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkTcRepReflCo = mkRepReflCo | 36 | mkTcRepReflCo = mkRepReflCo | 36 | mkTcRepReflCo = mkRepReflCo | 36 | false | false | 0 | 4 | 11 | 6 | 3 | 3 | null | null |
osa1/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | -- | Get the highest FC in a term, if one exists
highestFC :: PTerm -> Maybe FC
highestFC (PQuote _) = Nothing | 110 | highestFC :: PTerm -> Maybe FC
highestFC (PQuote _) = Nothing | 61 | highestFC (PQuote _) = Nothing | 30 | true | true | 0 | 6 | 22 | 32 | 15 | 17 | null | null |
ryantrinkle/reflex-dom | reflex-dom-core/src/Reflex/Dom/Widget/Input.hs | bsd-3-clause | textArea :: (DomBuilder t m, PostBuild t m, DomBuilderSpace m ~ GhcjsDomSpace) => TextAreaConfig t -> m (TextArea t)
textArea (TextAreaConfig initial eSet attrs) = do
modifyAttrs <- dynamicAttributesToModifyAttributes attrs
i <- textAreaElement $ def
& textAreaElementConfig_initialValue .~ initial
& textAreaElementConfig_setValue .~ eSet
& textAreaElementConfig_elementConfig . elementConfig_modifyAttributes .~ fmap mapKeysToAttributeName modifyAttrs
return $ TextArea
{ _textArea_value = _textAreaElement_value i
, _textArea_input = _textAreaElement_input i
, _textArea_keypress = domEvent Keypress i
, _textArea_hasFocus = _textAreaElement_hasFocus i
, _textArea_element = _textAreaElement_raw i
}
| 746 | textArea :: (DomBuilder t m, PostBuild t m, DomBuilderSpace m ~ GhcjsDomSpace) => TextAreaConfig t -> m (TextArea t)
textArea (TextAreaConfig initial eSet attrs) = do
modifyAttrs <- dynamicAttributesToModifyAttributes attrs
i <- textAreaElement $ def
& textAreaElementConfig_initialValue .~ initial
& textAreaElementConfig_setValue .~ eSet
& textAreaElementConfig_elementConfig . elementConfig_modifyAttributes .~ fmap mapKeysToAttributeName modifyAttrs
return $ TextArea
{ _textArea_value = _textAreaElement_value i
, _textArea_input = _textAreaElement_input i
, _textArea_keypress = domEvent Keypress i
, _textArea_hasFocus = _textAreaElement_hasFocus i
, _textArea_element = _textAreaElement_raw i
}
| 746 | textArea (TextAreaConfig initial eSet attrs) = do
modifyAttrs <- dynamicAttributesToModifyAttributes attrs
i <- textAreaElement $ def
& textAreaElementConfig_initialValue .~ initial
& textAreaElementConfig_setValue .~ eSet
& textAreaElementConfig_elementConfig . elementConfig_modifyAttributes .~ fmap mapKeysToAttributeName modifyAttrs
return $ TextArea
{ _textArea_value = _textAreaElement_value i
, _textArea_input = _textAreaElement_input i
, _textArea_keypress = domEvent Keypress i
, _textArea_hasFocus = _textAreaElement_hasFocus i
, _textArea_element = _textAreaElement_raw i
}
| 629 | false | true | 0 | 15 | 124 | 184 | 90 | 94 | null | null |
brendanhay/gogol | gogol-shopping-content/gen/Network/Google/Resource/Content/Products/Get.hs | mpl-2.0 | -- | The REST ID of the product.
pggProductId :: Lens' ProductsGet Text
pggProductId
= lens _pggProductId (\ s a -> s{_pggProductId = a}) | 139 | pggProductId :: Lens' ProductsGet Text
pggProductId
= lens _pggProductId (\ s a -> s{_pggProductId = a}) | 106 | pggProductId
= lens _pggProductId (\ s a -> s{_pggProductId = a}) | 67 | true | true | 1 | 9 | 25 | 46 | 22 | 24 | null | null |
harendra-kumar/stack | src/Stack/New.hs | bsd-3-clause | -- | Run any initialization functions, such as Git.
runTemplateInits
:: (MonadIO m, MonadReader r m, HasConfig r, MonadLogger m, MonadCatch m)
=> Path Abs Dir -> m ()
runTemplateInits dir = do
menv <- getMinimalEnvOverride
config <- asks getConfig
case configScmInit config of
Nothing -> return ()
Just Git ->
catch (callProcess $ Cmd (Just dir) "git" menv ["init"])
(\(_ :: ProcessExitedUnsuccessfully) ->
$logInfo "git init failed to run, ignoring ...")
--------------------------------------------------------------------------------
-- Getting templates list | 654 | runTemplateInits
:: (MonadIO m, MonadReader r m, HasConfig r, MonadLogger m, MonadCatch m)
=> Path Abs Dir -> m ()
runTemplateInits dir = do
menv <- getMinimalEnvOverride
config <- asks getConfig
case configScmInit config of
Nothing -> return ()
Just Git ->
catch (callProcess $ Cmd (Just dir) "git" menv ["init"])
(\(_ :: ProcessExitedUnsuccessfully) ->
$logInfo "git init failed to run, ignoring ...")
--------------------------------------------------------------------------------
-- Getting templates list | 602 | runTemplateInits dir = do
menv <- getMinimalEnvOverride
config <- asks getConfig
case configScmInit config of
Nothing -> return ()
Just Git ->
catch (callProcess $ Cmd (Just dir) "git" menv ["init"])
(\(_ :: ProcessExitedUnsuccessfully) ->
$logInfo "git init failed to run, ignoring ...")
--------------------------------------------------------------------------------
-- Getting templates list | 479 | true | true | 0 | 15 | 168 | 162 | 79 | 83 | null | null |
KHs000/haskellToys | src/modules/RBT.hs | mit | delL :: (Ord a) => a -> Tree a -> Tree a
delL x t@(T B t1 y t2) = balL $ T B (del x t1) y t2 | 92 | delL :: (Ord a) => a -> Tree a -> Tree a
delL x t@(T B t1 y t2) = balL $ T B (del x t1) y t2 | 92 | delL x t@(T B t1 y t2) = balL $ T B (del x t1) y t2 | 51 | false | true | 0 | 8 | 28 | 75 | 37 | 38 | null | null |
boj/garbage | src/NaiveGame3.hs | bsd-3-clause | -- As in the original benchmark:
distCap :: Float
distCap = fromIntegral numChunks | 94 | distCap :: Float
distCap = fromIntegral numChunks | 49 | distCap = fromIntegral numChunks | 32 | true | true | 0 | 6 | 24 | 21 | 9 | 12 | null | null |
geocurnoff/nikki | src/Physics/Chipmunk/Types.hs | lgpl-3.0 | vectorY :: Vector -> CpFloat
vectorY (Vector x y) = y | 53 | vectorY :: Vector -> CpFloat
vectorY (Vector x y) = y | 53 | vectorY (Vector x y) = y | 24 | false | true | 0 | 9 | 10 | 32 | 14 | 18 | null | null |
brownplt/strobe-old | src/BrownPLT/TypedJS/PrettyPrint.hs | bsd-2-clause | lvalue :: LValue a -> Doc
lvalue (LVar _ x) = text x | 52 | lvalue :: LValue a -> Doc
lvalue (LVar _ x) = text x | 52 | lvalue (LVar _ x) = text x | 26 | false | true | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
wizzup/advent_of_code | 2018/04/haskell/day_04.hs | mit | logMap _ = undefined | 20 | logMap _ = undefined | 20 | logMap _ = undefined | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
jbracker/supermonad-plugin | examples/monad/hmtc/supermonad/TypeChecker.hs | bsd-3-clause | sourcesp _ _ = False | 35 | sourcesp _ _ = False | 35 | sourcesp _ _ = False | 35 | false | false | 0 | 5 | 19 | 11 | 5 | 6 | null | null |
acowley/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | --------------------------------
rnHsBndrSig :: HsDocContext
-> HsWithBndrs RdrName (LHsType RdrName)
-> (HsWithBndrs Name (LHsType Name) -> RnM (a, FreeVars))
-> RnM (a, FreeVars)
rnHsBndrSig doc (HsWB { hswb_cts = ty@(L loc _) }) thing_inside
= do { sig_ok <- xoptM Opt_ScopedTypeVariables
; unless sig_ok (badSigErr True doc ty)
; rdr_env <- getLocalRdrEnv
; let (kv_bndrs, tv_bndrs) = filterInScope rdr_env $
extractHsTyRdrTyVars ty
; kv_names <- newLocalBndrsRn (map (L loc) kv_bndrs)
; tv_names <- newLocalBndrsRn (map (L loc) tv_bndrs)
; bindLocalNamesFV kv_names $
bindLocalNamesFV tv_names $
do { (ty', fvs1, wcs) <- rnLHsTypeWithWildCards doc ty
; (res, fvs2) <- thing_inside (HsWB { hswb_cts = ty'
, hswb_kvs = kv_names
, hswb_tvs = tv_names
, hswb_wcs = wcs })
; return (res, fvs1 `plusFV` fvs2) } } | 1,083 | rnHsBndrSig :: HsDocContext
-> HsWithBndrs RdrName (LHsType RdrName)
-> (HsWithBndrs Name (LHsType Name) -> RnM (a, FreeVars))
-> RnM (a, FreeVars)
rnHsBndrSig doc (HsWB { hswb_cts = ty@(L loc _) }) thing_inside
= do { sig_ok <- xoptM Opt_ScopedTypeVariables
; unless sig_ok (badSigErr True doc ty)
; rdr_env <- getLocalRdrEnv
; let (kv_bndrs, tv_bndrs) = filterInScope rdr_env $
extractHsTyRdrTyVars ty
; kv_names <- newLocalBndrsRn (map (L loc) kv_bndrs)
; tv_names <- newLocalBndrsRn (map (L loc) tv_bndrs)
; bindLocalNamesFV kv_names $
bindLocalNamesFV tv_names $
do { (ty', fvs1, wcs) <- rnLHsTypeWithWildCards doc ty
; (res, fvs2) <- thing_inside (HsWB { hswb_cts = ty'
, hswb_kvs = kv_names
, hswb_tvs = tv_names
, hswb_wcs = wcs })
; return (res, fvs1 `plusFV` fvs2) } } | 1,050 | rnHsBndrSig doc (HsWB { hswb_cts = ty@(L loc _) }) thing_inside
= do { sig_ok <- xoptM Opt_ScopedTypeVariables
; unless sig_ok (badSigErr True doc ty)
; rdr_env <- getLocalRdrEnv
; let (kv_bndrs, tv_bndrs) = filterInScope rdr_env $
extractHsTyRdrTyVars ty
; kv_names <- newLocalBndrsRn (map (L loc) kv_bndrs)
; tv_names <- newLocalBndrsRn (map (L loc) tv_bndrs)
; bindLocalNamesFV kv_names $
bindLocalNamesFV tv_names $
do { (ty', fvs1, wcs) <- rnLHsTypeWithWildCards doc ty
; (res, fvs2) <- thing_inside (HsWB { hswb_cts = ty'
, hswb_kvs = kv_names
, hswb_tvs = tv_names
, hswb_wcs = wcs })
; return (res, fvs1 `plusFV` fvs2) } } | 866 | true | true | 4 | 15 | 395 | 333 | 170 | 163 | null | null |
Dronte/Operads | examples/FlexLieadmissible2b.hs | bsd-3-clause | adn3 = stepOperadicBuchbergerCompletely ad1 adn2 | 48 | adn3 = stepOperadicBuchbergerCompletely ad1 adn2 | 48 | adn3 = stepOperadicBuchbergerCompletely ad1 adn2 | 48 | false | false | 1 | 5 | 4 | 14 | 5 | 9 | null | null |
rbtying/parsel | src/Generators.hs | apache-2.0 | genRawType (FuncType argts rt) = "std::function<" ++ r ++ "(" ++ args ++ ")>"
where r = genRawType rt
args = intercalate "," $ map genType argts | 162 | genRawType (FuncType argts rt) = "std::function<" ++ r ++ "(" ++ args ++ ")>"
where r = genRawType rt
args = intercalate "," $ map genType argts | 162 | genRawType (FuncType argts rt) = "std::function<" ++ r ++ "(" ++ args ++ ")>"
where r = genRawType rt
args = intercalate "," $ map genType argts | 162 | false | false | 1 | 8 | 44 | 61 | 29 | 32 | null | null |
rfranek/duckling | Duckling/Time/RO/Rules.hs | bsd-3-clause | ruleNameddayDayofmonthNumeral :: Rule
ruleNameddayDayofmonthNumeral = Rule
{ name = "<named-day> <day-of-month> (number)"
, pattern =
[ Predicate isADayOfWeek
, Predicate isDOMInteger
]
, prod = \tokens -> case tokens of
(Token Time td:token:_) -> Token Time <$> intersectDOM td token
_ -> Nothing
} | 331 | ruleNameddayDayofmonthNumeral :: Rule
ruleNameddayDayofmonthNumeral = Rule
{ name = "<named-day> <day-of-month> (number)"
, pattern =
[ Predicate isADayOfWeek
, Predicate isDOMInteger
]
, prod = \tokens -> case tokens of
(Token Time td:token:_) -> Token Time <$> intersectDOM td token
_ -> Nothing
} | 331 | ruleNameddayDayofmonthNumeral = Rule
{ name = "<named-day> <day-of-month> (number)"
, pattern =
[ Predicate isADayOfWeek
, Predicate isDOMInteger
]
, prod = \tokens -> case tokens of
(Token Time td:token:_) -> Token Time <$> intersectDOM td token
_ -> Nothing
} | 293 | false | true | 0 | 14 | 75 | 96 | 50 | 46 | null | null |
kawu/sgd | src/Numeric/SGD/AdaDelta.hs | bsd-2-clause | scale :: ParamSet p => Double -> p -> p
scale x = pmap (*x) | 59 | scale :: ParamSet p => Double -> p -> p
scale x = pmap (*x) | 59 | scale x = pmap (*x) | 19 | false | true | 0 | 7 | 14 | 36 | 18 | 18 | null | null |
JakDar/lab6-project | src/Ex3.hs | bsd-3-clause | -- | 'safeTail' for 'Either'
eSafeTail :: [a] -> Either String [a]
eSafeTail [] = Left "Empty list!" | 104 | eSafeTail :: [a] -> Either String [a]
eSafeTail [] = Left "Empty list!" | 75 | eSafeTail [] = Left "Empty list!" | 37 | true | true | 0 | 7 | 21 | 35 | 18 | 17 | null | null |
nomeata/ghc | compiler/utils/Encoding.hs | bsd-3-clause | utf8DecodeString (Ptr a#) (I# len#)
= unpack a#
where
!end# = addr2Int# (a# `plusAddr#` len#)
unpack p#
| addr2Int# p# >=# end# = return []
| otherwise =
case utf8DecodeChar# p# of
(# c#, q# #) -> do
chs <- unpack q#
return (C# c# : chs) | 318 | utf8DecodeString (Ptr a#) (I# len#)
= unpack a#
where
!end# = addr2Int# (a# `plusAddr#` len#)
unpack p#
| addr2Int# p# >=# end# = return []
| otherwise =
case utf8DecodeChar# p# of
(# c#, q# #) -> do
chs <- unpack q#
return (C# c# : chs) | 318 | utf8DecodeString (Ptr a#) (I# len#)
= unpack a#
where
!end# = addr2Int# (a# `plusAddr#` len#)
unpack p#
| addr2Int# p# >=# end# = return []
| otherwise =
case utf8DecodeChar# p# of
(# c#, q# #) -> do
chs <- unpack q#
return (C# c# : chs) | 318 | false | false | 2 | 14 | 127 | 133 | 59 | 74 | null | null |
sgillespie/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprPECategory NoDataKindsTC = text "Type constructor" | 54 | pprPECategory NoDataKindsTC = text "Type constructor" | 54 | pprPECategory NoDataKindsTC = text "Type constructor" | 54 | false | false | 0 | 5 | 6 | 13 | 5 | 8 | null | null |
sbergot/ArgParser | tests/System/Console/ArgParser/QuickParamsTest.hs | bsd-3-clause | test_reqFlagArgsFailure :: H.Assertion
test_reqFlagArgsFailure = behavior intReqFlagArgsParser
[ (willFail, ["--test", "foo"])
, (willFail, [])
, (willSucceed 0, ["--test"])
] | 188 | test_reqFlagArgsFailure :: H.Assertion
test_reqFlagArgsFailure = behavior intReqFlagArgsParser
[ (willFail, ["--test", "foo"])
, (willFail, [])
, (willSucceed 0, ["--test"])
] | 187 | test_reqFlagArgsFailure = behavior intReqFlagArgsParser
[ (willFail, ["--test", "foo"])
, (willFail, [])
, (willSucceed 0, ["--test"])
] | 148 | false | true | 0 | 7 | 31 | 60 | 35 | 25 | null | null |
thalerjonathan/phd | coding/libraries/chimera/examples/ABS/SocialForce/Run.hs | gpl-3.0 | winSize :: (Int, Int)
winSize = (1000, 600) | 43 | winSize :: (Int, Int)
winSize = (1000, 600) | 43 | winSize = (1000, 600) | 21 | false | true | 0 | 5 | 7 | 23 | 14 | 9 | null | null |
brendanhay/gogol | gogol-adexchangebuyer2/gen/Network/Google/Resource/AdExchangeBuyer2/Accounts/Clients/Users/Update.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
acuuUploadProtocol :: Lens' AccountsClientsUsersUpdate (Maybe Text)
acuuUploadProtocol
= lens _acuuUploadProtocol
(\ s a -> s{_acuuUploadProtocol = a}) | 221 | acuuUploadProtocol :: Lens' AccountsClientsUsersUpdate (Maybe Text)
acuuUploadProtocol
= lens _acuuUploadProtocol
(\ s a -> s{_acuuUploadProtocol = a}) | 159 | acuuUploadProtocol
= lens _acuuUploadProtocol
(\ s a -> s{_acuuUploadProtocol = a}) | 91 | true | true | 1 | 9 | 33 | 52 | 25 | 27 | null | null |
siddhanathan/ghc | compiler/coreSyn/CoreUnfold.hs | bsd-3-clause | computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt
-> Int
computeDiscount dflags arg_discounts res_discount arg_infos cont_info
-- We multiple the raw discounts (args_discount and result_discount)
-- ty opt_UnfoldingKeenessFactor because the former have to do with
-- *size* whereas the discounts imply that there's some extra
-- *efficiency* to be gained (e.g. beta reductions, case reductions)
-- by inlining.
= 10 -- Discount of 10 because the result replaces the call
-- so we count 10 for the function itself
+ 10 * length actual_arg_discounts
-- Discount of 10 for each arg supplied,
-- because the result replaces the call
+ round (ufKeenessFactor dflags *
fromIntegral (total_arg_discount + res_discount'))
where
actual_arg_discounts = zipWith mk_arg_discount arg_discounts arg_infos
total_arg_discount = sum actual_arg_discounts
mk_arg_discount _ TrivArg = 0
mk_arg_discount _ NonTrivArg = 10
mk_arg_discount discount ValueArg = discount
res_discount'
| LT <- arg_discounts `compareLength` arg_infos
= res_discount -- Over-saturated
| otherwise
= case cont_info of
BoringCtxt -> 0
CaseCtxt -> res_discount -- Presumably a constructor
ValAppCtxt -> res_discount -- Presumably a function
_ -> 40 `min` res_discount
-- ToDo: this 40 `min` res_discount doesn't seem right
-- for DiscArgCtxt it shouldn't matter because the function will
-- get the arg discount for any non-triv arg
-- for RuleArgCtxt we do want to be keener to inline; but not only
-- constructor results
-- for RhsCtxt I suppose that exposing a data con is good in general
-- And 40 seems very arbitrary
--
-- res_discount can be very large when a function returns
-- constructors; but we only want to invoke that large discount
-- when there's a case continuation.
-- Otherwise we, rather arbitrarily, threshold it. Yuk.
-- But we want to aovid inlining large functions that return
-- constructors into contexts that are simply "interesting" | 2,502 | computeDiscount :: DynFlags -> [Int] -> Int -> [ArgSummary] -> CallCtxt
-> Int
computeDiscount dflags arg_discounts res_discount arg_infos cont_info
-- We multiple the raw discounts (args_discount and result_discount)
-- ty opt_UnfoldingKeenessFactor because the former have to do with
-- *size* whereas the discounts imply that there's some extra
-- *efficiency* to be gained (e.g. beta reductions, case reductions)
-- by inlining.
= 10 -- Discount of 10 because the result replaces the call
-- so we count 10 for the function itself
+ 10 * length actual_arg_discounts
-- Discount of 10 for each arg supplied,
-- because the result replaces the call
+ round (ufKeenessFactor dflags *
fromIntegral (total_arg_discount + res_discount'))
where
actual_arg_discounts = zipWith mk_arg_discount arg_discounts arg_infos
total_arg_discount = sum actual_arg_discounts
mk_arg_discount _ TrivArg = 0
mk_arg_discount _ NonTrivArg = 10
mk_arg_discount discount ValueArg = discount
res_discount'
| LT <- arg_discounts `compareLength` arg_infos
= res_discount -- Over-saturated
| otherwise
= case cont_info of
BoringCtxt -> 0
CaseCtxt -> res_discount -- Presumably a constructor
ValAppCtxt -> res_discount -- Presumably a function
_ -> 40 `min` res_discount
-- ToDo: this 40 `min` res_discount doesn't seem right
-- for DiscArgCtxt it shouldn't matter because the function will
-- get the arg discount for any non-triv arg
-- for RuleArgCtxt we do want to be keener to inline; but not only
-- constructor results
-- for RhsCtxt I suppose that exposing a data con is good in general
-- And 40 seems very arbitrary
--
-- res_discount can be very large when a function returns
-- constructors; but we only want to invoke that large discount
-- when there's a case continuation.
-- Otherwise we, rather arbitrarily, threshold it. Yuk.
-- But we want to aovid inlining large functions that return
-- constructors into contexts that are simply "interesting" | 2,502 | computeDiscount dflags arg_discounts res_discount arg_infos cont_info
-- We multiple the raw discounts (args_discount and result_discount)
-- ty opt_UnfoldingKeenessFactor because the former have to do with
-- *size* whereas the discounts imply that there's some extra
-- *efficiency* to be gained (e.g. beta reductions, case reductions)
-- by inlining.
= 10 -- Discount of 10 because the result replaces the call
-- so we count 10 for the function itself
+ 10 * length actual_arg_discounts
-- Discount of 10 for each arg supplied,
-- because the result replaces the call
+ round (ufKeenessFactor dflags *
fromIntegral (total_arg_discount + res_discount'))
where
actual_arg_discounts = zipWith mk_arg_discount arg_discounts arg_infos
total_arg_discount = sum actual_arg_discounts
mk_arg_discount _ TrivArg = 0
mk_arg_discount _ NonTrivArg = 10
mk_arg_discount discount ValueArg = discount
res_discount'
| LT <- arg_discounts `compareLength` arg_infos
= res_discount -- Over-saturated
| otherwise
= case cont_info of
BoringCtxt -> 0
CaseCtxt -> res_discount -- Presumably a constructor
ValAppCtxt -> res_discount -- Presumably a function
_ -> 40 `min` res_discount
-- ToDo: this 40 `min` res_discount doesn't seem right
-- for DiscArgCtxt it shouldn't matter because the function will
-- get the arg discount for any non-triv arg
-- for RuleArgCtxt we do want to be keener to inline; but not only
-- constructor results
-- for RhsCtxt I suppose that exposing a data con is good in general
-- And 40 seems very arbitrary
--
-- res_discount can be very large when a function returns
-- constructors; but we only want to invoke that large discount
-- when there's a case continuation.
-- Otherwise we, rather arbitrarily, threshold it. Yuk.
-- But we want to aovid inlining large functions that return
-- constructors into contexts that are simply "interesting" | 2,407 | false | true | 4 | 10 | 861 | 232 | 128 | 104 | null | null |
sdiehl/unirewrite | test/Test.hs | mit | matchTests :: TestTree
matchTests = testGroup "Match Tests"
[
testCase "testPattern1" $ test1
, testCase "testPattern2" $ test2
, testCase "testPattern3" $ test3
, testCase "testPattern4" $ test4
, testCase "testPattern5" $ test5
, testCase "testPattern6" $ test6
, testCase "testPattern7" $ test7
, testCase "testPattern8" $ test8
, testCase "testPattern9" $ test9
, testCase "testPattern10" $ test10
] | 429 | matchTests :: TestTree
matchTests = testGroup "Match Tests"
[
testCase "testPattern1" $ test1
, testCase "testPattern2" $ test2
, testCase "testPattern3" $ test3
, testCase "testPattern4" $ test4
, testCase "testPattern5" $ test5
, testCase "testPattern6" $ test6
, testCase "testPattern7" $ test7
, testCase "testPattern8" $ test8
, testCase "testPattern9" $ test9
, testCase "testPattern10" $ test10
] | 429 | matchTests = testGroup "Match Tests"
[
testCase "testPattern1" $ test1
, testCase "testPattern2" $ test2
, testCase "testPattern3" $ test3
, testCase "testPattern4" $ test4
, testCase "testPattern5" $ test5
, testCase "testPattern6" $ test6
, testCase "testPattern7" $ test7
, testCase "testPattern8" $ test8
, testCase "testPattern9" $ test9
, testCase "testPattern10" $ test10
] | 406 | false | true | 0 | 7 | 84 | 117 | 58 | 59 | null | null |
thoughtbot/github | Github/GitData/References.hs | bsd-3-clause | createReference :: GithubAuth -> String -> String -> NewGitReference -> IO (Either Error GitReference)
createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 220 | createReference :: GithubAuth -> String -> String -> NewGitReference -> IO (Either Error GitReference)
createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 220 | createReference auth owner reqRepoName newRef =
githubPost auth ["repos", owner, reqRepoName, "git", "refs"] newRef | 117 | false | true | 0 | 11 | 29 | 69 | 36 | 33 | null | null |
bitemyapp/HollaBack | HollaBack/Date/Conversion.hs | bsd-2-clause | offsetTime (TimeUnit ws Weeks)
utct@UTCTime { utctDay = day } = utct { utctDay = newDay }
where newDay = addDays days day
days = ws * 7 | 162 | offsetTime (TimeUnit ws Weeks)
utct@UTCTime { utctDay = day } = utct { utctDay = newDay }
where newDay = addDays days day
days = ws * 7 | 162 | offsetTime (TimeUnit ws Weeks)
utct@UTCTime { utctDay = day } = utct { utctDay = newDay }
where newDay = addDays days day
days = ws * 7 | 162 | false | false | 1 | 9 | 54 | 63 | 32 | 31 | null | null |
mpickering/hackage-server | Distribution/Server/Features/PreferredVersions/Backup.hs | bsd-3-clause | importPreferredCSV _ _ _ = fail "Failed to read preferred.csv" | 62 | importPreferredCSV _ _ _ = fail "Failed to read preferred.csv" | 62 | importPreferredCSV _ _ _ = fail "Failed to read preferred.csv" | 62 | false | false | 0 | 5 | 9 | 16 | 7 | 9 | null | null |
ku-fpg/core-reify | example/Main.hs | bsd-2-clause | main = do
-- e <- reifyExpr fib
-- e <- reifyExpr (99 :: Int)
-- e <- reifyExpr (fib 99)
-- e <- reifyExpr (\ x -> x :: Int)
-- e <- reifyExpr ((\x -> x)(\ x -> x :: Int) 99)
-- e <- reifyExpr (\ x y -> x + y::Int)
-- e <- reifyExpr (id (99::Int))
-- e <- reifyExpr (id :: Int -> Int)
-- e <- reifyExpr (const (99::Int) (True::Bool))
-- e <- reifyExpr (\ x y -> (x && y,x || y))
-- e <- reifyExpr (let f = \ x y -> (x && y,x || y) in (f,f))
-- e <- reifyExpr ([1,2,3]::[Int])
-- e <- reifyExpr (let xs = 1 : xs :: [Int] in xs)
e <- reifyExpr (if 2 == (4::Int) then 7 :: Int else 9)
print e
print "done"
{-
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<4> binding-of 'tyAppE
tyAppE ∷ Expr (Int → Int)
tyAppE = TyApp (Int → Int) Int (idE Int) (Type Int)
hermit<5> top
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<6> binding-of 'idE
idE ∷ ∀ a . Expr (Type a → a → a)
idE = λ a →
Var
(Type a → a → a)
(Bindee_
(Type a → a → a)
(λ ds →
case ds of wild (a → a)
Type → id a)
(Nothing (Expr (Type a → a → a)))
(Name_ (Type a → a → a) (unpackCString# "id") (I# 0)))
-}
{-
let f = /\ t \ a -> a
in f Int x
[f] => Expr (\/ a . a -> a)
[f t] => Expr (t -> t)
[f t x] => Expr t
-} | 1,629 | main = do
-- e <- reifyExpr fib
-- e <- reifyExpr (99 :: Int)
-- e <- reifyExpr (fib 99)
-- e <- reifyExpr (\ x -> x :: Int)
-- e <- reifyExpr ((\x -> x)(\ x -> x :: Int) 99)
-- e <- reifyExpr (\ x y -> x + y::Int)
-- e <- reifyExpr (id (99::Int))
-- e <- reifyExpr (id :: Int -> Int)
-- e <- reifyExpr (const (99::Int) (True::Bool))
-- e <- reifyExpr (\ x y -> (x && y,x || y))
-- e <- reifyExpr (let f = \ x y -> (x && y,x || y) in (f,f))
-- e <- reifyExpr ([1,2,3]::[Int])
-- e <- reifyExpr (let xs = 1 : xs :: [Int] in xs)
e <- reifyExpr (if 2 == (4::Int) then 7 :: Int else 9)
print e
print "done"
{-
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<4> binding-of 'tyAppE
tyAppE ∷ Expr (Int → Int)
tyAppE = TyApp (Int → Int) Int (idE Int) (Type Int)
hermit<5> top
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<6> binding-of 'idE
idE ∷ ∀ a . Expr (Type a → a → a)
idE = λ a →
Var
(Type a → a → a)
(Bindee_
(Type a → a → a)
(λ ds →
case ds of wild (a → a)
Type → id a)
(Nothing (Expr (Type a → a → a)))
(Name_ (Type a → a → a) (unpackCString# "id") (I# 0)))
-}
{-
let f = /\ t \ a -> a
in f Int x
[f] => Expr (\/ a . a -> a)
[f t] => Expr (t -> t)
[f t x] => Expr t
-} | 1,629 | main = do
-- e <- reifyExpr fib
-- e <- reifyExpr (99 :: Int)
-- e <- reifyExpr (fib 99)
-- e <- reifyExpr (\ x -> x :: Int)
-- e <- reifyExpr ((\x -> x)(\ x -> x :: Int) 99)
-- e <- reifyExpr (\ x y -> x + y::Int)
-- e <- reifyExpr (id (99::Int))
-- e <- reifyExpr (id :: Int -> Int)
-- e <- reifyExpr (const (99::Int) (True::Bool))
-- e <- reifyExpr (\ x y -> (x && y,x || y))
-- e <- reifyExpr (let f = \ x y -> (x && y,x || y) in (f,f))
-- e <- reifyExpr ([1,2,3]::[Int])
-- e <- reifyExpr (let xs = 1 : xs :: [Int] in xs)
e <- reifyExpr (if 2 == (4::Int) then 7 :: Int else 9)
print e
print "done"
{-
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<4> binding-of 'tyAppE
tyAppE ∷ Expr (Int → Int)
tyAppE = TyApp (Int → Int) Int (idE Int) (Type Int)
hermit<5> top
module main:Main where
idE ∷ ∀ a . Expr (Type a → a → a)
tyAppE ∷ Expr (Int → Int)
appE ∷ Expr (Int → Int)
fib ∷ Int → Int
main ∷ IO ()
main ∷ IO ()
hermit<6> binding-of 'idE
idE ∷ ∀ a . Expr (Type a → a → a)
idE = λ a →
Var
(Type a → a → a)
(Bindee_
(Type a → a → a)
(λ ds →
case ds of wild (a → a)
Type → id a)
(Nothing (Expr (Type a → a → a)))
(Name_ (Type a → a → a) (unpackCString# "id") (I# 0)))
-}
{-
let f = /\ t \ a -> a
in f Int x
[f] => Expr (\/ a . a -> a)
[f t] => Expr (t -> t)
[f t x] => Expr t
-} | 1,629 | false | false | 1 | 13 | 592 | 71 | 41 | 30 | null | null |
vizietto/kalkulu | src/Kalkulu/Builtin/Evaluation.hs | gpl-3.0 | pureReleaseHold (Cmp _ [CmpB h args])
| h == B.Hold || h == B.HoldForm ||
h == B.HoldPattern || h == B.HoldComplete = CmpB B.Sequence args | 144 | pureReleaseHold (Cmp _ [CmpB h args])
| h == B.Hold || h == B.HoldForm ||
h == B.HoldPattern || h == B.HoldComplete = CmpB B.Sequence args | 144 | pureReleaseHold (Cmp _ [CmpB h args])
| h == B.Hold || h == B.HoldForm ||
h == B.HoldPattern || h == B.HoldComplete = CmpB B.Sequence args | 144 | false | false | 0 | 15 | 31 | 74 | 35 | 39 | null | null |
cshung/MiscLab | Haskell99/q27.test.hs | mit | test2 = TestCase (assertEqual "group [1] [1,2,3] should be [[[1]],[[2]],[[3]]] ." ([[[1]],[[2]],[[3]]] ) (group [1] [1,2,3])) | 163 | test2 = TestCase (assertEqual "group [1] [1,2,3] should be [[[1]],[[2]],[[3]]] ." ([[[1]],[[2]],[[3]]] ) (group [1] [1,2,3])) | 163 | test2 = TestCase (assertEqual "group [1] [1,2,3] should be [[[1]],[[2]],[[3]]] ." ([[[1]],[[2]],[[3]]] ) (group [1] [1,2,3])) | 163 | false | false | 0 | 11 | 53 | 69 | 41 | 28 | null | null |
leshchevds/ganeti | src/Ganeti/HTools/Backend/Rapi.hs | bsd-2-clause | readData :: String -- ^ URL to use as source
-> IO (Result String, Result String, Result String, Result String)
readData url =
if filePrefix `isPrefixOf` url
then readDataFile (drop (length filePrefix) url)
else readDataHttp url | 247 | readData :: String -- ^ URL to use as source
-> IO (Result String, Result String, Result String, Result String)
readData url =
if filePrefix `isPrefixOf` url
then readDataFile (drop (length filePrefix) url)
else readDataHttp url | 247 | readData url =
if filePrefix `isPrefixOf` url
then readDataFile (drop (length filePrefix) url)
else readDataHttp url | 126 | false | true | 0 | 10 | 54 | 84 | 42 | 42 | null | null |
tjakway/ghcjvm | compiler/llvmGen/LlvmCodeGen/Regs.hs | bsd-3-clause | otherN = getUnique (fsLit "LlvmCodeGen.Regs.otherN") | 52 | otherN = getUnique (fsLit "LlvmCodeGen.Regs.otherN") | 52 | otherN = getUnique (fsLit "LlvmCodeGen.Regs.otherN") | 52 | false | false | 1 | 7 | 4 | 19 | 7 | 12 | null | null |
amccausl/Swish | Swish/HaskellRDF/RDFGraphTest.hs | lgpl-2.1 | lt1 = Just (langName "en") | 26 | lt1 = Just (langName "en") | 26 | lt1 = Just (langName "en") | 26 | false | false | 1 | 7 | 4 | 18 | 7 | 11 | null | null |
holzensp/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getRegOrMem :: CmmExpr -> NatM (Operand, InstrBlock)
getRegOrMem e@(CmmLoad mem pk) = do
is32Bit <- is32BitPlatform
use_sse2 <- sse2Enabled
if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True)
then do
Amode src mem_code <- getAmode mem
return (OpAddr src, mem_code)
else do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 412 | getRegOrMem :: CmmExpr -> NatM (Operand, InstrBlock)
getRegOrMem e@(CmmLoad mem pk) = do
is32Bit <- is32BitPlatform
use_sse2 <- sse2Enabled
if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True)
then do
Amode src mem_code <- getAmode mem
return (OpAddr src, mem_code)
else do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 412 | getRegOrMem e@(CmmLoad mem pk) = do
is32Bit <- is32BitPlatform
use_sse2 <- sse2Enabled
if (not (isFloatType pk) || use_sse2) && (if is32Bit then not (isWord64 pk) else True)
then do
Amode src mem_code <- getAmode mem
return (OpAddr src, mem_code)
else do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 359 | false | true | 9 | 10 | 100 | 159 | 82 | 77 | null | null |
ezyang/ghc | compiler/nativeGen/RegAlloc/Graph/ArchBase.hs | bsd-3-clause | - | powersetLS (list of sets)
powersetLS :: Uniquable a => UniqSet a -> [UniqSet a]
powersetLS s = map mkUniqSet $ powersetL $ nonDetEltsUniqSet s
| 150 | powersetLS :: Uniquable a => UniqSet a -> [UniqSet a]
powersetLS s = map mkUniqSet $ powersetL $ nonDetEltsUniqSet s | 119 | powersetLS s = map mkUniqSet $ powersetL $ nonDetEltsUniqSet s | 65 | true | true | 1 | 10 | 29 | 51 | 26 | 25 | null | null |
seL4/capDL-tool | CapDL/MakeModel.hs | bsd-2-clause | slotRefToCapRef :: Idents CapName -> SlotRef -> CapRef
slotRefToCapRef _ (Left (obj, slot)) = (refToID obj, slot) | 113 | slotRefToCapRef :: Idents CapName -> SlotRef -> CapRef
slotRefToCapRef _ (Left (obj, slot)) = (refToID obj, slot) | 113 | slotRefToCapRef _ (Left (obj, slot)) = (refToID obj, slot) | 58 | false | true | 0 | 11 | 16 | 54 | 26 | 28 | null | null |
feliposz/learning-stuff | haskell/learn_chapter8.hs | mit | shapes = [c1, c2, r1, r2] | 25 | shapes = [c1, c2, r1, r2] | 25 | shapes = [c1, c2, r1, r2] | 25 | false | false | 0 | 5 | 5 | 18 | 11 | 7 | null | null |
PaulGustafson/stringnet | Stringnet.hs | mit | compose n (Compose ms) = Compose $ [n] ++ ms | 44 | compose n (Compose ms) = Compose $ [n] ++ ms | 44 | compose n (Compose ms) = Compose $ [n] ++ ms | 44 | false | false | 2 | 6 | 9 | 31 | 14 | 17 | null | null |
gabesoft/kapi | test/PersistenceMongoDBSpec.hs | bsd-3-clause | verifyMkInDocument
:: MonadIO m
=> Record -> Record -> m Expectation
verifyMkInDocument r expected = do
doc <- mkInDocument recDef (not $ hasField "_id" r) r
return $
(replaceUTCDate createdAtLabel . replaceUTCDate updatedAtLabel) (Record doc) `shouldBe` expected | 275 | verifyMkInDocument
:: MonadIO m
=> Record -> Record -> m Expectation
verifyMkInDocument r expected = do
doc <- mkInDocument recDef (not $ hasField "_id" r) r
return $
(replaceUTCDate createdAtLabel . replaceUTCDate updatedAtLabel) (Record doc) `shouldBe` expected | 275 | verifyMkInDocument r expected = do
doc <- mkInDocument recDef (not $ hasField "_id" r) r
return $
(replaceUTCDate createdAtLabel . replaceUTCDate updatedAtLabel) (Record doc) `shouldBe` expected | 202 | false | true | 0 | 12 | 48 | 100 | 46 | 54 | null | null |
robdockins/edison | edison-api/src/Data/Edison/Sym.hs | mit | -- | Right (rear) cons on a sequence. The new element appears on the right.
-- Identical to 'S.rcons' with reversed arguments.
(|>) :: S.Sequence seq => seq a -> a -> seq a
(|>) = P.flip S.rcons | 197 | (|>) :: S.Sequence seq => seq a -> a -> seq a
(|>) = P.flip S.rcons | 67 | (|>) = P.flip S.rcons | 21 | true | true | 0 | 8 | 40 | 47 | 25 | 22 | null | null |
mightymoose/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/WBTree.hs | bsd-3-clause | difference :: Ord a => WBTree a -> WBTree a -> WBTree a
difference Leaf _ = Leaf | 81 | difference :: Ord a => WBTree a -> WBTree a -> WBTree a
difference Leaf _ = Leaf | 81 | difference Leaf _ = Leaf | 25 | false | true | 0 | 8 | 18 | 40 | 18 | 22 | null | null |
cwlmyjm/haskell | FUN/Lab8solution.hs | mpl-2.0 | showProp (NOT p) = '~' : showProp p | 44 | showProp (NOT p) = '~' : showProp p | 44 | showProp (NOT p) = '~' : showProp p | 44 | false | false | 0 | 7 | 16 | 22 | 10 | 12 | null | null |
keithodulaigh/Hets | Common/Lexer.hs | gpl-2.0 | oBraceT :: CharParser st Token
oBraceT = asSeparator "{" | 56 | oBraceT :: CharParser st Token
oBraceT = asSeparator "{" | 56 | oBraceT = asSeparator "{" | 25 | false | true | 1 | 5 | 8 | 22 | 9 | 13 | null | null |
eccstartup/numberToText | src/Text/New/NumberToText.hs | bsd-3-clause | -- | ["123", "456"] to Integer [123, 456]
readInts :: [String] -> [Int]
readInts s = map read s | 95 | readInts :: [String] -> [Int]
readInts s = map read s | 53 | readInts s = map read s | 23 | true | true | 0 | 6 | 18 | 30 | 16 | 14 | null | null |
ml9951/ghc | compiler/prelude/THNames.hs | bsd-3-clause | -- TyConUniques available: 200-299
-- Check in PrelNames if you want to change this
expTyConKey, matchTyConKey, clauseTyConKey, qTyConKey, expQTyConKey,
decQTyConKey, patTyConKey, matchQTyConKey, clauseQTyConKey,
stmtQTyConKey, conQTyConKey, typeQTyConKey, typeTyConKey, tyVarBndrTyConKey,
decTyConKey, varStrictTypeQTyConKey, strictTypeQTyConKey,
fieldExpTyConKey, fieldPatTyConKey, nameTyConKey, patQTyConKey,
fieldPatQTyConKey, fieldExpQTyConKey, funDepTyConKey, predTyConKey,
predQTyConKey, decsQTyConKey, ruleBndrQTyConKey, tySynEqnQTyConKey,
roleTyConKey, tExpTyConKey, injAnnTyConKey, kindTyConKey :: Unique
expTyConKey = mkPreludeTyConUnique 200 | 694 | expTyConKey, matchTyConKey, clauseTyConKey, qTyConKey, expQTyConKey,
decQTyConKey, patTyConKey, matchQTyConKey, clauseQTyConKey,
stmtQTyConKey, conQTyConKey, typeQTyConKey, typeTyConKey, tyVarBndrTyConKey,
decTyConKey, varStrictTypeQTyConKey, strictTypeQTyConKey,
fieldExpTyConKey, fieldPatTyConKey, nameTyConKey, patQTyConKey,
fieldPatQTyConKey, fieldExpQTyConKey, funDepTyConKey, predTyConKey,
predQTyConKey, decsQTyConKey, ruleBndrQTyConKey, tySynEqnQTyConKey,
roleTyConKey, tExpTyConKey, injAnnTyConKey, kindTyConKey :: Unique
expTyConKey = mkPreludeTyConUnique 200 | 609 | expTyConKey = mkPreludeTyConUnique 200 | 50 | true | true | 0 | 5 | 93 | 80 | 73 | 7 | null | null |
ahodgen/qualys | Qualys/KnowledgeBase.hs | bsd-3-clause | -- | Get entries published after this time
kboPubAfter :: OptValTime a => a -> Param
kboPubAfter x = ("published_after", toOptTm x) | 131 | kboPubAfter :: OptValTime a => a -> Param
kboPubAfter x = ("published_after", toOptTm x) | 88 | kboPubAfter x = ("published_after", toOptTm x) | 46 | true | true | 0 | 6 | 21 | 35 | 18 | 17 | null | null |
ice1000/Kt2Dart | src/Annotations.hs | agpl-3.0 | unescapedAnnotationP :: Parser String
unescapedAnnotationP = do
ns <- reservedLP "." \|/ tokenLP simpleNameP
ta <- option0 [] typeArgumentsP
va <- option0 [] valueArgumentsP
return $ join ns ++ ta ++ va
-- | 213 | unescapedAnnotationP :: Parser String
unescapedAnnotationP = do
ns <- reservedLP "." \|/ tokenLP simpleNameP
ta <- option0 [] typeArgumentsP
va <- option0 [] valueArgumentsP
return $ join ns ++ ta ++ va
-- | 213 | unescapedAnnotationP = do
ns <- reservedLP "." \|/ tokenLP simpleNameP
ta <- option0 [] typeArgumentsP
va <- option0 [] valueArgumentsP
return $ join ns ++ ta ++ va
-- | 175 | false | true | 0 | 10 | 40 | 78 | 35 | 43 | null | null |
jwiegley/github | samples/Teams/Repos/AddOrUpdateTeamRepo.hs | bsd-3-clause | main :: IO ()
main = do
args <- getArgs
result <- case args of
[token, team_id, org, repo] ->
GitHub.addOrUpdateTeamRepo'
(GitHub.OAuth $ fromString token)
(GitHub.mkTeamId $ read team_id)
(GitHub.mkOrganizationName $ fromString org)
(GitHub.mkRepoName $ fromString repo)
GitHub.PermissionPull
_ ->
error "usage: AddOrUpdateTeamRepo <token> <team_id> <org> <repo>"
case result of
Left err -> putStrLn $ "Error: " <> tshow err
Right team -> putStrLn $ tshow team | 663 | main :: IO ()
main = do
args <- getArgs
result <- case args of
[token, team_id, org, repo] ->
GitHub.addOrUpdateTeamRepo'
(GitHub.OAuth $ fromString token)
(GitHub.mkTeamId $ read team_id)
(GitHub.mkOrganizationName $ fromString org)
(GitHub.mkRepoName $ fromString repo)
GitHub.PermissionPull
_ ->
error "usage: AddOrUpdateTeamRepo <token> <team_id> <org> <repo>"
case result of
Left err -> putStrLn $ "Error: " <> tshow err
Right team -> putStrLn $ tshow team | 663 | main = do
args <- getArgs
result <- case args of
[token, team_id, org, repo] ->
GitHub.addOrUpdateTeamRepo'
(GitHub.OAuth $ fromString token)
(GitHub.mkTeamId $ read team_id)
(GitHub.mkOrganizationName $ fromString org)
(GitHub.mkRepoName $ fromString repo)
GitHub.PermissionPull
_ ->
error "usage: AddOrUpdateTeamRepo <token> <team_id> <org> <repo>"
case result of
Left err -> putStrLn $ "Error: " <> tshow err
Right team -> putStrLn $ tshow team | 649 | false | true | 0 | 14 | 268 | 167 | 81 | 86 | null | null |
nicball/orlin | src/Orlin/Frontend/CodeGen.hs | mit | genExpr :: IR.Expr -> FuncGen AST.Operand
genExpr (IR.ConstantExpr c) = return . AST.ConstantOperand . fromIRConstant $ c | 121 | genExpr :: IR.Expr -> FuncGen AST.Operand
genExpr (IR.ConstantExpr c) = return . AST.ConstantOperand . fromIRConstant $ c | 121 | genExpr (IR.ConstantExpr c) = return . AST.ConstantOperand . fromIRConstant $ c | 79 | false | true | 0 | 10 | 16 | 52 | 24 | 28 | null | null |
ku-fpg/remote-json | remote-json-test/Unit.hs | bsd-3-clause | main:: IO()
main = do
putStrLn "## Untyped ##"
sequence_ [ untyped s
| s <- sessions
]
putStrLn "## Typed ##"
sequence_ [ typed (DSLSession s)
| s <- sessions
] | 266 | main:: IO()
main = do
putStrLn "## Untyped ##"
sequence_ [ untyped s
| s <- sessions
]
putStrLn "## Typed ##"
sequence_ [ typed (DSLSession s)
| s <- sessions
] | 266 | main = do
putStrLn "## Untyped ##"
sequence_ [ untyped s
| s <- sessions
]
putStrLn "## Typed ##"
sequence_ [ typed (DSLSession s)
| s <- sessions
] | 254 | false | true | 0 | 12 | 137 | 81 | 34 | 47 | null | null |
rfranek/duckling | Duckling/Time/NB/Rules.hs | bsd-3-clause | ruleNamedday2 :: Rule
ruleNamedday2 = Rule
{ name = "named-day"
, pattern =
[ regex "tirsdag|tirs?\\.?"
]
, prod = \_ -> tt $ dayOfWeek 2
} | 155 | ruleNamedday2 :: Rule
ruleNamedday2 = Rule
{ name = "named-day"
, pattern =
[ regex "tirsdag|tirs?\\.?"
]
, prod = \_ -> tt $ dayOfWeek 2
} | 155 | ruleNamedday2 = Rule
{ name = "named-day"
, pattern =
[ regex "tirsdag|tirs?\\.?"
]
, prod = \_ -> tt $ dayOfWeek 2
} | 133 | false | true | 0 | 10 | 42 | 59 | 30 | 29 | null | null |
alfpark/bond | compiler/src/Language/Bond/Lexer.hs | mit | semiOrComma = semi <|> comma | 28 | semiOrComma = semi <|> comma | 28 | semiOrComma = semi <|> comma | 28 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
twittner/cql | src/Database/CQL/Protocol/Codec.hs | mpl-2.0 | putNative _ v@(CqlSet _) = fail $ "putNative: collection type: " ++ show v | 78 | putNative _ v@(CqlSet _) = fail $ "putNative: collection type: " ++ show v | 78 | putNative _ v@(CqlSet _) = fail $ "putNative: collection type: " ++ show v | 78 | false | false | 0 | 8 | 17 | 31 | 15 | 16 | null | null |
zcleghern/hchess | src/Main.hs | mit | alphaBetaT :: Game -> Move
alphaBetaT g = maxGame $ map (\mv -> (abNode 6 (-100) 100 (move g mv) False, mv)) (nextMoves g)
where maxGame = snd . foldr foldingF (-100, Move (Coord 1 1) (Coord 1 1))
foldingF x y = if fst y > fst x then y else x | 264 | alphaBetaT :: Game -> Move
alphaBetaT g = maxGame $ map (\mv -> (abNode 6 (-100) 100 (move g mv) False, mv)) (nextMoves g)
where maxGame = snd . foldr foldingF (-100, Move (Coord 1 1) (Coord 1 1))
foldingF x y = if fst y > fst x then y else x | 264 | alphaBetaT g = maxGame $ map (\mv -> (abNode 6 (-100) 100 (move g mv) False, mv)) (nextMoves g)
where maxGame = snd . foldr foldingF (-100, Move (Coord 1 1) (Coord 1 1))
foldingF x y = if fst y > fst x then y else x | 237 | false | true | 4 | 11 | 74 | 154 | 75 | 79 | null | null |
olsner/ghc | testsuite/tests/gadt/red-black.hs | bsd-3-clause | black (RNode a v (Fix (RNode b u c))) w (x@(BNode _ _ _)) = BNode (RNode a v b) u (RNode c w x) | 95 | black (RNode a v (Fix (RNode b u c))) w (x@(BNode _ _ _)) = BNode (RNode a v b) u (RNode c w x) | 95 | black (RNode a v (Fix (RNode b u c))) w (x@(BNode _ _ _)) = BNode (RNode a v b) u (RNode c w x) | 95 | false | false | 0 | 11 | 24 | 82 | 41 | 41 | null | null |
mrakgr/futhark | src/Futhark/Representation/Aliases.hs | bsd-3-clause | removeProgAliases :: CanBeAliased (Op lore) =>
Prog (Aliases lore) -> Prog lore
removeProgAliases = rephraseProg removeAliases | 147 | removeProgAliases :: CanBeAliased (Op lore) =>
Prog (Aliases lore) -> Prog lore
removeProgAliases = rephraseProg removeAliases | 147 | removeProgAliases = rephraseProg removeAliases | 46 | false | true | 0 | 10 | 36 | 48 | 21 | 27 | null | null |
seereason/HJScript | src/HJScript/DOM/Window.hs | bsd-3-clause | winName :: Exp Window -> Var String
winName = derefVar "name" | 62 | winName :: Exp Window -> Var String
winName = derefVar "name" | 61 | winName = derefVar "name" | 25 | false | true | 0 | 6 | 11 | 24 | 11 | 13 | null | null |
ml9951/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1") | 56 | unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1") | 56 | unComp1_RDR = varQual_RDR gHC_GENERICS (fsLit "unComp1") | 56 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
ifigueroap/mzv | src/Control/Monad/Reader.hs | bsd-3-clause | withReaderT :: (r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT f m = ReaderT $ runReaderT m . f | 104 | withReaderT :: (r' -> r) -> ReaderT r m a -> ReaderT r' m a
withReaderT f m = ReaderT $ runReaderT m . f | 104 | withReaderT f m = ReaderT $ runReaderT m . f | 44 | false | true | 3 | 8 | 24 | 63 | 28 | 35 | null | null |
urbanslug/ghc | libraries/base/tests/cstring001.hs | bsd-3-clause | main = do
-- Try roundtripping some ASCII strings through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCString try_str peekCString
got_str `assertEqual` try_str
-- Try roundtripping some ASCII strings with lengths through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCStringLen try_str peekCStringLen
got_str `assertEqual` try_str | 429 | main = do
-- Try roundtripping some ASCII strings through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCString try_str peekCString
got_str `assertEqual` try_str
-- Try roundtripping some ASCII strings with lengths through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCStringLen try_str peekCStringLen
got_str `assertEqual` try_str | 429 | main = do
-- Try roundtripping some ASCII strings through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCString try_str peekCString
got_str `assertEqual` try_str
-- Try roundtripping some ASCII strings with lengths through the locale encoding
forM test_strings $ \try_str -> do
got_str <- withCStringLen try_str peekCStringLen
got_str `assertEqual` try_str | 429 | false | false | 1 | 12 | 101 | 84 | 39 | 45 | null | null |
ralphmorton/nano-http | src/Network/HTTP/Nano.hs | bsd-3-clause | safeHTTP :: (MonadError e m, MonadReader r m, AsHttpError e, HasHttpCfg r, MonadIO m) => IO a -> m a
safeHTTP act = do
res <- liftIO $ handle (return . Left) (Right <$> act)
case res of
Left ex -> throwError $ review _NetworkError ex
Right r -> return r | 277 | safeHTTP :: (MonadError e m, MonadReader r m, AsHttpError e, HasHttpCfg r, MonadIO m) => IO a -> m a
safeHTTP act = do
res <- liftIO $ handle (return . Left) (Right <$> act)
case res of
Left ex -> throwError $ review _NetworkError ex
Right r -> return r | 277 | safeHTTP act = do
res <- liftIO $ handle (return . Left) (Right <$> act)
case res of
Left ex -> throwError $ review _NetworkError ex
Right r -> return r | 176 | false | true | 0 | 11 | 74 | 128 | 61 | 67 | null | null |
fpco/hlint | data/Default.hs | bsd-3-clause | error "Evaluate" = scanr1 f [x] ==> [x] | 39 | error "Evaluate" = scanr1 f [x] ==> [x] | 39 | error "Evaluate" = scanr1 f [x] ==> [x] | 39 | false | false | 0 | 7 | 7 | 24 | 12 | 12 | null | null |
music-suite/music-score | src/Music/Score/Internal/Util.hs | bsd-3-clause | tripr :: (a,(b,c)) -> (a,b,c)
tripr (a,(b,c)) = (a,b,c) | 55 | tripr :: (a,(b,c)) -> (a,b,c)
tripr (a,(b,c)) = (a,b,c) | 55 | tripr (a,(b,c)) = (a,b,c) | 25 | false | true | 0 | 7 | 8 | 60 | 37 | 23 | null | null |
Oscarzhao/haskell | functional_program_design/ch03/natural_number.hs | apache-2.0 | signum (Succ n) = Succ Zero | 28 | signum (Succ n) = Succ Zero | 28 | signum (Succ n) = Succ Zero | 28 | false | false | 0 | 7 | 6 | 18 | 8 | 10 | null | null |
rfranek/duckling | Duckling/Time/ES/Rules.hs | bsd-3-clause | ruleProximasNCycle :: Rule
ruleProximasNCycle = Rule
{ name = "proximas n <cycle>"
, pattern =
[ regex "pr(\x00f3|o)xim(o|a)s?"
, Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 379 | ruleProximasNCycle :: Rule
ruleProximasNCycle = Rule
{ name = "proximas n <cycle>"
, pattern =
[ regex "pr(\x00f3|o)xim(o|a)s?"
, Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 379 | ruleProximasNCycle = Rule
{ name = "proximas n <cycle>"
, pattern =
[ regex "pr(\x00f3|o)xim(o|a)s?"
, Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
]
, prod = \tokens -> case tokens of
(_:token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain v
_ -> Nothing
} | 352 | false | true | 0 | 16 | 106 | 124 | 63 | 61 | null | null |
WraithM/haskoin-bitcoind | src/Network/Bitcoin/Haskoin/Trans.hs | bsd-3-clause | outpointAddress :: MonadIO m => OutPoint -> BitcoinT m (Either String Address)
outpointAddress op = withClientIO (`B.outpointAddress` op) | 137 | outpointAddress :: MonadIO m => OutPoint -> BitcoinT m (Either String Address)
outpointAddress op = withClientIO (`B.outpointAddress` op) | 137 | outpointAddress op = withClientIO (`B.outpointAddress` op) | 58 | false | true | 0 | 9 | 17 | 49 | 25 | 24 | null | null |
rtfeldman/elm-package | src/CommandLine/Helpers.hs | bsd-3-clause | git :: (MonadError String m, MonadIO m) => [String] -> m String
git = run "git" | 79 | git :: (MonadError String m, MonadIO m) => [String] -> m String
git = run "git" | 79 | git = run "git" | 15 | false | true | 0 | 8 | 15 | 46 | 22 | 24 | null | null |
airt/game-of-life | src/Game/Read.hs | mit | readArea :: String -> Area
readArea = uncurry (Area 1 1) . firstTwo . readInts . pack
where
readInts = map readInt . splitOn separator
readInt = read . unpack . strip
firstTwo (x : y : _) = (x, y)
separator = pack "," | 235 | readArea :: String -> Area
readArea = uncurry (Area 1 1) . firstTwo . readInts . pack
where
readInts = map readInt . splitOn separator
readInt = read . unpack . strip
firstTwo (x : y : _) = (x, y)
separator = pack "," | 235 | readArea = uncurry (Area 1 1) . firstTwo . readInts . pack
where
readInts = map readInt . splitOn separator
readInt = read . unpack . strip
firstTwo (x : y : _) = (x, y)
separator = pack "," | 208 | false | true | 0 | 10 | 62 | 102 | 52 | 50 | null | null |
ducis/haAni | hs/common/Graphics/UI/GLUT/Raw/Tokens.hs | gpl-2.0 | glut_WINDOW_ALPHA_SIZE :: GLenum
glut_WINDOW_ALPHA_SIZE = 0x006E | 64 | glut_WINDOW_ALPHA_SIZE :: GLenum
glut_WINDOW_ALPHA_SIZE = 0x006E | 64 | glut_WINDOW_ALPHA_SIZE = 0x006E | 31 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
holdenlee/philosophocle | src/Search.hs | mit | down :: (Treelike a b) => Int -> SearchState a b String
down n = do
spath@(SPath xpath xtree) <- get
let cs = children xtree
if n < length cs && n>=0
then (put $ SPath ((TNode (root xtree) (take n cs) (drop (n+1) cs)):xpath)
(cs!!n))
>> return "down"
else throwError "down" | 318 | down :: (Treelike a b) => Int -> SearchState a b String
down n = do
spath@(SPath xpath xtree) <- get
let cs = children xtree
if n < length cs && n>=0
then (put $ SPath ((TNode (root xtree) (take n cs) (drop (n+1) cs)):xpath)
(cs!!n))
>> return "down"
else throwError "down" | 318 | down n = do
spath@(SPath xpath xtree) <- get
let cs = children xtree
if n < length cs && n>=0
then (put $ SPath ((TNode (root xtree) (take n cs) (drop (n+1) cs)):xpath)
(cs!!n))
>> return "down"
else throwError "down" | 262 | false | true | 0 | 19 | 97 | 167 | 83 | 84 | null | null |
mhwombat/exp-uivector-cluster-wains | src/ALife/Creatur/Wain/UIVector/Cluster/Universe.hs | bsd-3-clause | cPredictorR0Range :: Setting (UIDouble, UIDouble)
cPredictorR0Range = requiredSetting "predictorR0Range" | 104 | cPredictorR0Range :: Setting (UIDouble, UIDouble)
cPredictorR0Range = requiredSetting "predictorR0Range" | 104 | cPredictorR0Range = requiredSetting "predictorR0Range" | 54 | false | true | 1 | 6 | 8 | 26 | 12 | 14 | null | null |
ahodgen/archer-calc | src/BuiltIn/Text.hs | bsd-2-clause | lower _ = infError | 18 | lower _ = infError | 18 | lower _ = infError | 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
charlesrosenbauer/Bzo-Compiler | src/HigherOrder.hs | gpl-3.0 | sepEitherMaps :: Ord k => Mp.Map k (Either a b) -> (Mp.Map k a, Mp.Map k b)
sepEitherMaps xs =
let assocs = Mp.assocs xs
rs = Prelude.map extractRight $ L.filter (\(k,a) -> isRight a) assocs
ls = Prelude.map extractLeft $ L.filter (\(k,a) -> isLeft a) assocs
in (Mp.fromList ls, Mp.fromList rs)
where extractLeft :: (k, Either a b) -> (k, a)
extractLeft (k, Left x) = (k, x)
extractRight :: (k, Either a b) -> (k, b)
extractRight (k, Right x) = (k, x) | 507 | sepEitherMaps :: Ord k => Mp.Map k (Either a b) -> (Mp.Map k a, Mp.Map k b)
sepEitherMaps xs =
let assocs = Mp.assocs xs
rs = Prelude.map extractRight $ L.filter (\(k,a) -> isRight a) assocs
ls = Prelude.map extractLeft $ L.filter (\(k,a) -> isLeft a) assocs
in (Mp.fromList ls, Mp.fromList rs)
where extractLeft :: (k, Either a b) -> (k, a)
extractLeft (k, Left x) = (k, x)
extractRight :: (k, Either a b) -> (k, b)
extractRight (k, Right x) = (k, x) | 507 | sepEitherMaps xs =
let assocs = Mp.assocs xs
rs = Prelude.map extractRight $ L.filter (\(k,a) -> isRight a) assocs
ls = Prelude.map extractLeft $ L.filter (\(k,a) -> isLeft a) assocs
in (Mp.fromList ls, Mp.fromList rs)
where extractLeft :: (k, Either a b) -> (k, a)
extractLeft (k, Left x) = (k, x)
extractRight :: (k, Either a b) -> (k, b)
extractRight (k, Right x) = (k, x) | 431 | false | true | 4 | 13 | 140 | 266 | 139 | 127 | null | null |
martialboniou/Dots | X/xmonad.symlink/xmonad.hs | mit | -- Non-numeric num pad keys, sorted by number
--
numPadKeys = [ xK_KP_End, xK_KP_Down, xK_KP_Page_Down -- 1 2 3
, xK_KP_Left, xK_KP_Begin, xK_KP_Right -- 4 5 6
, xK_KP_Home, xK_KP_Up, xK_KP_Page_Up -- 7 8 9
, xK_KP_Insert] | 272 | numPadKeys = [ xK_KP_End, xK_KP_Down, xK_KP_Page_Down -- 1 2 3
, xK_KP_Left, xK_KP_Begin, xK_KP_Right -- 4 5 6
, xK_KP_Home, xK_KP_Up, xK_KP_Page_Up -- 7 8 9
, xK_KP_Insert] | 223 | numPadKeys = [ xK_KP_End, xK_KP_Down, xK_KP_Page_Down -- 1 2 3
, xK_KP_Left, xK_KP_Begin, xK_KP_Right -- 4 5 6
, xK_KP_Home, xK_KP_Up, xK_KP_Page_Up -- 7 8 9
, xK_KP_Insert] | 223 | true | false | 1 | 5 | 86 | 44 | 28 | 16 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Protocol.hs | bsd-3-clause | packageExpr (RefW32 n) = packageRef n (exprCmdVal EXPR_WORD32 EXPR_REF) | 71 | packageExpr (RefW32 n) = packageRef n (exprCmdVal EXPR_WORD32 EXPR_REF) | 71 | packageExpr (RefW32 n) = packageRef n (exprCmdVal EXPR_WORD32 EXPR_REF) | 71 | false | false | 0 | 7 | 8 | 28 | 13 | 15 | null | null |
bos/filemanip | System/FilePath/Find.hs | bsd-3-clause | linkCount :: FindClause T.LinkCount
linkCount = F.linkCount `liftM` fileStatus | 78 | linkCount :: FindClause T.LinkCount
linkCount = F.linkCount `liftM` fileStatus | 78 | linkCount = F.linkCount `liftM` fileStatus | 42 | false | true | 0 | 6 | 8 | 24 | 13 | 11 | null | null |
ezyang/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | -- both unused (SDM):
-- pprInstr PUSHA = text "\tpushal"
-- pprInstr POPA = text "\tpopal"
pprInstr NOP = text "\tnop" | 120 | pprInstr NOP = text "\tnop" | 27 | pprInstr NOP = text "\tnop" | 27 | true | false | 0 | 5 | 21 | 15 | 8 | 7 | null | null |
marcellussiegburg/autotool | collection/src/Rewriting/Abstract/Solve.hs | gpl-2.0 | property env prop = case prop of
D.PropParens p -> property env p
D.And ps -> O.and $ map (property env) ps
D.Or ps -> O.or $ map (property env) ps
D.Not p -> O.not $ property env p
D.Prop1 p x ->
let r = expression env x
in case p of
D.Null -> null r
D.Full -> full r
D.Reflexive -> reflexive r
D.Irreflexive -> irreflexive r
D.Transitive -> transitive r
D.Symmetric -> symmetric r
D.Antisymmetric -> antisymmetric r
D.Asymmetric -> asymmetric r
D.Total -> total r
D.SN -> sn r
D.WN -> wn r
D.CR -> cr r
D.WCR -> wcr r
D.UN -> un r
D.UNC -> unc r
D.Prop2 p x y ->
let r = expression env x
s = expression env x
in case p of
D.Equals -> equals r s
D.Subsetof -> isSubsetOf r s
D.Disjoint -> disjoint r s
-- * test cases | 1,006 | property env prop = case prop of
D.PropParens p -> property env p
D.And ps -> O.and $ map (property env) ps
D.Or ps -> O.or $ map (property env) ps
D.Not p -> O.not $ property env p
D.Prop1 p x ->
let r = expression env x
in case p of
D.Null -> null r
D.Full -> full r
D.Reflexive -> reflexive r
D.Irreflexive -> irreflexive r
D.Transitive -> transitive r
D.Symmetric -> symmetric r
D.Antisymmetric -> antisymmetric r
D.Asymmetric -> asymmetric r
D.Total -> total r
D.SN -> sn r
D.WN -> wn r
D.CR -> cr r
D.WCR -> wcr r
D.UN -> un r
D.UNC -> unc r
D.Prop2 p x y ->
let r = expression env x
s = expression env x
in case p of
D.Equals -> equals r s
D.Subsetof -> isSubsetOf r s
D.Disjoint -> disjoint r s
-- * test cases | 1,006 | property env prop = case prop of
D.PropParens p -> property env p
D.And ps -> O.and $ map (property env) ps
D.Or ps -> O.or $ map (property env) ps
D.Not p -> O.not $ property env p
D.Prop1 p x ->
let r = expression env x
in case p of
D.Null -> null r
D.Full -> full r
D.Reflexive -> reflexive r
D.Irreflexive -> irreflexive r
D.Transitive -> transitive r
D.Symmetric -> symmetric r
D.Antisymmetric -> antisymmetric r
D.Asymmetric -> asymmetric r
D.Total -> total r
D.SN -> sn r
D.WN -> wn r
D.CR -> cr r
D.WCR -> wcr r
D.UN -> un r
D.UNC -> unc r
D.Prop2 p x y ->
let r = expression env x
s = expression env x
in case p of
D.Equals -> equals r s
D.Subsetof -> isSubsetOf r s
D.Disjoint -> disjoint r s
-- * test cases | 1,006 | false | false | 0 | 13 | 439 | 392 | 180 | 212 | null | null |
shashikiranrp/RealWorldHaskell | Chapter 4/Main.hs | apache-2.0 | transpose lines = putStrLn (map head lines) >> transpose (filter ((/=0) . length) $ map (\x -> if null x then [] else tail x) lines) | 132 | transpose lines = putStrLn (map head lines) >> transpose (filter ((/=0) . length) $ map (\x -> if null x then [] else tail x) lines) | 132 | transpose lines = putStrLn (map head lines) >> transpose (filter ((/=0) . length) $ map (\x -> if null x then [] else tail x) lines) | 132 | false | false | 0 | 13 | 25 | 77 | 39 | 38 | null | null |
jgm/pandoc2 | Text/Pandoc2/Reader/Markdown.hs | gpl-2.0 | pImage :: PMonad m => MP m (PR Inlines)
pImage = try $ do
sym '!'
res <- pLink
return $ Future $ \s ->
mapItems linkToImage $ evalResult s res
where linkToImage (Link l s) = single (Image l s)
linkToImage (Txt t) = single (Txt $ "!" <> t)
linkToImage x = single x | 315 | pImage :: PMonad m => MP m (PR Inlines)
pImage = try $ do
sym '!'
res <- pLink
return $ Future $ \s ->
mapItems linkToImage $ evalResult s res
where linkToImage (Link l s) = single (Image l s)
linkToImage (Txt t) = single (Txt $ "!" <> t)
linkToImage x = single x | 315 | pImage = try $ do
sym '!'
res <- pLink
return $ Future $ \s ->
mapItems linkToImage $ evalResult s res
where linkToImage (Link l s) = single (Image l s)
linkToImage (Txt t) = single (Txt $ "!" <> t)
linkToImage x = single x | 275 | false | true | 2 | 10 | 107 | 149 | 68 | 81 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/rename/RnTypes.hs | bsd-3-clause | rnHsTyKi isType doc (HsFunTy ty1 ty2)
= do { (ty1', fvs1) <- rnLHsTyKi isType doc ty1
-- Might find a for-all as the arg of a function type
; (ty2', fvs2) <- rnLHsTyKi isType doc ty2
-- Or as the result. This happens when reading Prelude.hi
-- when we find return :: forall m. Monad m -> forall a. a -> m a
-- Check for fixity rearrangements
; res_ty <- if isType
then mkHsOpTyRn HsFunTy funTyConName funTyFixity ty1' ty2'
else return (HsFunTy ty1' ty2')
; return (res_ty, fvs1 `plusFV` fvs2) } | 589 | rnHsTyKi isType doc (HsFunTy ty1 ty2)
= do { (ty1', fvs1) <- rnLHsTyKi isType doc ty1
-- Might find a for-all as the arg of a function type
; (ty2', fvs2) <- rnLHsTyKi isType doc ty2
-- Or as the result. This happens when reading Prelude.hi
-- when we find return :: forall m. Monad m -> forall a. a -> m a
-- Check for fixity rearrangements
; res_ty <- if isType
then mkHsOpTyRn HsFunTy funTyConName funTyFixity ty1' ty2'
else return (HsFunTy ty1' ty2')
; return (res_ty, fvs1 `plusFV` fvs2) } | 589 | rnHsTyKi isType doc (HsFunTy ty1 ty2)
= do { (ty1', fvs1) <- rnLHsTyKi isType doc ty1
-- Might find a for-all as the arg of a function type
; (ty2', fvs2) <- rnLHsTyKi isType doc ty2
-- Or as the result. This happens when reading Prelude.hi
-- when we find return :: forall m. Monad m -> forall a. a -> m a
-- Check for fixity rearrangements
; res_ty <- if isType
then mkHsOpTyRn HsFunTy funTyConName funTyFixity ty1' ty2'
else return (HsFunTy ty1' ty2')
; return (res_ty, fvs1 `plusFV` fvs2) } | 589 | false | false | 0 | 11 | 186 | 126 | 67 | 59 | null | null |
Lainepress/hledger | hledger/Hledger/Cli/Format.hs | gpl-3.0 | formatStrings :: GenParser Char st [FormatString]
formatStrings = many formatString | 83 | formatStrings :: GenParser Char st [FormatString]
formatStrings = many formatString | 83 | formatStrings = many formatString | 33 | false | true | 0 | 6 | 9 | 24 | 12 | 12 | null | null |
olsner/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey | 55 | cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey | 55 | cTyConName = tcQual gHC_GENERICS (fsLit "C") cTyConKey | 55 | false | false | 0 | 7 | 7 | 19 | 9 | 10 | null | null |
tensorflow/haskell | tensorflow-ops/src/TensorFlow/Convolution.hs | apache-2.0 | conv3DBackpropInputV2 :: (TF.OneOf '[Word16, Double, Float] t, TF.OneOf '[Int32, Int64] tshape)
=> TF.Tensor v1 tshape -- ^ input_sizes
-> TF.Tensor v2 t -- ^ filter
-> TF.Tensor v3 t -- ^ out_backprop
-> TF.Tensor TF.Build t -- ^ output
conv3DBackpropInputV2 = conv3DBackpropInputV2' id PaddingValid ChannelLast | 409 | conv3DBackpropInputV2 :: (TF.OneOf '[Word16, Double, Float] t, TF.OneOf '[Int32, Int64] tshape)
=> TF.Tensor v1 tshape -- ^ input_sizes
-> TF.Tensor v2 t -- ^ filter
-> TF.Tensor v3 t -- ^ out_backprop
-> TF.Tensor TF.Build t
conv3DBackpropInputV2 = conv3DBackpropInputV2' id PaddingValid ChannelLast | 396 | conv3DBackpropInputV2 = conv3DBackpropInputV2' id PaddingValid ChannelLast | 74 | true | true | 0 | 10 | 141 | 106 | 56 | 50 | null | null |
vladfi1/game-ai | lib/Game.hs | mit | playOut :: Game a s => (s -> s) -> s -> [s]
playOut play state =
if terminal state then [state]
else state : playOut play (play state) | 140 | playOut :: Game a s => (s -> s) -> s -> [s]
playOut play state =
if terminal state then [state]
else state : playOut play (play state) | 140 | playOut play state =
if terminal state then [state]
else state : playOut play (play state) | 96 | false | true | 2 | 10 | 34 | 79 | 38 | 41 | null | null |
DanielRS/marquee | src/Text/Marquee/Parser/Common.hs | mit | isLineEnding :: Char -> Bool
isLineEnding c = c == '\n' || c == '\r' | 68 | isLineEnding :: Char -> Bool
isLineEnding c = c == '\n' || c == '\r' | 68 | isLineEnding c = c == '\n' || c == '\r' | 39 | false | true | 2 | 7 | 14 | 42 | 18 | 24 | null | null |
haslab/SecreC | src/Language/SecreC/TypeChecker/Expression.hs | gpl-3.0 | tcLValue isWrite ret (RVariablePExpr l v) = do
v' <- tcVarName isWrite v
let t = typed $ loc v'
unifiesRet l ret t
return $ RVariablePExpr (Typed l t) v' | 169 | tcLValue isWrite ret (RVariablePExpr l v) = do
v' <- tcVarName isWrite v
let t = typed $ loc v'
unifiesRet l ret t
return $ RVariablePExpr (Typed l t) v' | 169 | tcLValue isWrite ret (RVariablePExpr l v) = do
v' <- tcVarName isWrite v
let t = typed $ loc v'
unifiesRet l ret t
return $ RVariablePExpr (Typed l t) v' | 169 | false | false | 0 | 11 | 46 | 82 | 35 | 47 | null | null |
crogers1/manager | xenmgr/XenMgr/Expose/VmObject.hs | gpl-2.0 | _get_domstore_key uuid key = fromMaybe "" <$> dbMaybeRead (domstorepath uuid ++ "/" ++ slashdot key) | 100 | _get_domstore_key uuid key = fromMaybe "" <$> dbMaybeRead (domstorepath uuid ++ "/" ++ slashdot key) | 100 | _get_domstore_key uuid key = fromMaybe "" <$> dbMaybeRead (domstorepath uuid ++ "/" ++ slashdot key) | 100 | false | false | 0 | 10 | 14 | 38 | 17 | 21 | null | null |
mattias-lundell/timber-llvm | src/Syntax2Core.hs | bsd-3-clause | s2cSig (Sig vs qt) = s2cTSig vs qt | 47 | s2cSig (Sig vs qt) = s2cTSig vs qt | 47 | s2cSig (Sig vs qt) = s2cTSig vs qt | 47 | false | false | 0 | 7 | 20 | 22 | 10 | 12 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.