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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nuttycom/haskoin | tests/Network/Haskoin/Script/Tests.hs | unlicense | binTxSigCanonical :: TxSignature -> Bool
binTxSigCanonical ts@(TxSignature _ sh)
| isSigUnknown sh = isLeft $ decodeCanonicalSig $ encodeSig ts
| otherwise = (fromRight $ decodeCanonicalSig $ encodeSig ts) == ts | 220 | binTxSigCanonical :: TxSignature -> Bool
binTxSigCanonical ts@(TxSignature _ sh)
| isSigUnknown sh = isLeft $ decodeCanonicalSig $ encodeSig ts
| otherwise = (fromRight $ decodeCanonicalSig $ encodeSig ts) == ts | 220 | binTxSigCanonical ts@(TxSignature _ sh)
| isSigUnknown sh = isLeft $ decodeCanonicalSig $ encodeSig ts
| otherwise = (fromRight $ decodeCanonicalSig $ encodeSig ts) == ts | 179 | false | true | 0 | 9 | 38 | 76 | 36 | 40 | null | null |
SKA-ScienceDataProcessor/RC | MS5/dna/core/DNA/Interpreter/Spawn.hs | apache-2.0 | -- Split resources for multiple actors
splitResources :: ResGroup -> [NodeInfo] -> Controller [VirtualCAD]
splitResources resG nodes = case resG of
NWorkers k -> do
chunks <- toNChunks k nodes
forM chunks $ \ns -> case ns of
[] -> fatal "Impossible: empty nodelist"
n:rest... | 665 | splitResources :: ResGroup -> [NodeInfo] -> Controller [VirtualCAD]
splitResources resG nodes = case resG of
NWorkers k -> do
chunks <- toNChunks k nodes
forM chunks $ \ns -> case ns of
[] -> fatal "Impossible: empty nodelist"
n:rest -> return $ VirtualCAD n rest
NNod... | 626 | splitResources resG nodes = case resG of
NWorkers k -> do
chunks <- toNChunks k nodes
forM chunks $ \ns -> case ns of
[] -> fatal "Impossible: empty nodelist"
n:rest -> return $ VirtualCAD n rest
NNodes k -> do
when (length nodes < k) $
fatal "Not en... | 558 | true | true | 0 | 16 | 215 | 202 | 95 | 107 | null | null |
happlebao/Core-Haskell | SyntaxChecker.hs | bsd-3-clause | isCoreType _ src (TyParen _) = Left [NotAllowed "TyParen" src] | 62 | isCoreType _ src (TyParen _) = Left [NotAllowed "TyParen" src] | 62 | isCoreType _ src (TyParen _) = Left [NotAllowed "TyParen" src] | 62 | false | false | 1 | 7 | 9 | 33 | 14 | 19 | null | null |
cspollard/bcalib | src/BCalib/JF.hs | bsd-3-clause | jfHs :: Fill JFInfo
jfHs = M.unions <$> sequenceA
[ hist1DDef (binD 0 5 5) "JF vertex multiplicity" (dsigdXpbY "n" "1") "/jfnvtx"
<$$= (jfNVtx.integralL)
, hist1DDef (binD 0 50 10) "JF mass [GeV]" (dsigdXpbY "m" gev) "/jfmass"
<$$= jfMass
, hist1DDef (binD 0 10 10) "JF single track multiplicity" (dsigdXpb... | 1,114 | jfHs :: Fill JFInfo
jfHs = M.unions <$> sequenceA
[ hist1DDef (binD 0 5 5) "JF vertex multiplicity" (dsigdXpbY "n" "1") "/jfnvtx"
<$$= (jfNVtx.integralL)
, hist1DDef (binD 0 50 10) "JF mass [GeV]" (dsigdXpbY "m" gev) "/jfmass"
<$$= jfMass
, hist1DDef (binD 0 10 10) "JF single track multiplicity" (dsigdXpb... | 1,114 | jfHs = M.unions <$> sequenceA
[ hist1DDef (binD 0 5 5) "JF vertex multiplicity" (dsigdXpbY "n" "1") "/jfnvtx"
<$$= (jfNVtx.integralL)
, hist1DDef (binD 0 50 10) "JF mass [GeV]" (dsigdXpbY "m" gev) "/jfmass"
<$$= jfMass
, hist1DDef (binD 0 10 10) "JF single track multiplicity" (dsigdXpbY "n" "1") "/jfnsing... | 1,094 | false | true | 3 | 11 | 221 | 309 | 154 | 155 | null | null |
pwestling/hmonit | src/Util.hs | bsd-3-clause | iterApply :: [a -> a] -> a -> a
iterApply fns val = foldr ($) val fns | 69 | iterApply :: [a -> a] -> a -> a
iterApply fns val = foldr ($) val fns | 69 | iterApply fns val = foldr ($) val fns | 37 | false | true | 0 | 7 | 16 | 40 | 21 | 19 | null | null |
tmcdonell/vector-parallel | Data/Vector/Unboxed/Parallel.hs | bsd-3-clause | map :: (Unbox a, Unbox b) => (a -> b) -> Vector a -> Vector b
map = G.map | 73 | map :: (Unbox a, Unbox b) => (a -> b) -> Vector a -> Vector b
map = G.map | 73 | map = G.map | 11 | false | true | 0 | 9 | 18 | 55 | 26 | 29 | null | null |
Acidburn0zzz/haddock | haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | bsd-2-clause | ubxParenList :: [Html] -> Html
ubxParenList = ubxparens . hsep . punctuate comma | 80 | ubxParenList :: [Html] -> Html
ubxParenList = ubxparens . hsep . punctuate comma | 80 | ubxParenList = ubxparens . hsep . punctuate comma | 49 | false | true | 0 | 6 | 12 | 29 | 15 | 14 | null | null |
christiaanb/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | showDeclImp t (PPostulate _ _ _ _ n ty) = show n ++ " : " ++ showImp t ty | 73 | showDeclImp t (PPostulate _ _ _ _ n ty) = show n ++ " : " ++ showImp t ty | 73 | showDeclImp t (PPostulate _ _ _ _ n ty) = show n ++ " : " ++ showImp t ty | 73 | false | false | 0 | 7 | 19 | 43 | 20 | 23 | null | null |
edofic/crdt | src/Example/PostgresCounters.hs | apache-2.0 | run n d = do
var <- newCrdtVar "" $ Counter 0
forkUpdater var
forever $ do
snap <- readCrdtVar var
print snap
runCrdtOnVar (update $ CounterUpdate n) var
threadDelay $ d * 1000 * 1000 | 205 | run n d = do
var <- newCrdtVar "" $ Counter 0
forkUpdater var
forever $ do
snap <- readCrdtVar var
print snap
runCrdtOnVar (update $ CounterUpdate n) var
threadDelay $ d * 1000 * 1000 | 205 | run n d = do
var <- newCrdtVar "" $ Counter 0
forkUpdater var
forever $ do
snap <- readCrdtVar var
print snap
runCrdtOnVar (update $ CounterUpdate n) var
threadDelay $ d * 1000 * 1000 | 205 | false | false | 1 | 13 | 57 | 95 | 38 | 57 | null | null |
simonmichael/hledger | hledger-lib/Hledger/Data/Dates.hs | gpl-3.0 | periodexprdatespanp :: Day -> TextParser m DateSpan
periodexprdatespanp rdate = choice $ map try [
doubledatespanp rdate,
quarterdatespanp rdate,
fromdatespanp rdate,
todatespanp rdate,
... | 374 | periodexprdatespanp :: Day -> TextParser m DateSpan
periodexprdatespanp rdate = choice $ map try [
doubledatespanp rdate,
quarterdatespanp rdate,
fromdatespanp rdate,
todatespanp rdate,
... | 374 | periodexprdatespanp rdate = choice $ map try [
doubledatespanp rdate,
quarterdatespanp rdate,
fromdatespanp rdate,
todatespanp rdate,
justdatespanp rdate
... | 322 | false | true | 0 | 8 | 192 | 62 | 30 | 32 | null | null |
randen/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | -- windows
normaliseLineEndings ('\r':s) = '\n' : normaliseLineEndings s | 77 | normaliseLineEndings ('\r':s) = '\n' : normaliseLineEndings s | 66 | normaliseLineEndings ('\r':s) = '\n' : normaliseLineEndings s | 66 | true | false | 0 | 7 | 13 | 24 | 12 | 12 | null | null |
andyarvanitis/Idris-dev | src/IRTS/Compiler.hs | bsd-3-clause | irAlt vs _ (ConstCase c rhs)
= ifail $ "Can't match on (" ++ show c ++ ")" | 78 | irAlt vs _ (ConstCase c rhs)
= ifail $ "Can't match on (" ++ show c ++ ")" | 78 | irAlt vs _ (ConstCase c rhs)
= ifail $ "Can't match on (" ++ show c ++ ")" | 78 | false | false | 0 | 7 | 21 | 37 | 17 | 20 | null | null |
oldmanmike/ghc | compiler/utils/Outputable.hs | bsd-3-clause | char c = docToSDoc $ Pretty.char c | 39 | char c = docToSDoc $ Pretty.char c | 39 | char c = docToSDoc $ Pretty.char c | 39 | false | false | 0 | 7 | 11 | 18 | 8 | 10 | null | null |
andrewthad/persistent | persistent-mysql/Database/Persist/MySQL.hs | mit | showAlterDb (AlterTable t at) = (False, pack $ showAlterTable t at) | 67 | showAlterDb (AlterTable t at) = (False, pack $ showAlterTable t at) | 67 | showAlterDb (AlterTable t at) = (False, pack $ showAlterTable t at) | 67 | false | false | 0 | 7 | 10 | 32 | 16 | 16 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 1036 = 1035 | 11 | 1036 = 1035 | 11 | 1036 = 1035 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
forked-upstream-packages-for-ghcjs/ghcjs | ghcjs/src/Gen2/Optimizer.hs | mit | subStats f (WhileStat b e s) = WhileStat b e <$> f s | 52 | subStats f (WhileStat b e s) = WhileStat b e <$> f s | 52 | subStats f (WhileStat b e s) = WhileStat b e <$> f s | 52 | false | false | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
keithodulaigh/Hets | LF/Sign.hs | gpl-2.0 | inclSyms :: Set.Set Symbol -> Sign -> Set.Set Symbol
inclSyms syms sig =
foldl (\ syms' (Def s t v) ->
if Set.notMember s syms' then syms' else
let syms1 = getConstants t
syms2 = case v of
Nothing -> Set.empty
Just v' -... | 437 | inclSyms :: Set.Set Symbol -> Sign -> Set.Set Symbol
inclSyms syms sig =
foldl (\ syms' (Def s t v) ->
if Set.notMember s syms' then syms' else
let syms1 = getConstants t
syms2 = case v of
Nothing -> Set.empty
Just v' -... | 437 | inclSyms syms sig =
foldl (\ syms' (Def s t v) ->
if Set.notMember s syms' then syms' else
let syms1 = getConstants t
syms2 = case v of
Nothing -> Set.empty
Just v' -> getConstants v'
in Set.union syms... | 384 | false | true | 2 | 15 | 186 | 150 | 70 | 80 | null | null |
NicolasDP/maild | Network/SMTP/Server.hs | bsd-3-clause | closeHandle con = respond221 con >> hcClose con | 47 | closeHandle con = respond221 con >> hcClose con | 47 | closeHandle con = respond221 con >> hcClose con | 47 | false | false | 0 | 6 | 7 | 19 | 8 | 11 | null | null |
davdar/maam | src/FP/Monads.hs | bsd-3-clause | execState :: s -> State s a -> s
execState = fst .: runState | 60 | execState :: s -> State s a -> s
execState = fst .: runState | 60 | execState = fst .: runState | 27 | false | true | 0 | 7 | 13 | 28 | 14 | 14 | null | null |
robstewart57/ripl | src/AstMappings.hs | bsd-3-clause | actionVars (R.StmtIfThen condExp stmts) =
concatMap actionVars stmts | 70 | actionVars (R.StmtIfThen condExp stmts) =
concatMap actionVars stmts | 70 | actionVars (R.StmtIfThen condExp stmts) =
concatMap actionVars stmts | 70 | false | false | 0 | 7 | 9 | 25 | 11 | 14 | null | null |
dmjio/BerkeleyDB | src/Data/BerkeleyDB.hs | bsd-3-clause | -- | /O(n*log n)/. Build a database from a list of key\/value pairs. See also 'fromAscList'.
fromList :: (Binary key, Binary value) => [(key, value)] -> Db key value
fromList = fromListWith const | 195 | fromList :: (Binary key, Binary value) => [(key, value)] -> Db key value
fromList = fromListWith const | 102 | fromList = fromListWith const | 29 | true | true | 0 | 9 | 32 | 54 | 27 | 27 | null | null |
parapluu/encore | src/opt/Optimizer/Optimizer.hs | bsd-3-clause | -- Note that this is not intended as a serious optimization, but
-- as an example to how an optimization could be made. As soon as
-- there is a serious optimization in place, please remove this
-- function.
constantFolding :: Expr -> Expr
constantFolding = extend foldConst
where
foldConst (Binop {emeta = met... | 733 | constantFolding :: Expr -> Expr
constantFolding = extend foldConst
where
foldConst (Binop {emeta = meta, binop = PLUS,
loper = IntLiteral{intLit = m},
roper = IntLiteral{intLit = n}}) =
IntLiteral{emeta = meta, intLit = m + n}
foldConst e = e
--... | 525 | constantFolding = extend foldConst
where
foldConst (Binop {emeta = meta, binop = PLUS,
loper = IntLiteral{intLit = m},
roper = IntLiteral{intLit = n}}) =
IntLiteral{emeta = meta, intLit = m + n}
foldConst e = e
-- Desugars a == b when a : Just[t... | 493 | true | true | 0 | 14 | 235 | 111 | 67 | 44 | null | null |
ndmitchell/cmdargs | System/Console/CmdArgs/Annotate.hs | bsd-3-clause | add f = change $ \x -> Left $ x . f | 35 | add f = change $ \x -> Left $ x . f | 35 | add f = change $ \x -> Left $ x . f | 35 | false | false | 3 | 7 | 11 | 31 | 13 | 18 | null | null |
PipocaQuemada/ermine | src/Ermine/Syntax/Type.hs | bsd-2-clause | forall :: (Ord k, Ord t)
=> (k -> Hint) -> (t -> Hint) -> [k] -> [(t, Kind k)] -> Type k t -> Type k t
-> Type k t
-- This case is fairly inefficient. Also ugly. The former probably won't matter, but it'd
-- be nice to fix the latter. Not mangling the structure of the terms would, I believe,
-- be quite c... | 704 | forall :: (Ord k, Ord t)
=> (k -> Hint) -> (t -> Hint) -> [k] -> [(t, Kind k)] -> Type k t -> Type k t
-> Type k t
forall kh th ks tks cs (Forall n tls ds b) =
bimap unbound unbound $
forall kh' th' ks' tks' (mergeConstraints cs' $ fromScope ds) (fromScope b)
where
kh' = unvar (n!!) kh
th' = unva... | 493 | forall kh th ks tks cs (Forall n tls ds b) =
bimap unbound unbound $
forall kh' th' ks' tks' (mergeConstraints cs' $ fromScope ds) (fromScope b)
where
kh' = unvar (n!!) kh
th' = unvar (fst . (tls!!)) th
cs' = bimap F F cs
ks' = map F ks ++ zipWith (const . B) [0..] n
tks' = map (bimap F $ fmap F) tks ++ ima... | 364 | true | true | 11 | 15 | 174 | 337 | 156 | 181 | null | null |
authchir/SoSe17-FFP-haskell-http2-server | src/Frame.hs | gpl-3.0 | putType TRstStream = Put.putWord8 0x3 | 40 | putType TRstStream = Put.putWord8 0x3 | 40 | putType TRstStream = Put.putWord8 0x3 | 40 | false | false | 0 | 6 | 7 | 14 | 6 | 8 | null | null |
kolmodin/spdy | example/app.hs | bsd-3-clause | mergedRun port app = do
let spdyPort = show (read port + 1)
forkIO $ Hope.run spdyPort app
Warp.run (read port) (advertiseSPDY spdyPort app)
return () | 158 | mergedRun port app = do
let spdyPort = show (read port + 1)
forkIO $ Hope.run spdyPort app
Warp.run (read port) (advertiseSPDY spdyPort app)
return () | 158 | mergedRun port app = do
let spdyPort = show (read port + 1)
forkIO $ Hope.run spdyPort app
Warp.run (read port) (advertiseSPDY spdyPort app)
return () | 158 | false | false | 0 | 13 | 33 | 79 | 35 | 44 | null | null |
marcmo/hsDiagnosis | src/Diag/Config.hs | bsd-3-clause | -- :: IO (Maybe Word8)
defaultSource = defaultConfig >>= lookupSource :: IO (Maybe Word8) | 90 | defaultSource = defaultConfig >>= lookupSource :: IO (Maybe Word8) | 67 | defaultSource = defaultConfig >>= lookupSource :: IO (Maybe Word8) | 67 | true | false | 0 | 7 | 14 | 26 | 13 | 13 | null | null |
agremm/Matryoshka | Data/Array/Matryoshka/TaskDeque.hs | bsd-3-clause | bottom :: TaskDeque a -> Maybe (TaskDeque a, a)
bottom td | emptyTD td = Nothing
| otherwise = extract $ S.viewl td
where
extract (e S.:< s) = Just (s, e)
extract S.EmptyL = Nothing | 231 | bottom :: TaskDeque a -> Maybe (TaskDeque a, a)
bottom td | emptyTD td = Nothing
| otherwise = extract $ S.viewl td
where
extract (e S.:< s) = Just (s, e)
extract S.EmptyL = Nothing | 231 | bottom td | emptyTD td = Nothing
| otherwise = extract $ S.viewl td
where
extract (e S.:< s) = Just (s, e)
extract S.EmptyL = Nothing | 183 | false | true | 0 | 9 | 85 | 98 | 47 | 51 | null | null |
facebookarchive/lex-pass | src/Lang/Php/Ast/ArgList.hs | bsd-3-clause | -- todo: this can just be separate right?
-- e.g. ($a) in exit($a) or () in exit()
exitListParser :: Parser (a, WS) -> Parser (Either WS (WSCap a))
exitListParser = fmap (fmap (fromRight . head)) .
genArgListParser False False True False | 239 | exitListParser :: Parser (a, WS) -> Parser (Either WS (WSCap a))
exitListParser = fmap (fmap (fromRight . head)) .
genArgListParser False False True False | 156 | exitListParser = fmap (fmap (fromRight . head)) .
genArgListParser False False True False | 91 | true | true | 0 | 10 | 42 | 72 | 37 | 35 | null | null |
d12frosted/hakyll | src/Hakyll/Core/Compiler.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- | Get the full contents of the matched source file as a string.
getResourceString :: Compiler (Item String)
getResourceString = getResourceWith resourceString | 242 | getResourceString :: Compiler (Item String)
getResourceString = getResourceWith resourceString | 94 | getResourceString = getResourceWith resourceString | 50 | true | true | 0 | 7 | 23 | 25 | 13 | 12 | null | null |
tpsinnem/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | -- | Show a term with specific options
showTmOpts :: PPOption -> PTerm -> String
showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 160 | showTmOpts :: PPOption -> PTerm -> String
showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 121 | showTmOpts opt = flip (displayS . renderPretty 1.0 10000000 . prettyImp opt) "" | 79 | true | true | 0 | 9 | 27 | 47 | 23 | 24 | null | null |
grnet/snf-ganeti | src/Ganeti/Constants.hs | bsd-2-clause | -- * 'autoconf' constants for QA cluster only ('qa/qa_cluster.py')
versionedsharedir :: String
versionedsharedir = AutoConf.versionedsharedir | 142 | versionedsharedir :: String
versionedsharedir = AutoConf.versionedsharedir | 74 | versionedsharedir = AutoConf.versionedsharedir | 46 | true | true | 0 | 6 | 15 | 21 | 9 | 12 | null | null |
izimbra/PLT2014 | Lab2/TypeChecker.hs | gpl-2.0 | inferFunHelper env [] types = fail "too few args in function call" | 72 | inferFunHelper env [] types = fail "too few args in function call" | 72 | inferFunHelper env [] types = fail "too few args in function call" | 72 | false | false | 1 | 5 | 17 | 24 | 8 | 16 | null | null |
elieux/ghc | compiler/main/HscTypes.hs | bsd-3-clause | lookupHptByModule :: HomePackageTable -> Module -> Maybe HomeModInfo
-- The HPT is indexed by ModuleName, not Module,
-- we must check for a hit on the right Module
lookupHptByModule hpt mod
= case lookupUFM hpt (moduleName mod) of
Just hm | mi_module (hm_iface hm) == mod -> Just hm
_otherwise ... | 411 | lookupHptByModule :: HomePackageTable -> Module -> Maybe HomeModInfo
lookupHptByModule hpt mod
= case lookupUFM hpt (moduleName mod) of
Just hm | mi_module (hm_iface hm) == mod -> Just hm
_otherwise -> Nothing
-- | Information about modules in the package being compiled | 315 | lookupHptByModule hpt mod
= case lookupUFM hpt (moduleName mod) of
Just hm | mi_module (hm_iface hm) == mod -> Just hm
_otherwise -> Nothing
-- | Information about modules in the package being compiled | 246 | true | true | 0 | 14 | 106 | 82 | 39 | 43 | null | null |
Tener/HaNS | src/Hans/Message/Dhcp4Codec.hs | bsd-3-clause | subnetMaskToWord32 :: SubnetMask -> Word32
subnetMaskToWord32 (SubnetMask n) = computeMask n | 92 | subnetMaskToWord32 :: SubnetMask -> Word32
subnetMaskToWord32 (SubnetMask n) = computeMask n | 92 | subnetMaskToWord32 (SubnetMask n) = computeMask n | 49 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
copumpkin/vector-static | Data/Vector/Storable/Static.hs | bsd-3-clause | foldr1' :: V.Storable a => (a -> a -> a) -> Vec (S n) a -> a
foldr1' f (Vec vs) = G.foldr1' f vs | 96 | foldr1' :: V.Storable a => (a -> a -> a) -> Vec (S n) a -> a
foldr1' f (Vec vs) = G.foldr1' f vs | 96 | foldr1' f (Vec vs) = G.foldr1' f vs | 35 | false | true | 0 | 10 | 24 | 73 | 34 | 39 | null | null |
abailly/hsgames | game-server/src/GameServer/Clients/Player.hs | apache-2.0 | handleCommand msg InOut{output} = do
output msg
pure Nothing | 64 | handleCommand msg InOut{output} = do
output msg
pure Nothing | 64 | handleCommand msg InOut{output} = do
output msg
pure Nothing | 64 | false | false | 0 | 7 | 12 | 29 | 12 | 17 | null | null |
twittner/redis-resp | src/Data/Redis/Command.hs | mpl-2.0 | -----------------------------------------------------------------------------
-- Server
bgrewriteaof :: Monad m => Redis m ()
bgrewriteaof = singleton $ BgRewriteAOF $ cmd 1 ["BGREWRITEAOF"] | 191 | bgrewriteaof :: Monad m => Redis m ()
bgrewriteaof = singleton $ BgRewriteAOF $ cmd 1 ["BGREWRITEAOF"] | 102 | bgrewriteaof = singleton $ BgRewriteAOF $ cmd 1 ["BGREWRITEAOF"] | 64 | true | true | 0 | 7 | 20 | 43 | 22 | 21 | null | null |
hy-zhang/parser | experimental/Lib.hs | bsd-3-clause | myCast :: (Typeable a, Typeable b) => Parser (Fix fs a) -> Parser (Fix fs b) -> Maybe (Parser (Fix fs a))
myCast x y = help x (myGCast y)
where
myGCast :: forall fs a1 b1 c1. (Typeable a1, Typeable b1) => Parser (Fix fs a1) -> Maybe (Parser (Fix fs b1))
myGCast x = fmap (\Refl -> x) (eqT :: Maybe (a1 :~: b1))... | 373 | myCast :: (Typeable a, Typeable b) => Parser (Fix fs a) -> Parser (Fix fs b) -> Maybe (Parser (Fix fs a))
myCast x y = help x (myGCast y)
where
myGCast :: forall fs a1 b1 c1. (Typeable a1, Typeable b1) => Parser (Fix fs a1) -> Maybe (Parser (Fix fs b1))
myGCast x = fmap (\Refl -> x) (eqT :: Maybe (a1 :~: b1))... | 373 | myCast x y = help x (myGCast y)
where
myGCast :: forall fs a1 b1 c1. (Typeable a1, Typeable b1) => Parser (Fix fs a1) -> Maybe (Parser (Fix fs b1))
myGCast x = fmap (\Refl -> x) (eqT :: Maybe (a1 :~: b1))
help :: e -> Maybe e -> Maybe e
help x y = y | 267 | false | true | 0 | 13 | 97 | 233 | 113 | 120 | null | null |
green-haskell/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | recordMallocBc :: Ptr a -> BcM ()
recordMallocBc a
= BcM $ \st -> return (st{malloced = Right (castPtr a) : malloced st}, ()) | 127 | recordMallocBc :: Ptr a -> BcM ()
recordMallocBc a
= BcM $ \st -> return (st{malloced = Right (castPtr a) : malloced st}, ()) | 127 | recordMallocBc a
= BcM $ \st -> return (st{malloced = Right (castPtr a) : malloced st}, ()) | 93 | false | true | 0 | 14 | 25 | 70 | 35 | 35 | null | null |
minad/console-style | src/System/Console/Style.hs | mit | sgrCode t old new
| old == new = ""
| new == defaultStyleState = csi 'm' []
| otherwise = csi 'm' $
flag styleBlink 5 ++
flag styleBold 1 ++
flag styleItalic 3 ++
flag styleUnder 4 ++
flag styleInvert 7 ++
color styleFg 0 ++
color styleBg 10
where
up... | 586 | sgrCode t old new
| old == new = ""
| new == defaultStyleState = csi 'm' []
| otherwise = csi 'm' $
flag styleBlink 5 ++
flag styleBold 1 ++
flag styleItalic 3 ++
flag styleUnder 4 ++
flag styleInvert 7 ++
color styleFg 0 ++
color styleBg 10
where
up... | 586 | sgrCode t old new
| old == new = ""
| new == defaultStyleState = csi 'm' []
| otherwise = csi 'm' $
flag styleBlink 5 ++
flag styleBold 1 ++
flag styleItalic 3 ++
flag styleUnder 4 ++
flag styleInvert 7 ++
color styleFg 0 ++
color styleBg 10
where
up... | 586 | false | false | 2 | 13 | 195 | 303 | 145 | 158 | null | null |
wavewave/lhc-analysis-collection | heavyhiggs/combine2.hs | gpl-3.0 | brief (x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10) = (integerize x1,integerize x2,integerize x3,integerize x4,integerize x5,x6,y7,y8,y9,y10) | 146 | brief (x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10) = (integerize x1,integerize x2,integerize x3,integerize x4,integerize x5,x6,y7,y8,y9,y10) | 146 | brief (x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6,y7,y8,y9,y10) = (integerize x1,integerize x2,integerize x3,integerize x4,integerize x5,x6,y7,y8,y9,y10) | 146 | false | false | 0 | 6 | 8 | 103 | 61 | 42 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/HTools/Backend/Text.hs | gpl-2.0 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | loadNode _ s = fail $ "Invalid/incomplete node data: '" ++ show s ++ "'" | 72 | false | false | 0 | 7 | 14 | 26 | 12 | 14 | null | null |
ItsLastDay/academic_university_2016-2018 | subjects/Haskell/coursework_tests.hs | gpl-3.0 | fac' = Lam "n" $ app3 rec n fac'step one | 40 | fac' = Lam "n" $ app3 rec n fac'step one | 40 | fac' = Lam "n" $ app3 rec n fac'step one | 40 | false | false | 1 | 6 | 9 | 25 | 10 | 15 | null | null |
michaelt/series | Series/FreeT/Prelude.hs | bsd-3-clause | -- ---------------
-- take
-- ---------------
take :: (Monad m, Functor f) => Int -> FreeT f m r -> FreeT f m ()
take n = buildFreeT . F.take n . foldFreeT | 157 | take :: (Monad m, Functor f) => Int -> FreeT f m r -> FreeT f m ()
take n = buildFreeT . F.take n . foldFreeT | 109 | take n = buildFreeT . F.take n . foldFreeT | 42 | true | true | 1 | 10 | 34 | 75 | 36 | 39 | null | null |
chwthewke/hackup | testsuite/Hackup/SelectorsTest.hs | mit | testGlob :: String -> Layout -> [FilePath] -> IO ()
testGlob = testSelector Glob | 80 | testGlob :: String -> Layout -> [FilePath] -> IO ()
testGlob = testSelector Glob | 80 | testGlob = testSelector Glob | 28 | false | true | 0 | 9 | 13 | 34 | 17 | 17 | null | null |
brownplt/ovid | src/Data/InductiveGraph/ListImpl.hs | bsd-2-clause | reverseEdges graph@(InductiveGraph a vxTop toVx fromVx inner) =
let -- vxTop is the outermost vertex. When the graph is reversed, it will become the innermost vertex with
-- nodeIx = 0.
transVx (Node ix) = Node (nodeIx vxTop - ix)
transVxs = map transVx
-- partitions the edge list, selecting... | 1,252 | reverseEdges graph@(InductiveGraph a vxTop toVx fromVx inner) =
let -- vxTop is the outermost vertex. When the graph is reversed, it will become the innermost vertex with
-- nodeIx = 0.
transVx (Node ix) = Node (nodeIx vxTop - ix)
transVxs = map transVx
-- partitions the edge list, selecting... | 1,252 | reverseEdges graph@(InductiveGraph a vxTop toVx fromVx inner) =
let -- vxTop is the outermost vertex. When the graph is reversed, it will become the innermost vertex with
-- nodeIx = 0.
transVx (Node ix) = Node (nodeIx vxTop - ix)
transVxs = map transVx
-- partitions the edge list, selecting... | 1,252 | false | false | 0 | 15 | 325 | 417 | 214 | 203 | null | null |
jwiegley/hnix | src/Nix/Eval.hs | bsd-3-clause | eval (NHasAttr aset attr) = evalSelect aset attr >>= toValue . isRight | 70 | eval (NHasAttr aset attr) = evalSelect aset attr >>= toValue . isRight | 70 | eval (NHasAttr aset attr) = evalSelect aset attr >>= toValue . isRight | 70 | false | false | 0 | 7 | 11 | 31 | 14 | 17 | null | null |
cnc-patch/disass | src/Language/Assembly/X86/Parse.hs | bsd-3-clause | parsePADDB :: (Stream s m Word8, Monad m) => t -> ParsecT s PState m Instr
parsePADDB = parseMmxXmmPQVW PADDB | 109 | parsePADDB :: (Stream s m Word8, Monad m) => t -> ParsecT s PState m Instr
parsePADDB = parseMmxXmmPQVW PADDB | 109 | parsePADDB = parseMmxXmmPQVW PADDB | 34 | false | true | 0 | 7 | 19 | 46 | 23 | 23 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/C2HS/Gen/Header.hs | mit | ghFrag (frag@(CHSVerb _ _ ) : frags) =
return (DL.empty, Frag frag, frags) | 78 | ghFrag (frag@(CHSVerb _ _ ) : frags) =
return (DL.empty, Frag frag, frags) | 78 | ghFrag (frag@(CHSVerb _ _ ) : frags) =
return (DL.empty, Frag frag, frags) | 78 | false | false | 0 | 9 | 16 | 45 | 23 | 22 | null | null |
brendanhay/amazonka-limited | src/Network/AWS/Route53.hs | mpl-2.0 | path :: ByteString -> ByteString
path = mappend (svcVersion route53) . addPrefix "/" | 84 | path :: ByteString -> ByteString
path = mappend (svcVersion route53) . addPrefix "/" | 84 | path = mappend (svcVersion route53) . addPrefix "/" | 51 | false | true | 0 | 8 | 12 | 31 | 15 | 16 | null | null |
coinapi/coinapi-sdk | data-api/haskell-rest/CoinApi/Monadic.hs | mit | orderbooks_current_data :: MonadIO m => CoinApi m (Either String [Orderbook])
orderbooks_current_data = get >>= CA.orderbooks_current_data | 138 | orderbooks_current_data :: MonadIO m => CoinApi m (Either String [Orderbook])
orderbooks_current_data = get >>= CA.orderbooks_current_data | 138 | orderbooks_current_data = get >>= CA.orderbooks_current_data | 60 | false | true | 2 | 10 | 14 | 48 | 22 | 26 | null | null |
imalsogreg/scrollbuffer | tests/test.hs | gpl-3.0 | prop_last_n :: ScrollBuffer (ScrollBuffer Double) -> Int -> Property
prop_last_n sb@(ScrollBuffer s _) n =
n <= Seq.length s ==>
n ~~| sb == Seq.drop (Seq.length s - n) s
where
_ = sb :: ScrollBuffer (ScrollBuffer Double) | 236 | prop_last_n :: ScrollBuffer (ScrollBuffer Double) -> Int -> Property
prop_last_n sb@(ScrollBuffer s _) n =
n <= Seq.length s ==>
n ~~| sb == Seq.drop (Seq.length s - n) s
where
_ = sb :: ScrollBuffer (ScrollBuffer Double) | 236 | prop_last_n sb@(ScrollBuffer s _) n =
n <= Seq.length s ==>
n ~~| sb == Seq.drop (Seq.length s - n) s
where
_ = sb :: ScrollBuffer (ScrollBuffer Double) | 167 | false | true | 4 | 10 | 52 | 108 | 53 | 55 | null | null |
Lazersmoke/exploding-kittens | src/Game/Kittens/CardActions.hs | gpl-3.0 | drawCard :: Player -> KittenState -> IO KittenState
drawCard pla ks = do
consoleLog $ name pla ++ " drew a card from the deck"
let drawn = head . deck $ ks
let ks' = ks {deck = tail . deck $ ks}
tellPlayer (("Info|You Drew: " ++) . show $ drawn) pla
case drawn of
ExplodingKittenCard ->
if DefuseCar... | 474 | drawCard :: Player -> KittenState -> IO KittenState
drawCard pla ks = do
consoleLog $ name pla ++ " drew a card from the deck"
let drawn = head . deck $ ks
let ks' = ks {deck = tail . deck $ ks}
tellPlayer (("Info|You Drew: " ++) . show $ drawn) pla
case drawn of
ExplodingKittenCard ->
if DefuseCar... | 474 | drawCard pla ks = do
consoleLog $ name pla ++ " drew a card from the deck"
let drawn = head . deck $ ks
let ks' = ks {deck = tail . deck $ ks}
tellPlayer (("Info|You Drew: " ++) . show $ drawn) pla
case drawn of
ExplodingKittenCard ->
if DefuseCard `elem` hand pla
then defuseKitten pla ks'
... | 422 | false | true | 0 | 17 | 125 | 183 | 91 | 92 | null | null |
OS2World/DEV-UTIL-HUGS | libraries/Text/Html.hs | bsd-3-clause | variable :: Html -> Html
address = tag "ADDRESS" | 73 | variable :: Html -> Html
address = tag "ADDRESS" | 72 | address = tag "ADDRESS" | 36 | false | true | 0 | 5 | 33 | 18 | 9 | 9 | null | null |
christiaanb/Idris-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | ftyToTy (FArith ATFloat) = FloatingPointType 64 IEEE | 52 | ftyToTy (FArith ATFloat) = FloatingPointType 64 IEEE | 52 | ftyToTy (FArith ATFloat) = FloatingPointType 64 IEEE | 52 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
green-haskell/ghc | compiler/utils/Util.hs | bsd-3-clause | mapAndUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])
mapAndUnzip _ [] = ([], []) | 78 | mapAndUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])
mapAndUnzip _ [] = ([], []) | 77 | mapAndUnzip _ [] = ([], []) | 27 | false | true | 0 | 8 | 17 | 64 | 37 | 27 | null | null |
alanz/xtc | Graphics/UI/XTC.hs | bsd-3-clause | mkRadioView :: Labeled x => Window a -> Orientation -> [x] -> [Prop (RadioView x ())] -> IO (RadioView x ())
mkRadioView window orientation viewItems props =
mkRadioViewEx window toLabel orientation viewItems props | 216 | mkRadioView :: Labeled x => Window a -> Orientation -> [x] -> [Prop (RadioView x ())] -> IO (RadioView x ())
mkRadioView window orientation viewItems props =
mkRadioViewEx window toLabel orientation viewItems props | 216 | mkRadioView window orientation viewItems props =
mkRadioViewEx window toLabel orientation viewItems props | 107 | false | true | 0 | 14 | 34 | 89 | 43 | 46 | null | null |
keera-studios/pang-a-lambda | src/Physics/CollisionEngine.hs | gpl-3.0 | -- | Return the new velocity as changed by the collection of collisions.
--
-- HN 2014-09-07: New interface to collision detection.
--
-- The assumption is that collision detection happens globally and that the
-- changed velocity is figured out for each object involved in a collision
-- based on the properties of all ... | 1,593 | changedVelocity :: Eq n => n -> Collisions n -> Maybe Vel2D
changedVelocity name cs =
case concatMap (filter ((== name) . fst) . collisionData) cs of
[] -> Nothing
(_, v') : _ -> Just v'
-- vs -> Just (foldl (^+^) (0,0) (map snd vs))
-- | True if the velocity of the object has been changed... | 338 | changedVelocity name cs =
case concatMap (filter ((== name) . fst) . collisionData) cs of
[] -> Nothing
(_, v') : _ -> Just v'
-- vs -> Just (foldl (^+^) (0,0) (map snd vs))
-- | True if the velocity of the object has been changed by any collision. | 278 | true | true | 0 | 12 | 320 | 122 | 75 | 47 | null | null |
ekmett/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | getCmmReg :: CmmReg -> LlvmM LlvmVar
getCmmReg (CmmLocal (LocalReg un _))
= do exists <- varLookup un
dflags <- getDynFlags
case exists of
Just ety -> return (LMLocalVar un $ pLift ety)
Nothing -> fail $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr un) ++ " was not allocated!"
... | 513 | getCmmReg :: CmmReg -> LlvmM LlvmVar
getCmmReg (CmmLocal (LocalReg un _))
= do exists <- varLookup un
dflags <- getDynFlags
case exists of
Just ety -> return (LMLocalVar un $ pLift ety)
Nothing -> fail $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr un) ++ " was not allocated!"
... | 513 | getCmmReg (CmmLocal (LocalReg un _))
= do exists <- varLookup un
dflags <- getDynFlags
case exists of
Just ety -> return (LMLocalVar un $ pLift ety)
Nothing -> fail $ "getCmmReg: Cmm register " ++ showSDoc dflags (ppr un) ++ " was not allocated!"
-- This should never happen... | 476 | false | true | 0 | 14 | 145 | 116 | 55 | 61 | null | null |
kyren/hsgb | lib/Gameboy/Instructions.hs | unlicense | encodeInstruction (SUB_R HRegister) = [0x94] | 44 | encodeInstruction (SUB_R HRegister) = [0x94] | 44 | encodeInstruction (SUB_R HRegister) = [0x94] | 44 | false | false | 0 | 6 | 4 | 19 | 9 | 10 | null | null |
alexander-at-github/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | primOpOutOfLine CloneSmallMutableArrayOp = True | 47 | primOpOutOfLine CloneSmallMutableArrayOp = True | 47 | primOpOutOfLine CloneSmallMutableArrayOp = True | 47 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
trskop/hs-not-found | not-found/src/Control/Monad/Utils.hs | bsd-3-clause | -- | Shorthand for @f '>.>' flip g@.
(>^>) :: Monad m => (a -> m b) -> (b -> a -> m c) -> a -> m c
f >^> g = f >.> flip g | 121 | (>^>) :: Monad m => (a -> m b) -> (b -> a -> m c) -> a -> m c
f >^> g = f >.> flip g | 84 | f >^> g = f >.> flip g | 22 | true | true | 0 | 12 | 36 | 73 | 36 | 37 | null | null |
mwahab1/pandoc | src/Text/Pandoc/Writers/Textile.hs | gpl-2.0 | blockToTextile opts (Header level (ident,classes,keyvals) inlines) = do
contents <- inlineListToTextile opts inlines
let identAttr = if null ident then "" else ('#':ident)
let attribs = if null identAttr && null classes
then ""
else "(" ++ unwords classes ++ identAttr ++ ")"
... | 569 | blockToTextile opts (Header level (ident,classes,keyvals) inlines) = do
contents <- inlineListToTextile opts inlines
let identAttr = if null ident then "" else ('#':ident)
let attribs = if null identAttr && null classes
then ""
else "(" ++ unwords classes ++ identAttr ++ ")"
... | 569 | blockToTextile opts (Header level (ident,classes,keyvals) inlines) = do
contents <- inlineListToTextile opts inlines
let identAttr = if null ident then "" else ('#':ident)
let attribs = if null identAttr && null classes
then ""
else "(" ++ unwords classes ++ identAttr ++ ")"
... | 569 | false | false | 0 | 15 | 149 | 238 | 115 | 123 | null | null |
glguy/ssh-hans | src/Network/SSH/Rekey.hs | bsd-3-clause | ----------------------------------------------------------------
-- Key exchange is described in RFC 4253 sections 7 through 9
-- | Initial entry point into the rekeying logic. This version
-- sends a proposal and waits for the response.
initialKeyExchange :: HandleLike -> SshState -> IO ()
initialKeyExchange h state ... | 641 | initialKeyExchange :: HandleLike -> SshState -> IO ()
initialKeyExchange h state =
do i_us <- mkProposal (sshProposalPrefs state)
sendProposal h state i_us
SshMsgKexInit i_them <- receive h state
rekeyConnection h state i_us i_them
-- | Subsequent entry point into the rekeying logic. This version
-- i... | 402 | initialKeyExchange h state =
do i_us <- mkProposal (sshProposalPrefs state)
sendProposal h state i_us
SshMsgKexInit i_them <- receive h state
rekeyConnection h state i_us i_them
-- | Subsequent entry point into the rekeying logic. This version
-- is called when a proposal has already been received and... | 348 | true | true | 0 | 10 | 111 | 89 | 43 | 46 | null | null |
mpickering/hlint | src/HSE/Util.hs | bsd-3-clause | isPatTypeSig _ = False | 22 | isPatTypeSig _ = False | 22 | isPatTypeSig _ = False | 22 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
hargettp/courier | src/Control/Concurrent/Mailbox.hs | mit | tryFindMailbox :: Mailbox m -> (m -> Maybe v) -> STM (Maybe v)
tryFindMailbox (Mailbox _read write) testFn = do
readMessages <- readTVar _read
case find testFn readMessages of
Just msg -> do
return $ Just msg
Nothing -> do
writeMessages <- readTVar write
case ... | 541 | tryFindMailbox :: Mailbox m -> (m -> Maybe v) -> STM (Maybe v)
tryFindMailbox (Mailbox _read write) testFn = do
readMessages <- readTVar _read
case find testFn readMessages of
Just msg -> do
return $ Just msg
Nothing -> do
writeMessages <- readTVar write
case ... | 541 | tryFindMailbox (Mailbox _read write) testFn = do
readMessages <- readTVar _read
case find testFn readMessages of
Just msg -> do
return $ Just msg
Nothing -> do
writeMessages <- readTVar write
case find testFn writeMessages of
Just msg -> do
... | 478 | false | true | 0 | 18 | 191 | 152 | 68 | 84 | null | null |
nushio3/Paraiso | attic/Unicode/ByteString.hs | bsd-3-clause | main :: IO ()
main = do
putStrLn $ BS.intercalate punkt greetings | 67 | main :: IO ()
main = do
putStrLn $ BS.intercalate punkt greetings | 67 | main = do
putStrLn $ BS.intercalate punkt greetings | 53 | false | true | 0 | 9 | 13 | 30 | 14 | 16 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT34.hs | gpl-3.0 | even (S (S x)) = even x | 23 | even (S (S x)) = even x | 23 | even (S (S x)) = even x | 23 | false | false | 0 | 8 | 6 | 25 | 11 | 14 | null | null |
jwiegley/ghc-release | libraries/Cabal/cabal/Distribution/Simple/NHC.hs | gpl-3.0 | nhcLanguages :: [(Language, Flag)]
nhcLanguages = [(Haskell98, "-98")] | 70 | nhcLanguages :: [(Language, Flag)]
nhcLanguages = [(Haskell98, "-98")] | 70 | nhcLanguages = [(Haskell98, "-98")] | 35 | false | true | 0 | 8 | 7 | 36 | 19 | 17 | null | null |
brendanhay/gogol | gogol-accesscontextmanager/gen/Network/Google/Resource/AccessContextManager/AccessPolicies/Patch.hs | mpl-2.0 | -- | Multipart request metadata.
appPayload :: Lens' AccessPoliciesPatch AccessPolicy
appPayload
= lens _appPayload (\ s a -> s{_appPayload = a}) | 147 | appPayload :: Lens' AccessPoliciesPatch AccessPolicy
appPayload
= lens _appPayload (\ s a -> s{_appPayload = a}) | 114 | appPayload
= lens _appPayload (\ s a -> s{_appPayload = a}) | 61 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/SkewHeap.hs | bsd-3-clause | -- the remaining functions all use default definitions
fromSeq :: (Ord a,S.Sequence seq) => seq a -> Heap a
fromSeq = fromSeqUsingUnionSeq | 139 | fromSeq :: (Ord a,S.Sequence seq) => seq a -> Heap a
fromSeq = fromSeqUsingUnionSeq | 83 | fromSeq = fromSeqUsingUnionSeq | 30 | true | true | 0 | 8 | 22 | 45 | 21 | 24 | null | null |
paolino/hgen | Tester.hs | bsd-2-clause | stringPops :: (HasNote [Char] l) => [l]
stringPops = map note ["pippo","io","te","noi","voi","tutti","qualcuno"] | 112 | stringPops :: (HasNote [Char] l) => [l]
stringPops = map note ["pippo","io","te","noi","voi","tutti","qualcuno"] | 112 | stringPops = map note ["pippo","io","te","noi","voi","tutti","qualcuno"] | 72 | false | true | 0 | 7 | 11 | 54 | 32 | 22 | null | null |
michalt/cvector | Data/CVector/Unboxed.hs | bsd-3-clause | scanl1 :: (Unbox a) => (a -> a -> a) -> CVector a -> CVector a
scanl1 = G.scanl1 | 80 | scanl1 :: (Unbox a) => (a -> a -> a) -> CVector a -> CVector a
scanl1 = G.scanl1 | 80 | scanl1 = G.scanl1 | 17 | false | true | 0 | 9 | 18 | 47 | 24 | 23 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/rem_1.hs | mit | primGEqNatS Zero (Succ x) = MyFalse | 35 | primGEqNatS Zero (Succ x) = MyFalse | 35 | primGEqNatS Zero (Succ x) = MyFalse | 35 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
msullivan/advent-of-code | 2018/A19a.hs | mit | ireadOut :: String -> [Int]
ireadOut = readOut | 46 | ireadOut :: String -> [Int]
ireadOut = readOut | 46 | ireadOut = readOut | 18 | false | true | 0 | 8 | 7 | 25 | 11 | 14 | null | null |
sergv/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | snoc s x = s ++ singleton x | 27 | snoc s x = s ++ singleton x | 27 | snoc s x = s ++ singleton x | 27 | false | false | 3 | 5 | 7 | 23 | 8 | 15 | null | null |
GaloisInc/halvm-ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- KnownNat: see Note [KnowNat & KnownSymbol and EvLit] in TcEvidence
knownNatClassNameKey :: Unique
knownNatClassNameKey = mkPreludeClassUnique 42 | 147 | knownNatClassNameKey :: Unique
knownNatClassNameKey = mkPreludeClassUnique 42 | 77 | knownNatClassNameKey = mkPreludeClassUnique 42 | 46 | true | true | 0 | 6 | 17 | 21 | 9 | 12 | null | null |
keera-studios/hsQt | Qtc/Gui/QTextEdit.hs | bsd-2-clause | setLineWrapColumnOrWidth :: QTextEdit a -> ((Int)) -> IO ()
setLineWrapColumnOrWidth x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextEdit_setLineWrapColumnOrWidth cobj_x0 (toCInt x1) | 190 | setLineWrapColumnOrWidth :: QTextEdit a -> ((Int)) -> IO ()
setLineWrapColumnOrWidth x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextEdit_setLineWrapColumnOrWidth cobj_x0 (toCInt x1) | 190 | setLineWrapColumnOrWidth x0 (x1)
= withObjectPtr x0 $ \cobj_x0 ->
qtc_QTextEdit_setLineWrapColumnOrWidth cobj_x0 (toCInt x1) | 130 | false | true | 0 | 9 | 27 | 64 | 32 | 32 | null | null |
oldmanmike/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getRegOrMem e = do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 87 | getRegOrMem e = do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 87 | getRegOrMem e = do
(reg, code) <- getNonClobberedReg e
return (OpReg reg, code) | 87 | false | false | 1 | 10 | 20 | 44 | 19 | 25 | null | null |
AndrewRademacher/sql-driver-race | src/Main.hs | mit | connStr :: ByteString
connStr = "host=localhost port=5432 user=postgres dbname=sql_driver_race" | 95 | connStr :: ByteString
connStr = "host=localhost port=5432 user=postgres dbname=sql_driver_race" | 95 | connStr = "host=localhost port=5432 user=postgres dbname=sql_driver_race" | 73 | false | true | 0 | 6 | 8 | 18 | 7 | 11 | null | null |
GetShopTV/swagger2 | src/Data/Swagger/Internal/Schema/Validation.hs | bsd-3-clause | -- | Validate JSON @'Value'@ with Swagger @'Schema'@.
validateWithSchema :: Value -> Validation Schema ()
validateWithSchema value = do
validateSchemaType value
sub_ paramSchema $ validateEnum value
-- | Validate JSON @'Value'@ with Swagger @'ParamSchema'@. | 262 | validateWithSchema :: Value -> Validation Schema ()
validateWithSchema value = do
validateSchemaType value
sub_ paramSchema $ validateEnum value
-- | Validate JSON @'Value'@ with Swagger @'ParamSchema'@. | 208 | validateWithSchema value = do
validateSchemaType value
sub_ paramSchema $ validateEnum value
-- | Validate JSON @'Value'@ with Swagger @'ParamSchema'@. | 156 | true | true | 0 | 9 | 38 | 51 | 22 | 29 | null | null |
mboes/distributed-process | src/Control/Distributed/Process/Internal/Closure/TH.hs | bsd-3-clause | -- | If @f : T1 -> Process T2@ is a monomorphic function
-- then @$(functionTDict 'f) :: Static (SerializableDict T2)@.
--
-- Be sure to pass 'f' to 'remotable'.
functionTDict :: Name -> Q Exp
functionTDict = varE . tdictName | 225 | functionTDict :: Name -> Q Exp
functionTDict = varE . tdictName | 63 | functionTDict = varE . tdictName | 32 | true | true | 0 | 7 | 40 | 32 | 16 | 16 | null | null |
unclechu/xlib-keys-hack | src/Process.hs | gpl-3.0 | processKeyboardState :: CrossThreadVars -> Options -> Display -> IO ()
processKeyboardState ctVars opts dpy = do
xkbListenForKeyboardStateEvents dpy
XEvent.allocaXEvent $ \evPtr -> forever $ do
noise "Waiting for next X event about new keyboard layout state..."
nextEvent' dpy evPtr
_ <- XExtras.getEvent... | 807 | processKeyboardState :: CrossThreadVars -> Options -> Display -> IO ()
processKeyboardState ctVars opts dpy = do
xkbListenForKeyboardStateEvents dpy
XEvent.allocaXEvent $ \evPtr -> forever $ do
noise "Waiting for next X event about new keyboard layout state..."
nextEvent' dpy evPtr
_ <- XExtras.getEvent... | 807 | processKeyboardState ctVars opts dpy = do
xkbListenForKeyboardStateEvents dpy
XEvent.allocaXEvent $ \evPtr -> forever $ do
noise "Waiting for next X event about new keyboard layout state..."
nextEvent' dpy evPtr
_ <- XExtras.getEvent evPtr
(fromIntegral -> layoutNum) <- xkbGetCurrentLayout dpy
... | 736 | false | true | 4 | 21 | 170 | 235 | 111 | 124 | null | null |
matthiasgoergens/redgrep | src/Red.hs | bsd-3-clause | n (Cut a b) = n a && n b | 24 | n (Cut a b) = n a && n b | 24 | n (Cut a b) = n a && n b | 24 | false | false | 0 | 6 | 9 | 28 | 12 | 16 | null | null |
WSCU/JSEuterpea | Euterpea Examples/Basics.hs | gpl-3.0 | rumF = drums + drums + drums + (drums * drumCrash)
| 51 | drumF = drums + drums + drums + (drums * drumCrash) | 51 | drumF = drums + drums + drums + (drums * drumCrash) | 51 | false | false | 1 | 8 | 11 | 29 | 13 | 16 | null | null |
ezyang/ghc | compiler/codeGen/StgCmmMonad.hs | bsd-3-clause | {- Note [Virtual and real heap pointers]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code generator can allocate one or more objects contiguously, performing
one heap check to cover allocation of all the objects at once. Let's call
this little chunk of heap space an "allocation chunk". The code generator
will emit c... | 1,628 | initCgState :: UniqSupply -> CgState
initCgState uniqs
= MkCgState { cgs_stmts = mkNop
, cgs_tops = nilOL
, cgs_binds = emptyVarEnv
, cgs_hp_usg = initHpUsage
, cgs_uniqs = uniqs } | 243 | initCgState uniqs
= MkCgState { cgs_stmts = mkNop
, cgs_tops = nilOL
, cgs_binds = emptyVarEnv
, cgs_hp_usg = initHpUsage
, cgs_uniqs = uniqs } | 206 | true | true | 0 | 6 | 341 | 51 | 31 | 20 | null | null |
ssaavedra/liquidhaskell | docs/slides/BOS14/hs/start/05_Memory.hs | bsd-3-clause | {-@ unsafeDrop :: n:Nat
-> b:{v: ByteString | n <= (bLen v)}
-> {v:ByteString | (bLen v) = (bLen b) - n} @-}
unsafeDrop :: Int -> ByteString -> ByteString
unsafeDrop n (PS x s l) = liquidAssert (0 <= n && n <= l) $ PS x (s+n) (l-n) | 263 | unsafeDrop :: Int -> ByteString -> ByteString
unsafeDrop n (PS x s l) = liquidAssert (0 <= n && n <= l) $ PS x (s+n) (l-n) | 123 | unsafeDrop n (PS x s l) = liquidAssert (0 <= n && n <= l) $ PS x (s+n) (l-n) | 76 | true | true | 0 | 10 | 81 | 83 | 41 | 42 | null | null |
GaloisInc/ivory | ivory/src/Ivory/Language/Comment.hs | bsd-3-clause | comment :: String -> Ivory eff ()
comment c = emit (AST.Comment $ AST.UserComment c) | 84 | comment :: String -> Ivory eff ()
comment c = emit (AST.Comment $ AST.UserComment c) | 84 | comment c = emit (AST.Comment $ AST.UserComment c) | 50 | false | true | 0 | 9 | 14 | 42 | 20 | 22 | null | null |
fabianbergmark/APIs | src/TH/API/Input.hs | bsd-2-clause | generateToJSONClause :: Con -> Select -> Q Clause
generateToJSONClause con select = do
let infos = [i | (InputKey i) <- selectInputs select]
RecC conName fields = con
pair <- [| (.=) |]
let arg = mkName "x"
var = VarE arg
pat = AsP arg (RecP conName [])
list = map
(\((fie... | 1,131 | generateToJSONClause :: Con -> Select -> Q Clause
generateToJSONClause con select = do
let infos = [i | (InputKey i) <- selectInputs select]
RecC conName fields = con
pair <- [| (.=) |]
let arg = mkName "x"
var = VarE arg
pat = AsP arg (RecP conName [])
list = map
(\((fie... | 1,131 | generateToJSONClause con select = do
let infos = [i | (InputKey i) <- selectInputs select]
RecC conName fields = con
pair <- [| (.=) |]
let arg = mkName "x"
var = VarE arg
pat = AsP arg (RecP conName [])
list = map
(\((fieldName, _, _), info) -> do
let is... | 1,081 | false | true | 0 | 24 | 564 | 352 | 177 | 175 | null | null |
massysett/multiarg | tests/Multiarg/Maddash/Tests.hs | bsd-3-clause | pickOne :: [a] -> Gen a
pickOne ls
| null ls = error "pickOne: null list"
| otherwise = fmap (\ix -> ls !! ix) (choose (0, length ls - 1)) | 142 | pickOne :: [a] -> Gen a
pickOne ls
| null ls = error "pickOne: null list"
| otherwise = fmap (\ix -> ls !! ix) (choose (0, length ls - 1)) | 142 | pickOne ls
| null ls = error "pickOne: null list"
| otherwise = fmap (\ix -> ls !! ix) (choose (0, length ls - 1)) | 118 | false | true | 1 | 10 | 34 | 79 | 39 | 40 | null | null |
jboissard/GAHelloWorld | haskell/gahelloworld.hs | mit | -- Run the genetic algorithm
main = evalRandIO (randomPop defaultPop >>= iterateUntil done step . (, 0))
>>= result
where step (p,gen) = (,) <$> evolve p <*> pure (gen+1)
done ((_, g:_), generation) =
generation == maxGenerations || fitness g == 0
result ((_, g:_), generation)
... | 669 | main = evalRandIO (randomPop defaultPop >>= iterateUntil done step . (, 0))
>>= result
where step (p,gen) = (,) <$> evolve p <*> pure (gen+1)
done ((_, g:_), generation) =
generation == maxGenerations || fitness g == 0
result ((_, g:_), generation)
| generation == max... | 639 | main = evalRandIO (randomPop defaultPop >>= iterateUntil done step . (, 0))
>>= result
where step (p,gen) = (,) <$> evolve p <*> pure (gen+1)
done ((_, g:_), generation) =
generation == maxGenerations || fitness g == 0
result ((_, g:_), generation)
| generation == max... | 639 | true | false | 4 | 9 | 175 | 198 | 98 | 100 | null | null |
Nullreff/BF-JVM | src/Brainfuck/Optimizer.hs | gpl-3.0 | mergeTokens :: [BFToken] -> [BFToken]
mergeTokens [] = [] | 81 | mergeTokens :: [BFToken] -> [BFToken]
mergeTokens [] = [] | 81 | mergeTokens [] = [] | 43 | false | true | 0 | 6 | 32 | 32 | 16 | 16 | null | null |
lueck/htcf | src/HTCF/ConfigParser.hs | gpl-3.0 | -- | Get the namespace of the <MetaData> element of a TCF file. If
-- none is given in the config file, this defaults to
-- 'defaultTcfMetadataNamespace'.
getTcfMetadataNamespace :: [Config] -> String
getTcfMetadataNamespace [] = defaultTcfMetadataNamespace | 257 | getTcfMetadataNamespace :: [Config] -> String
getTcfMetadataNamespace [] = defaultTcfMetadataNamespace | 102 | getTcfMetadataNamespace [] = defaultTcfMetadataNamespace | 56 | true | true | 0 | 6 | 35 | 26 | 15 | 11 | null | null |
haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/ManagedProcess/Server.hs | bsd-3-clause | -- | Constructs an /action/ handler. Like 'handleDispatch' this can handle both
-- 'cast' and 'call' messages, but you won't know which you're dealing with.
-- This can be useful where certain inputs require a definite action, such as
-- stopping the server, without concern for the state (e.g., when stopping we
-- need... | 921 | action :: forall s a . (Serializable a)
=> (a -> (s -> Process (ProcessAction s)))
-- ^ a function from the input message to a /stateless action/, cf 'continue_'
-> Dispatcher s
action h = handleDispatch perform
where perform :: (s -> a -> Process (ProcessAction s))
perform s a = let f = h a... | 446 | action h = handleDispatch perform
where perform :: (s -> a -> Process (ProcessAction s))
perform s a = let f = h a in f s
-- | Constructs a handler for both /call/ and /cast/ messages.
-- @handleDispatch = handleDispatchIf (const True)@
-- | 250 | true | true | 0 | 15 | 185 | 140 | 73 | 67 | null | null |
jbracker/supermonad-plugin | examples/monad/hmtc/original/Scanner.hs | bsd-3-clause | isOpChr '<' = True | 19 | isOpChr '<' = True | 19 | isOpChr '<' = True | 19 | false | false | 0 | 4 | 4 | 10 | 4 | 6 | null | null |
aemxdp/playlistach | backend/Playlistach.hs | bsd-3-clause | readConf :: FilePath -> IO Conf
readConf path =
withFile path ReadMode $ \h -> do
Conf <$> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> fmap read (hGetLine h) | 237 | readConf :: FilePath -> IO Conf
readConf path =
withFile path ReadMode $ \h -> do
Conf <$> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> fmap read (hGetLine h) | 237 | readConf path =
withFile path ReadMode $ \h -> do
Conf <$> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> hGetLine h
<*> fmap read (hGetLine h) | 205 | false | true | 0 | 14 | 97 | 81 | 37 | 44 | null | null |
Heather/clay | src/Clay/Size.hs | bsd-3-clause | -- | Size in millimeters.
mm i = Size (value i <> "mm") | 55 | mm i = Size (value i <> "mm") | 29 | mm i = Size (value i <> "mm") | 29 | true | false | 0 | 8 | 12 | 23 | 11 | 12 | null | null |
Fuuzetsu/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | dot :: LaTeX
dot = char '.' | 27 | dot :: LaTeX
dot = char '.' | 27 | dot = char '.' | 14 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
kawu/tag-vanilla | src/NLP/TAG/Vanilla/Earley/AutoAP.hs | bsd-2-clause | -- | Priority of a passive item. Crucial for the algorithm --
-- states have to be removed from the queue in a specific order.
prioP :: Passive n t -> Prio
prioP p =
let i = getL (beg . spanP) p
j = getL (end . spanP) p
in (j, j - i) | 251 | prioP :: Passive n t -> Prio
prioP p =
let i = getL (beg . spanP) p
j = getL (end . spanP) p
in (j, j - i) | 123 | prioP p =
let i = getL (beg . spanP) p
j = getL (end . spanP) p
in (j, j - i) | 94 | true | true | 0 | 11 | 72 | 75 | 39 | 36 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.