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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
raventid/coursera_learning | haskell/stepik/4.5tree.hs | mit | height (Node subTree (Leaf _)) = 1 + height subTree | 51 | height (Node subTree (Leaf _)) = 1 + height subTree | 51 | height (Node subTree (Leaf _)) = 1 + height subTree | 51 | false | false | 0 | 8 | 9 | 31 | 14 | 17 | null | null |
qrilka/xlsx | src/Codec/Xlsx/Types/AutoFilter.hs | mit | filterCriterionToElement :: FilterCriterion -> Element
filterCriterionToElement (FilterValue v) =
leafElement (n_ "filter") ["val" .= v] | 138 | filterCriterionToElement :: FilterCriterion -> Element
filterCriterionToElement (FilterValue v) =
leafElement (n_ "filter") ["val" .= v] | 138 | filterCriterionToElement (FilterValue v) =
leafElement (n_ "filter") ["val" .= v] | 83 | false | true | 0 | 7 | 16 | 42 | 21 | 21 | null | null |
ghc-android/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes") | 52 | gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes") | 52 | gHC_CLASSES = mkPrimModule (fsLit "GHC.Classes") | 52 | false | false | 0 | 7 | 8 | 15 | 7 | 8 | null | null |
ekmett/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | labelType (CmmLabel _ _ CmmRetInfo) = DataLabel | 59 | false | false | 0 | 7 | 18 | 19 | 9 | 10 | null | null |
bravit/Idris-dev | src/Idris/Primitives.hs | bsd-3-clause | bsdiv _ _ = Nothing | 19 | bsdiv _ _ = Nothing | 19 | bsdiv _ _ = Nothing | 19 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
ojw/admin-and-dev | src/DB/Auth/AuthAction.hs | bsd-3-clause | getUserIdByEmailOrUserName :: (MonadIO m, MonadAuthAction m) => Text -> m UserId
getUserIdByEmailOrUserName text = do
lookupUserIdByEmailOrUserName text >>= maybe (throwError UserDoesNotExist) return | 203 | getUserIdByEmailOrUserName :: (MonadIO m, MonadAuthAction m) => Text -> m UserId
getUserIdByEmailOrUserName text = do
lookupUserIdByEmailOrUserName text >>= maybe (throwError UserDoesNotExist) return | 203 | getUserIdByEmailOrUserName text = do
lookupUserIdByEmailOrUserName text >>= maybe (throwError UserDoesNotExist) return | 122 | false | true | 0 | 10 | 25 | 57 | 27 | 30 | null | null |
BeautifulDestinations/fb | src/Facebook/Object/Marketing/AdAccount.hs | bsd-3-clause | unUserRole_ :: UserRole_ -> Text
unUserRole_ (UserRole_ x) = x | 62 | unUserRole_ :: UserRole_ -> Text
unUserRole_ (UserRole_ x) = x | 62 | unUserRole_ (UserRole_ x) = x | 29 | false | true | 0 | 9 | 9 | 30 | 13 | 17 | null | null |
girving/games | Util.hs | bsd-3-clause | (.=<) r e = e >=> return . r | 28 | (.=<) r e = e >=> return . r | 28 | (.=<) r e = e >=> return . r | 28 | false | false | 0 | 6 | 8 | 21 | 11 | 10 | null | null |
dillonhuff/DifferenceLogic | src/DifferenceLogic/Solver.hs | bsd-3-clause | negCycleFrom :: Node -> [Node] -> [LEdge Int] -> Bool
negCycleFrom source nodes edges = checkNegCycle edges weights
where
initialWeights = M.fromList $ L.zip nodes $ L.map (initWeight source) nodes
weights = computeWeights nodes edges M.empty initialWeights 0 | 269 | negCycleFrom :: Node -> [Node] -> [LEdge Int] -> Bool
negCycleFrom source nodes edges = checkNegCycle edges weights
where
initialWeights = M.fromList $ L.zip nodes $ L.map (initWeight source) nodes
weights = computeWeights nodes edges M.empty initialWeights 0 | 269 | negCycleFrom source nodes edges = checkNegCycle edges weights
where
initialWeights = M.fromList $ L.zip nodes $ L.map (initWeight source) nodes
weights = computeWeights nodes edges M.empty initialWeights 0 | 215 | false | true | 1 | 9 | 47 | 98 | 48 | 50 | null | null |
leshchevds/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pMasterNetmask :: Field
pMasterNetmask =
withDoc "Netmask of the master IP" .
optionalField $ simpleField "master_netmask" [t| NonNegative Int |] | 149 | pMasterNetmask :: Field
pMasterNetmask =
withDoc "Netmask of the master IP" .
optionalField $ simpleField "master_netmask" [t| NonNegative Int |] | 149 | pMasterNetmask =
withDoc "Netmask of the master IP" .
optionalField $ simpleField "master_netmask" [t| NonNegative Int |] | 125 | false | true | 2 | 6 | 23 | 38 | 18 | 20 | null | null |
pbl64k/HackerRank-Contests | 2014-10-10-FP/Infer/i.argh.hs | bsd-2-clause | add_t v = do
n <- add_t0
env <- get
let vt' = M.insert v n (vt env)
let env' = Env { vt = vt', vt_st = vt_st env, st = st env, ut = ut env, ut_st = ut_st env }
put env'
return n | 201 | add_t v = do
n <- add_t0
env <- get
let vt' = M.insert v n (vt env)
let env' = Env { vt = vt', vt_st = vt_st env, st = st env, ut = ut env, ut_st = ut_st env }
put env'
return n | 201 | add_t v = do
n <- add_t0
env <- get
let vt' = M.insert v n (vt env)
let env' = Env { vt = vt', vt_st = vt_st env, st = st env, ut = ut env, ut_st = ut_st env }
put env'
return n | 201 | false | false | 1 | 13 | 70 | 116 | 54 | 62 | null | null |
romanb/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/Types.hs | mpl-2.0 | -- | The location of the license key required to decrypt your HLS playlist. The
-- URL must be an absolute path, and is referenced in the URI attribute of the
-- EXT-X-KEY metadata tag in the playlist file.
hcpLicenseAcquisitionUrl :: Lens' HlsContentProtection (Maybe Text)
hcpLicenseAcquisitionUrl =
lens _hcpLicen... | 390 | hcpLicenseAcquisitionUrl :: Lens' HlsContentProtection (Maybe Text)
hcpLicenseAcquisitionUrl =
lens _hcpLicenseAcquisitionUrl
(\s a -> s { _hcpLicenseAcquisitionUrl = a }) | 183 | hcpLicenseAcquisitionUrl =
lens _hcpLicenseAcquisitionUrl
(\s a -> s { _hcpLicenseAcquisitionUrl = a }) | 115 | true | true | 0 | 8 | 69 | 49 | 27 | 22 | null | null |
jystic/sandwich-press | src/Network/Docker.hs | bsd-3-clause | build :: Dockerfile cs -> Docker Id
build dockerfile = do
response <- dockerRequestStream ("/build" <> query) $ \x -> x {
method = "POST"
, requestHeaders = [(hContentType, "application/tar")]
, requestBody = RequestBodyLBS tar
}
responseBody response $$+- CL.map showStream... | 701 | build :: Dockerfile cs -> Docker Id
build dockerfile = do
response <- dockerRequestStream ("/build" <> query) $ \x -> x {
method = "POST"
, requestHeaders = [(hContentType, "application/tar")]
, requestBody = RequestBodyLBS tar
}
responseBody response $$+- CL.map showStream... | 701 | build dockerfile = do
response <- dockerRequestStream ("/build" <> query) $ \x -> x {
method = "POST"
, requestHeaders = [(hContentType, "application/tar")]
, requestBody = RequestBodyLBS tar
}
responseBody response $$+- CL.map showStream
=$= CB.s... | 665 | false | true | 0 | 13 | 182 | 153 | 77 | 76 | null | null |
rimmington/cabal | cabal-install/Main.hs | bsd-3-clause | -- | Used as an entry point when cabal-install needs to invoke itself
-- as a setup script. This can happen e.g. when doing parallel builds.
--
actAsSetupAction :: ActAsSetupFlags -> [String] -> GlobalFlags -> IO ()
actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetup... | 657 | actAsSetupAction :: ActAsSetupFlags -> [String] -> GlobalFlags -> IO ()
actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetupFlags)
in case bt of
Simple -> Simple.defaultMainArgs args
Configure -> Simple.defaultMainWithHooksArgs
Simple.au... | 513 | actAsSetupAction actAsSetupFlags args _globalFlags =
let bt = fromFlag (actAsSetupBuildType actAsSetupFlags)
in case bt of
Simple -> Simple.defaultMainArgs args
Configure -> Simple.defaultMainWithHooksArgs
Simple.autoconfUserHooks args
Make -> Make.defaultMainArgs args
Cust... | 441 | true | true | 0 | 11 | 139 | 130 | 62 | 68 | null | null |
ibizaman/t411-hs | src/main.hs | bsd-3-clause | actionGetTerms _ = putStrLn "Provide a username and password" | 61 | actionGetTerms _ = putStrLn "Provide a username and password" | 61 | actionGetTerms _ = putStrLn "Provide a username and password" | 61 | false | false | 0 | 5 | 8 | 12 | 5 | 7 | null | null |
mettekou/ghc | libraries/base/GHC/Conc/Sync.hs | bsd-3-clause | -- | Returns the number of sparks currently in the local spark pool
numSparks :: IO Int
numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 161 | numSparks :: IO Int
numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 93 | numSparks = IO $ \s -> case numSparks# s of (# s', n #) -> (# s', I# n #) | 73 | true | true | 0 | 11 | 36 | 50 | 26 | 24 | null | null |
TomMD/ghc | compiler/types/FamInstEnv.hs | bsd-3-clause | lookupFamInstEnvConflicts
:: FamInstEnvs
-> FamInst -- Putative new instance
-> [FamInstMatch] -- Conflicting matches (don't look at the fim_tys field)
-- E.g. when we are about to add
-- f : type instance F [a] = a->a
-- we do (lookupFamInstConflicts f [b])
-- to find conflicting matches
--
-... | 2,002 | lookupFamInstEnvConflicts
:: FamInstEnvs
-> FamInst -- Putative new instance
-> [FamInstMatch]
lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom })
= lookup_fam_inst_env my_unify envs fam tys
where
(fam, tys) = famInstSplitLHS fam_inst
-- In example above, fa... | 1,738 | lookupFamInstEnvConflicts envs fam_inst@(FamInst { fi_axiom = new_axiom })
= lookup_fam_inst_env my_unify envs fam tys
where
(fam, tys) = famInstSplitLHS fam_inst
-- In example above, fam tys' = F [b]
my_unify (FamInst { fi_axiom = old_axiom }) tpl_tvs tpl_tys _
= ASSERT2( tyVarsOfTypes ty... | 1,622 | true | true | 3 | 10 | 473 | 195 | 109 | 86 | null | null |
hsyl20/HViperVM | lib/ViperVM/Backends/OpenCL/Query.hs | lgpl-3.0 | -- | Max depth of 3D image in pixels. The minimum value is 2048 if
-- 'clGetDeviceImageSupport' is 'True'.
--
-- This function execute OpenCL clGetDeviceInfo with
-- 'CL_DEVICE_IMAGE3D_MAX_DEPTH'.
clGetDeviceImage3DMaxDepth :: OpenCLLibrary -> CLDeviceID -> IO CSize
clGetDeviceImage3DMaxDepth lib = (getDeviceInfoSizet... | 368 | clGetDeviceImage3DMaxDepth :: OpenCLLibrary -> CLDeviceID -> IO CSize
clGetDeviceImage3DMaxDepth lib = (getDeviceInfoSizet lib) . getCLValue $ CL_DEVICE_IMAGE3D_MAX_DEPTH | 170 | clGetDeviceImage3DMaxDepth lib = (getDeviceInfoSizet lib) . getCLValue $ CL_DEVICE_IMAGE3D_MAX_DEPTH | 100 | true | true | 0 | 8 | 46 | 44 | 24 | 20 | null | null |
mstksg/ghc-typelits-natnormalise | src/GHC/TypeLits/Normalise/Unify.hs | bsd-2-clause | -- | Find unifiers for two SOP terms
--
-- Can find the following unifiers:
--
-- @
-- t ~ a + b ==> [t := a + b]
-- a + b ~ t ==> [t := a + b]
-- (a + c) ~ (b + c) ==> \[a := b\]
-- (2*a) ~ (2*b) ==> [a := b]
-- (2 + a) ~ 5 ==> [a := 3]
-- (3 * a) ~ 0 ==> [a := 0]
-- @
--
--... | 785 | unifiers :: Ct -> CoreSOP -> CoreSOP -> CoreUnify
unifiers ct (S [P [V x]]) s
| isGiven (ctEvidence ct) = [SubstItem x s ct]
| otherwise = [] | 159 | unifiers ct (S [P [V x]]) s
| isGiven (ctEvidence ct) = [SubstItem x s ct]
| otherwise = [] | 109 | true | true | 1 | 15 | 249 | 121 | 74 | 47 | null | null |
yuto-matsum/contest-util-hs | src/My/Num.hs | mit | pow i | i > 0 = product [1..i]
| i < 0 = undefined | 56 | pow i | i > 0 = product [1..i]
| i < 0 = undefined | 56 | pow i | i > 0 = product [1..i]
| i < 0 = undefined | 56 | false | false | 0 | 8 | 20 | 40 | 18 | 22 | null | null |
Chobbes/FeatureSquish | FeatureSquish/Parser.hs | mit | -- | Parse a file of MTLR data.
parseMTLR :: Parser [InputLine]
parseMTLR = do inps <- many parseMTLRLine
endOfInput
return inps
-- | Parse a single line of MTLR data. | 198 | parseMTLR :: Parser [InputLine]
parseMTLR = do inps <- many parseMTLRLine
endOfInput
return inps
-- | Parse a single line of MTLR data. | 166 | parseMTLR = do inps <- many parseMTLRLine
endOfInput
return inps
-- | Parse a single line of MTLR data. | 134 | true | true | 0 | 8 | 61 | 38 | 18 | 20 | null | null |
vsulabs/OptimizationMethodsHs | src/Task3.hs | bsd-3-clause | parabolicMethod :: (Fractional a, Ord a) => (a -> a) -> Triples a -> a
parabolicMethod f (u1, u2, u3) =
if isFinish
then u1
else parabolicMethod f $ getNext f (u1, u2, u3)
where
isFinish = eq u1 u2 && eq u2 u3
... | 357 | parabolicMethod :: (Fractional a, Ord a) => (a -> a) -> Triples a -> a
parabolicMethod f (u1, u2, u3) =
if isFinish
then u1
else parabolicMethod f $ getNext f (u1, u2, u3)
where
isFinish = eq u1 u2 && eq u2 u3
... | 357 | parabolicMethod f (u1, u2, u3) =
if isFinish
then u1
else parabolicMethod f $ getNext f (u1, u2, u3)
where
isFinish = eq u1 u2 && eq u2 u3
eq = floatEq eps | 286 | false | true | 0 | 8 | 178 | 116 | 61 | 55 | null | null |
DavidAlphaFox/darcs | src/Darcs/UI/Commands/ShowFiles.hs | gpl-2.0 | showFilesBasicOpts :: DarcsOption a
(Bool -> Bool -> Bool -> Bool -> [O.MatchFlag] -> Maybe String -> a)
showFilesBasicOpts
= O.files
^ O.directories
^ O.pending
^ O.nullFlag
^ O.matchOne
^ O.workingRepoDir | 252 | showFilesBasicOpts :: DarcsOption a
(Bool -> Bool -> Bool -> Bool -> [O.MatchFlag] -> Maybe String -> a)
showFilesBasicOpts
= O.files
^ O.directories
^ O.pending
^ O.nullFlag
^ O.matchOne
^ O.workingRepoDir | 252 | showFilesBasicOpts
= O.files
^ O.directories
^ O.pending
^ O.nullFlag
^ O.matchOne
^ O.workingRepoDir | 125 | false | true | 12 | 12 | 76 | 92 | 42 | 50 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Typechecker/Context.hs | mit | getDataConstructorType :: (Var v, Ord loc) => Reference -> Int -> M v loc (Type v loc)
getDataConstructorType = getConstructorType' Data getDataDeclaration | 155 | getDataConstructorType :: (Var v, Ord loc) => Reference -> Int -> M v loc (Type v loc)
getDataConstructorType = getConstructorType' Data getDataDeclaration | 155 | getDataConstructorType = getConstructorType' Data getDataDeclaration | 68 | false | true | 0 | 10 | 21 | 54 | 27 | 27 | null | null |
edsko/cabal | Cabal/src/Distribution/Simple.hs | bsd-3-clause | clean :: PackageDescription -> CleanFlags -> IO ()
clean pkg_descr flags = do
let distPref = fromFlagOrDefault defaultDistPref $ cleanDistPref flags
notice verbosity "cleaning..."
maybeConfig <- if fromFlag (cleanSaveConf flags)
then maybeGetPersistBuildConfig distPref
... | 1,347 | clean :: PackageDescription -> CleanFlags -> IO ()
clean pkg_descr flags = do
let distPref = fromFlagOrDefault defaultDistPref $ cleanDistPref flags
notice verbosity "cleaning..."
maybeConfig <- if fromFlag (cleanSaveConf flags)
then maybeGetPersistBuildConfig distPref
... | 1,347 | clean pkg_descr flags = do
let distPref = fromFlagOrDefault defaultDistPref $ cleanDistPref flags
notice verbosity "cleaning..."
maybeConfig <- if fromFlag (cleanSaveConf flags)
then maybeGetPersistBuildConfig distPref
else return Nothing
-- remove the whole d... | 1,296 | false | true | 3 | 12 | 326 | 239 | 111 | 128 | null | null |
micknelso/language-c | src/Language/CFamily/C/Analysis/AstAnalysis.hs | bsd-3-clause | enclosingFunctionType (FunCtx vd : _) = Just $ declType vd | 58 | enclosingFunctionType (FunCtx vd : _) = Just $ declType vd | 58 | enclosingFunctionType (FunCtx vd : _) = Just $ declType vd | 58 | false | false | 0 | 8 | 9 | 26 | 12 | 14 | null | null |
Teaspot-Studio/gore-and-ash | src/Game/GoreAndAsh/Core/ExternalRef.hs | bsd-3-clause | modifyExternalRef :: MonadIO m => ExternalRef t a -> (a -> (a, b)) -> m b
modifyExternalRef ExternalRef{..} f = do
(a, b) <- liftIO $ atomicModifyIORef' externalRef $
\a -> let (a', b) = f a in (a', (a', b))
_ <- liftIO $ externalFire a
return b
-- | Modify (not atomically) an external ref and notify FRP net... | 369 | modifyExternalRef :: MonadIO m => ExternalRef t a -> (a -> (a, b)) -> m b
modifyExternalRef ExternalRef{..} f = do
(a, b) <- liftIO $ atomicModifyIORef' externalRef $
\a -> let (a', b) = f a in (a', (a', b))
_ <- liftIO $ externalFire a
return b
-- | Modify (not atomically) an external ref and notify FRP net... | 369 | modifyExternalRef ExternalRef{..} f = do
(a, b) <- liftIO $ atomicModifyIORef' externalRef $
\a -> let (a', b) = f a in (a', (a', b))
_ <- liftIO $ externalFire a
return b
-- | Modify (not atomically) an external ref and notify FRP network.
-- The function evaluates the value to WNF. | 295 | false | true | 0 | 14 | 79 | 142 | 72 | 70 | null | null |
AlexeyRaga/eta | compiler/ETA/Main/HscTypes.hs | bsd-3-clause | lookupTypeHscEnv :: HscEnv -> Name -> IO (Maybe TyThing)
lookupTypeHscEnv hsc_env name = do
eps <- readIORef (hsc_EPS hsc_env)
return $! lookupType dflags hpt (eps_PTE eps) name
where
dflags = hsc_dflags hsc_env
hpt = hsc_HPT hsc_env
-- | Get the 'TyCon' from a 'TyThing' if it is a type constructor t... | 342 | lookupTypeHscEnv :: HscEnv -> Name -> IO (Maybe TyThing)
lookupTypeHscEnv hsc_env name = do
eps <- readIORef (hsc_EPS hsc_env)
return $! lookupType dflags hpt (eps_PTE eps) name
where
dflags = hsc_dflags hsc_env
hpt = hsc_HPT hsc_env
-- | Get the 'TyCon' from a 'TyThing' if it is a type constructor t... | 342 | lookupTypeHscEnv hsc_env name = do
eps <- readIORef (hsc_EPS hsc_env)
return $! lookupType dflags hpt (eps_PTE eps) name
where
dflags = hsc_dflags hsc_env
hpt = hsc_HPT hsc_env
-- | Get the 'TyCon' from a 'TyThing' if it is a type constructor thing. Panics otherwise | 285 | false | true | 0 | 10 | 71 | 91 | 43 | 48 | null | null |
nbloomf/carl | src/Carl/Pair.hs | gpl-3.0 | mapFst :: (a -> b) -> (a,c) -> (b,c)
mapFst f (a,c) = (f a, c) | 62 | mapFst :: (a -> b) -> (a,c) -> (b,c)
mapFst f (a,c) = (f a, c) | 62 | mapFst f (a,c) = (f a, c) | 25 | false | true | 0 | 9 | 15 | 64 | 34 | 30 | null | null |
irmikrys/Gomoku | src/Board.hs | bsd-3-clause | -----------------------------------------------
nums = [1,2..19] | 65 | nums = [1,2..19] | 16 | nums = [1,2..19] | 16 | true | false | 1 | 6 | 4 | 19 | 9 | 10 | null | null |
beni55/ghcjs | test/ghc/deriving/drvrun019.hs | mit | main = do { unWrap (foo 3 (Wrap (putChar 'x'))); putChar '\n' } | 63 | main = do { unWrap (foo 3 (Wrap (putChar 'x'))); putChar '\n' } | 63 | main = do { unWrap (foo 3 (Wrap (putChar 'x'))); putChar '\n' } | 63 | false | false | 0 | 13 | 12 | 41 | 20 | 21 | null | null |
Azocan/PA1 | main.hs | mit | beta :: Lexp -> Lexp
beta v@(Atom _) = v | 40 | beta :: Lexp -> Lexp
beta v@(Atom _) = v | 40 | beta v@(Atom _) = v | 19 | false | true | 2 | 7 | 9 | 33 | 15 | 18 | null | null |
tolysz/dsp | DSP/Filter/FIR/FIR.hs | gpl-2.0 | y2' = fir h2 xt | 15 | y2' = fir h2 xt | 15 | y2' = fir h2 xt | 15 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
MateVM/harpy | Harpy/X86CodeGen.hs | gpl-2.0 | -- Multi op shift missing.
x86_shrd_reg dreg reg =
emit8 0x0f >> emit8 0xad >> x86_reg_emit reg dreg | 126 | x86_shrd_reg dreg reg =
emit8 0x0f >> emit8 0xad >> x86_reg_emit reg dreg | 98 | x86_shrd_reg dreg reg =
emit8 0x0f >> emit8 0xad >> x86_reg_emit reg dreg | 98 | true | false | 0 | 7 | 43 | 31 | 14 | 17 | null | null |
d0kt0r0/estuary | client/src/Estuary/Languages/CineCer0/VideoSpec.hs | gpl-3.0 | circleMask' :: Signal Rational -> Signal Rational -> Signal Rational -> LayerSpec -> LayerSpec
circleMask' m n s vs = vs {
mask = \a b c d e -> "clip-path:circle(" <> (showt (realToFrac ((
(((m a b c d e)*71)-71)*(-1)
) :: Rational) :: Double)) <> "% at " <> (showt (realToFrac (((n a b c d e)*100) :: Rational) ::... | 418 | circleMask' :: Signal Rational -> Signal Rational -> Signal Rational -> LayerSpec -> LayerSpec
circleMask' m n s vs = vs {
mask = \a b c d e -> "clip-path:circle(" <> (showt (realToFrac ((
(((m a b c d e)*71)-71)*(-1)
) :: Rational) :: Double)) <> "% at " <> (showt (realToFrac (((n a b c d e)*100) :: Rational) ::... | 418 | circleMask' m n s vs = vs {
mask = \a b c d e -> "clip-path:circle(" <> (showt (realToFrac ((
(((m a b c d e)*71)-71)*(-1)
) :: Rational) :: Double)) <> "% at " <> (showt (realToFrac (((n a b c d e)*100) :: Rational) :: Double)) <> "% " <> (showt (realToFrac (((s a b c d e)*100) :: Rational) :: Double)) <> "%);"
... | 323 | false | true | 0 | 26 | 89 | 235 | 125 | 110 | null | null |
ikuehne/craeft-hs | lib/Craeft/TypeChecker.hs | gpl-3.0 | inferBinopType p _ s _ = throw p
"type checker doesn't know how to deal with these yet" | 91 | inferBinopType p _ s _ = throw p
"type checker doesn't know how to deal with these yet" | 91 | inferBinopType p _ s _ = throw p
"type checker doesn't know how to deal with these yet" | 91 | false | false | 0 | 5 | 21 | 21 | 9 | 12 | null | null |
mzini/TcT | source/Tct/Certificate.hs | gpl-3.0 | (Poly _) `compose` (Exp (Just m)) = Exp $ Just m | 65 | (Poly _) `compose` (Exp (Just m)) = Exp $ Just m | 65 | (Poly _) `compose` (Exp (Just m)) = Exp $ Just m | 65 | false | false | 0 | 9 | 27 | 39 | 19 | 20 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32F427/ADC.hs | bsd-3-clause | rccEnable :: BitDataField RCC_APB2ENR Bit -> Ivory eff ()
rccEnable field = modifyReg regRCC_APB2ENR $ setBit field | 115 | rccEnable :: BitDataField RCC_APB2ENR Bit -> Ivory eff ()
rccEnable field = modifyReg regRCC_APB2ENR $ setBit field | 115 | rccEnable field = modifyReg regRCC_APB2ENR $ setBit field | 57 | false | true | 0 | 8 | 16 | 44 | 19 | 25 | null | null |
kaoskorobase/delimited-text | examples/test.hs | bsd-2-clause | main :: IO ()
main = do
[cmd, ds] <- getArgs
case cmd of
"interact" -> mainInteract ds
"print" -> mainPrint ds
"printnum" -> mainPrintNumbers ds
otherwise -> putStrLn "Usage: runhaskell test.hs [interact|print|printnum] DELIMITERS < FILE" | 282 | main :: IO ()
main = do
[cmd, ds] <- getArgs
case cmd of
"interact" -> mainInteract ds
"print" -> mainPrint ds
"printnum" -> mainPrintNumbers ds
otherwise -> putStrLn "Usage: runhaskell test.hs [interact|print|printnum] DELIMITERS < FILE" | 282 | main = do
[cmd, ds] <- getArgs
case cmd of
"interact" -> mainInteract ds
"print" -> mainPrint ds
"printnum" -> mainPrintNumbers ds
otherwise -> putStrLn "Usage: runhaskell test.hs [interact|print|printnum] DELIMITERS < FILE" | 268 | false | true | 0 | 10 | 79 | 72 | 34 | 38 | null | null |
ant1441/haskell-statsd | src/Statsd/Parser.hs | bsd-3-clause | metricConduit2 :: (Monad m, MonadThrow m) => Conduit ByteString m Metric
metricConduit2 = do
firstMetric
conduitParser subsequentMetrics =$= DCL.map snd
where
firstMetric = yield =<< sinkParser partMetricParser
subsequentMetrics = separator >> partMetricParser | 272 | metricConduit2 :: (Monad m, MonadThrow m) => Conduit ByteString m Metric
metricConduit2 = do
firstMetric
conduitParser subsequentMetrics =$= DCL.map snd
where
firstMetric = yield =<< sinkParser partMetricParser
subsequentMetrics = separator >> partMetricParser | 272 | metricConduit2 = do
firstMetric
conduitParser subsequentMetrics =$= DCL.map snd
where
firstMetric = yield =<< sinkParser partMetricParser
subsequentMetrics = separator >> partMetricParser | 199 | false | true | 2 | 9 | 43 | 84 | 37 | 47 | null | null |
gnn/Hets | OWL2/ManchesterPrint.hs | gpl-2.0 | printAxiom :: Axiom -> Doc
printAxiom (PlainAxiom e fb) = printFrame (Frame e [fb]) | 83 | printAxiom :: Axiom -> Doc
printAxiom (PlainAxiom e fb) = printFrame (Frame e [fb]) | 83 | printAxiom (PlainAxiom e fb) = printFrame (Frame e [fb]) | 56 | false | true | 0 | 9 | 13 | 45 | 21 | 24 | null | null |
mbakke/ganeti | src/Ganeti/Hash.hs | bsd-2-clause | -- | Verifies the HMAC for a given message.
verifyMac :: HashKey -> Maybe String -> String -> String -> Bool
verifyMac key salt text digest =
map toLower digest == computeMac key salt text | 190 | verifyMac :: HashKey -> Maybe String -> String -> String -> Bool
verifyMac key salt text digest =
map toLower digest == computeMac key salt text | 146 | verifyMac key salt text digest =
map toLower digest == computeMac key salt text | 81 | true | true | 1 | 10 | 36 | 59 | 26 | 33 | null | null |
sdiehl/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88 | 56 | encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88 | 56 | encodeDoubleIntegerIdKey = mkPreludeMiscIdUnique 88 | 56 | false | false | 0 | 5 | 8 | 9 | 4 | 5 | null | null |
Helkafen/haddock | haddock-library/src/Documentation/Haddock/Parser.hs | bsd-2-clause | -- | Bold parser.
--
-- >>> parseString "__Hello world__"
-- DocBold (DocString "Hello world")
bold :: Parser (DocH mod Identifier)
bold = DocBold . parseStringBS <$> disallowNewline ("__" *> takeUntil "__") | 207 | bold :: Parser (DocH mod Identifier)
bold = DocBold . parseStringBS <$> disallowNewline ("__" *> takeUntil "__") | 112 | bold = DocBold . parseStringBS <$> disallowNewline ("__" *> takeUntil "__") | 75 | true | true | 0 | 9 | 31 | 47 | 25 | 22 | null | null |
haskell-distributed/distributed-process-task | tests/TestTaskQueues.hs | bsd-3-clause | namedTask :: (String, String) -> Process String
namedTask (name, result) = do
self <- getSelfPid
register name self
() <- expect
return result | 150 | namedTask :: (String, String) -> Process String
namedTask (name, result) = do
self <- getSelfPid
register name self
() <- expect
return result | 150 | namedTask (name, result) = do
self <- getSelfPid
register name self
() <- expect
return result | 102 | false | true | 0 | 8 | 30 | 63 | 30 | 33 | null | null |
patperry/hs-linear-algebra | tests-old/TriBanded.hs | bsd-3-clause | prop_tri_solveMatrix (TriBandedSM (t :: TB) c) =
let b = t <\\> c
in t <**> b ~== c | 91 | prop_tri_solveMatrix (TriBandedSM (t :: TB) c) =
let b = t <\\> c
in t <**> b ~== c | 91 | prop_tri_solveMatrix (TriBandedSM (t :: TB) c) =
let b = t <\\> c
in t <**> b ~== c | 91 | false | false | 5 | 9 | 26 | 56 | 28 | 28 | null | null |
piyush-kurur/yesod | yesod/AddHandler.hs | mit | fixApp :: String -> String -> String
fixApp name =
unlines . reverse . go . reverse . lines
where
l = "import Handler." ++ name
go [] = [l]
go (x:xs)
| "import Handler." `isPrefixOf` x = l : x : xs
| otherwise = x : go xs | 256 | fixApp :: String -> String -> String
fixApp name =
unlines . reverse . go . reverse . lines
where
l = "import Handler." ++ name
go [] = [l]
go (x:xs)
| "import Handler." `isPrefixOf` x = l : x : xs
| otherwise = x : go xs | 256 | fixApp name =
unlines . reverse . go . reverse . lines
where
l = "import Handler." ++ name
go [] = [l]
go (x:xs)
| "import Handler." `isPrefixOf` x = l : x : xs
| otherwise = x : go xs | 219 | false | true | 0 | 8 | 84 | 114 | 57 | 57 | null | null |
frosch03/arrowVHDL | src/System/ArrowVHDL/Circuit/Auxillary.hs | cc0-1.0 | -- 'nextID' is function that gets a list of component numbers and generates the next valid one
nextID :: [CompID] -> CompID
nextID [] = 0 | 140 | nextID :: [CompID] -> CompID
nextID [] = 0 | 45 | nextID [] = 0 | 16 | true | true | 0 | 6 | 28 | 24 | 13 | 11 | null | null |
AndreasPK/stack | src/Stack/Types/Config.hs | bsd-3-clause | hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File)
hoogleDatabasePath = do
dir <- hoogleRoot
return (dir </> $(mkRelFile "database.hoo"))
-- | Path for platform followed by snapshot name followed by compiler
-- name. | 269 | hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File)
hoogleDatabasePath = do
dir <- hoogleRoot
return (dir </> $(mkRelFile "database.hoo"))
-- | Path for platform followed by snapshot name followed by compiler
-- name. | 269 | hoogleDatabasePath = do
dir <- hoogleRoot
return (dir </> $(mkRelFile "database.hoo"))
-- | Path for platform followed by snapshot name followed by compiler
-- name. | 174 | false | true | 0 | 12 | 47 | 74 | 37 | 37 | null | null |
cartazio/omega | src/NarrowData.hs | bsd-3-clause | freshN (TyEx xs) = do { t2 <- freshN t
; ps2 <- mapM freshPred ps
; return(TyEx (windup vs (ps2,t2)))}
where (vs,(ps,t)) = unsafeUnwind xs | 183 | freshN (TyEx xs) = do { t2 <- freshN t
; ps2 <- mapM freshPred ps
; return(TyEx (windup vs (ps2,t2)))}
where (vs,(ps,t)) = unsafeUnwind xs | 183 | freshN (TyEx xs) = do { t2 <- freshN t
; ps2 <- mapM freshPred ps
; return(TyEx (windup vs (ps2,t2)))}
where (vs,(ps,t)) = unsafeUnwind xs | 183 | false | false | 0 | 12 | 70 | 90 | 46 | 44 | null | null |
HaskellForCats/HaskellForCats | EstTaxQrt/estTax3rdQrt.hs | mit | taxFed = earnedQt * fedObligat | 30 | taxFed = earnedQt * fedObligat | 30 | taxFed = earnedQt * fedObligat | 30 | false | false | 2 | 5 | 4 | 15 | 5 | 10 | null | null |
bitemyapp/hst | src/HST/Parse.hs | apache-2.0 | keywordMessage :: GenParser Char st Message
keywordMessage = many1 keywordPrimary >>= return . unzip >>= return . uncurry KeywordMessage | 136 | keywordMessage :: GenParser Char st Message
keywordMessage = many1 keywordPrimary >>= return . unzip >>= return . uncurry KeywordMessage | 136 | keywordMessage = many1 keywordPrimary >>= return . unzip >>= return . uncurry KeywordMessage | 92 | false | true | 0 | 9 | 18 | 40 | 19 | 21 | null | null |
cgaebel/network-bitcoin | src/Network/Bitcoin/BlockChain.hs | bsd-3-clause | -- | Returns the hash of the block in best-block-chain at the given index.
getBlockHash :: Client
-> Integer -- ^ Block index.
-> IO BlockHash
getBlockHash client idx = callApi client "getblockhash" [ tj idx ] | 235 | getBlockHash :: Client
-> Integer -- ^ Block index.
-> IO BlockHash
getBlockHash client idx = callApi client "getblockhash" [ tj idx ] | 160 | getBlockHash client idx = callApi client "getblockhash" [ tj idx ] | 66 | true | true | 0 | 7 | 62 | 42 | 21 | 21 | null | null |
Vlix/facebookmessenger | test/UnitTest/ShortFunction.hs | mit | testAttachmentRequest :: TestTree
testAttachmentRequest = testCase "Attachment request without QR or metadata" $
attachmentRequest_ att @?= expected
where expected = RMAttachment $ RequestMessageAttachment att [] Nothing
url = "https://idunno.maybe.here/some/image.jpg"
att = testMultimediaAtt IMAG... | 331 | testAttachmentRequest :: TestTree
testAttachmentRequest = testCase "Attachment request without QR or metadata" $
attachmentRequest_ att @?= expected
where expected = RMAttachment $ RequestMessageAttachment att [] Nothing
url = "https://idunno.maybe.here/some/image.jpg"
att = testMultimediaAtt IMAG... | 331 | testAttachmentRequest = testCase "Attachment request without QR or metadata" $
attachmentRequest_ att @?= expected
where expected = RMAttachment $ RequestMessageAttachment att [] Nothing
url = "https://idunno.maybe.here/some/image.jpg"
att = testMultimediaAtt IMAGE url False | 297 | false | true | 2 | 7 | 56 | 64 | 31 | 33 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_ST_GLOBAL :: Int
wxSTC_ST_GLOBAL = 10 | 43 | wxSTC_ST_GLOBAL :: Int
wxSTC_ST_GLOBAL = 10 | 43 | wxSTC_ST_GLOBAL = 10 | 20 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
oldmanmike/ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | setOneShotInfo :: IdInfo -> OneShotInfo -> IdInfo
setOneShotInfo info lb = {-lb `seq`-} info { oneShotInfo = lb } | 118 | setOneShotInfo :: IdInfo -> OneShotInfo -> IdInfo
setOneShotInfo info lb = {-lb `seq`-} info { oneShotInfo = lb } | 118 | setOneShotInfo info lb = {-lb `seq`-} info { oneShotInfo = lb } | 68 | false | true | 0 | 6 | 23 | 33 | 18 | 15 | null | null |
nbrunt/JSHOP | src/old/ver2/Diagnostics.hs | mit | emitInfoD :: SrcPos -> String -> D ()
emitInfoD sp msg = D $ \dms ->
(Just (), mkInfoMsg sp msg : dms) | 106 | emitInfoD :: SrcPos -> String -> D ()
emitInfoD sp msg = D $ \dms ->
(Just (), mkInfoMsg sp msg : dms) | 106 | emitInfoD sp msg = D $ \dms ->
(Just (), mkInfoMsg sp msg : dms) | 68 | false | true | 0 | 9 | 26 | 58 | 29 | 29 | null | null |
archhaskell/archlinux | Distribution/ArchLinux/PkgBuild.hs | bsd-3-clause | readPackage :: AnnotatedPkgBuild -> GetPKG AnnotatedPkgBuild
readPackage st = do
cs <- getInput
case cs of
_ | "# Maintainer" `isPrefixOf` cs -> do
h <- line cs
readPackage st { pkgHeader = h }
| "# Package generated" `isPrefixOf` cs -> do
h <- line cs
... | 3,379 | readPackage :: AnnotatedPkgBuild -> GetPKG AnnotatedPkgBuild
readPackage st = do
cs <- getInput
case cs of
_ | "# Maintainer" `isPrefixOf` cs -> do
h <- line cs
readPackage st { pkgHeader = h }
| "# Package generated" `isPrefixOf` cs -> do
h <- line cs
... | 3,379 | readPackage st = do
cs <- getInput
case cs of
_ | "# Maintainer" `isPrefixOf` cs -> do
h <- line cs
readPackage st { pkgHeader = h }
| "# Package generated" `isPrefixOf` cs -> do
h <- line cs
let v = simpleParse
. reverse
... | 3,318 | false | true | 0 | 23 | 1,417 | 1,178 | 571 | 607 | null | null |
bflyblue/parse-quote | Main.hs | unlicense | options :: Parser Options
options = Options
<$> arguments str (metavar "FILES...")
<*> switch (short 'r' <> long "reorder" <> help "Reorder according to quote accept time") | 191 | options :: Parser Options
options = Options
<$> arguments str (metavar "FILES...")
<*> switch (short 'r' <> long "reorder" <> help "Reorder according to quote accept time") | 191 | options = Options
<$> arguments str (metavar "FILES...")
<*> switch (short 'r' <> long "reorder" <> help "Reorder according to quote accept time") | 165 | false | true | 5 | 9 | 45 | 67 | 29 | 38 | null | null |
karamellpelle/grid | source/Game/Grid/Output/Plain/ShadePath.hs | gpl-3.0 | shadePathAlpha :: ShadePath -> Float -> IO ()
shadePathAlpha sh alpha = do
glUniform1f (shadePathUniAlpha sh) $ rTF alpha | 125 | shadePathAlpha :: ShadePath -> Float -> IO ()
shadePathAlpha sh alpha = do
glUniform1f (shadePathUniAlpha sh) $ rTF alpha | 125 | shadePathAlpha sh alpha = do
glUniform1f (shadePathUniAlpha sh) $ rTF alpha | 79 | false | true | 0 | 11 | 22 | 53 | 23 | 30 | null | null |
narrative/stack | src/main/Main.hs | bsd-3-clause | commandLineHandler
:: String
-> Bool
-> IO (GlobalOptsMonoid, GlobalOpts -> IO ())
commandLineHandler progName isInterpreter = complicatedOptions
Meta.version
(Just versionString')
"stack - The Haskell Tool Stack"
""
(globalOpts OuterGlobalOpts)
(Just failureCallback)
addCommands
where
failure... | 12,317 | commandLineHandler
:: String
-> Bool
-> IO (GlobalOptsMonoid, GlobalOpts -> IO ())
commandLineHandler progName isInterpreter = complicatedOptions
Meta.version
(Just versionString')
"stack - The Haskell Tool Stack"
""
(globalOpts OuterGlobalOpts)
(Just failureCallback)
addCommands
where
failure... | 12,317 | commandLineHandler progName isInterpreter = complicatedOptions
Meta.version
(Just versionString')
"stack - The Haskell Tool Stack"
""
(globalOpts OuterGlobalOpts)
(Just failureCallback)
addCommands
where
failureCallback f args =
case stripPrefix "Invalid argument" (fst (renderFailure f "")) of... | 12,228 | false | true | 0 | 26 | 5,726 | 1,608 | 756 | 852 | null | null |
fumieval/control-bool | Control/Bool.hs | bsd-3-clause | -- | A lifted ('&&').
(<&&>) :: Applicative f => f Bool -> f Bool -> f Bool
(<&&>) = liftA2 (&&) | 96 | (<&&>) :: Applicative f => f Bool -> f Bool -> f Bool
(<&&>) = liftA2 (&&) | 74 | (<&&>) = liftA2 (&&) | 20 | true | true | 0 | 9 | 21 | 51 | 25 | 26 | null | null |
dmjio/stripe | stripe-core/src/Web/Stripe/Charge.hs | mit | ------------------------------------------------------------------------------
-- | Retrieve a `Charge` by `ChargeId`
getCharge
:: ChargeId -- ^ The `Charge` to retrive
-> StripeRequest GetCharge
getCharge
chargeid = request
where request = mkStripeRequest GET url params
url = "charges" </>... | 362 | getCharge
:: ChargeId -- ^ The `Charge` to retrive
-> StripeRequest GetCharge
getCharge
chargeid = request
where request = mkStripeRequest GET url params
url = "charges" </> getChargeId chargeid
params = [] | 244 | getCharge
chargeid = request
where request = mkStripeRequest GET url params
url = "charges" </> getChargeId chargeid
params = [] | 158 | true | true | 2 | 7 | 77 | 60 | 30 | 30 | null | null |
TomMD/cryptol | src/Cryptol/TypeCheck/Solve.hs | bsd-3-clause | -- Free vars are even
exportVar (TVBound x _) = 2 * x + 1 | 60 | exportVar (TVBound x _) = 2 * x + 1 | 38 | exportVar (TVBound x _) = 2 * x + 1 | 38 | true | false | 0 | 7 | 17 | 26 | 13 | 13 | null | null |
bmillwood/pointfree | Plugin/Pl/Rules.hs | mit | evalBinary _ _ = Nothing | 24 | evalBinary _ _ = Nothing | 24 | evalBinary _ _ = Nothing | 24 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
akc/gfscript | HOPS/GF/Const.hs | bsd-3-clause | coreExpr2 (EFac e) = App1 Fac (coreExpr3 e) | 47 | coreExpr2 (EFac e) = App1 Fac (coreExpr3 e) | 47 | coreExpr2 (EFac e) = App1 Fac (coreExpr3 e) | 47 | false | false | 0 | 7 | 11 | 26 | 12 | 14 | null | null |
sopvop/snap | src/Snap/Snaplet/Auth/Backends/JsonFile.hs | bsd-3-clause | ------------------------------------------------------------------------------
defUserCache :: UserCache
defUserCache = UserCache {
uidCache = HM.empty
, loginCache = HM.empty
, tokenCache = HM.empty
, uidCounter = 0
} | 230 | defUserCache :: UserCache
defUserCache = UserCache {
uidCache = HM.empty
, loginCache = HM.empty
, tokenCache = HM.empty
, uidCounter = 0
} | 151 | defUserCache = UserCache {
uidCache = HM.empty
, loginCache = HM.empty
, tokenCache = HM.empty
, uidCounter = 0
} | 125 | true | true | 0 | 8 | 35 | 54 | 29 | 25 | null | null |
barrucadu/nagi | lib/Imageboard/Moderation.hs | mit | -- | Hide or reveal a news item. Requires @CapAuthorNews@.
hideNews :: Bool -> LoginId -> NewsId -> SqlPersistT IO (Either SomeException ())
hideNews True = setNewsField ("hid news item "<>) NewsHidden True | 209 | hideNews :: Bool -> LoginId -> NewsId -> SqlPersistT IO (Either SomeException ())
hideNews True = setNewsField ("hid news item "<>) NewsHidden True | 150 | hideNews True = setNewsField ("hid news item "<>) NewsHidden True | 68 | true | true | 0 | 12 | 35 | 58 | 28 | 30 | null | null |
hvr/lens | src/Control/Lens/Iso.hs | bsd-3-clause | ------------------------------------------------------------------------------
-- Magma
------------------------------------------------------------------------------
-- | This isomorphism can be used to inspect a 'Traversal' to see how it associates
-- the structure and it can also be used to bake the 'Traversal' int... | 514 | magma :: LensLike (Mafic a b) s t a b -> Iso s u (Magma Int t b a) (Magma j u c c)
magma l = iso (runMafic `rmap` l sell) runMagma | 130 | magma l = iso (runMafic `rmap` l sell) runMagma | 47 | true | true | 0 | 8 | 79 | 93 | 49 | 44 | null | null |
rrnewton/concurrent-skiplist | src/Data/Concurrent/LinkedMap.hs | apache-2.0 | find :: Ord k => LMap k v -> k -> IO (FindResult k v)
find (LMap m') k = findInner m' Nothing
where
findInner m v = do
nextTicket <- readForCAS m
let stopHere = NotFound $ Token {keyToInsert = k, value = v, nextRef = m, nextTicket}
case peekTicket nextTicket of
Empty -> return stopHere
... | 737 | find :: Ord k => LMap k v -> k -> IO (FindResult k v)
find (LMap m') k = findInner m' Nothing
where
findInner m v = do
nextTicket <- readForCAS m
let stopHere = NotFound $ Token {keyToInsert = k, value = v, nextRef = m, nextTicket}
case peekTicket nextTicket of
Empty -> return stopHere
... | 737 | find (LMap m') k = findInner m' Nothing
where
findInner m v = do
nextTicket <- readForCAS m
let stopHere = NotFound $ Token {keyToInsert = k, value = v, nextRef = m, nextTicket}
case peekTicket nextTicket of
Empty -> return stopHere
Node k' v' next ->
case compare k k' ... | 683 | false | true | 1 | 16 | 216 | 198 | 97 | 101 | null | null |
wat-aro/scheme | app/Main.hs | bsd-3-clause | makeString :: [LispVal] -> ThrowsError LispVal
makeString [Number n] = makeString [Number n, Character ' '] | 107 | makeString :: [LispVal] -> ThrowsError LispVal
makeString [Number n] = makeString [Number n, Character ' '] | 107 | makeString [Number n] = makeString [Number n, Character ' '] | 60 | false | true | 0 | 7 | 15 | 45 | 22 | 23 | null | null |
GaloisInc/halvm-ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | unboundVarOcc :: UnboundVar -> OccName
unboundVarOcc (OutOfScope occ _) = occ | 77 | unboundVarOcc :: UnboundVar -> OccName
unboundVarOcc (OutOfScope occ _) = occ | 77 | unboundVarOcc (OutOfScope occ _) = occ | 38 | false | true | 0 | 7 | 10 | 26 | 13 | 13 | null | null |
LCamel/BuildYourOwnHaskellCompiler | haskell/parse/app/Main.hs | mit | getModuleName :: ModuleName foo -> String
getModuleName (ModuleName foo name) = name | 84 | getModuleName :: ModuleName foo -> String
getModuleName (ModuleName foo name) = name | 84 | getModuleName (ModuleName foo name) = name | 42 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
rahulmutt/ghcvm | compiler/Eta/CodeGen/Prim.hs | bsd-3-clause | mkRtsPrimOp CasMutVarOp = (ioGroup, "casMutVar") | 60 | mkRtsPrimOp CasMutVarOp = (ioGroup, "casMutVar") | 60 | mkRtsPrimOp CasMutVarOp = (ioGroup, "casMutVar") | 60 | false | false | 0 | 5 | 16 | 15 | 8 | 7 | null | null |
voidlizard/emufat | src/readpiece.hs | bsd-3-clause | printPiece :: Fmt -> Piece -> IO ()
printPiece f m = putStrLn $ pp f m
where
pp (Fmt _ _ _ Dec) (P8 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P16 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P32 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P64 x) = printf "%d" x
pp (Fmt _ _ _ Hex) (P8 x) = printf "%02X" x
... | 463 | printPiece :: Fmt -> Piece -> IO ()
printPiece f m = putStrLn $ pp f m
where
pp (Fmt _ _ _ Dec) (P8 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P16 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P32 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P64 x) = printf "%d" x
pp (Fmt _ _ _ Hex) (P8 x) = printf "%02X" x
... | 463 | printPiece f m = putStrLn $ pp f m
where
pp (Fmt _ _ _ Dec) (P8 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P16 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P32 x) = printf "%d" x
pp (Fmt _ _ _ Dec) (P64 x) = printf "%d" x
pp (Fmt _ _ _ Hex) (P8 x) = printf "%02X" x
pp (Fmt _ _ _ Hex) (P16 x) = printf ... | 427 | false | true | 7 | 8 | 149 | 297 | 147 | 150 | null | null |
toonn/quintessence | src/Lexer.hs | bsd-2-clause | checkReservedOp :: Monad m => String -> m String
checkReservedOp = checkFail (`elem` reservedops)
[ "reserved operator \""
, "\" cannot be an operator" ] | 209 | checkReservedOp :: Monad m => String -> m String
checkReservedOp = checkFail (`elem` reservedops)
[ "reserved operator \""
, "\" cannot be an operator" ] | 209 | checkReservedOp = checkFail (`elem` reservedops)
[ "reserved operator \""
, "\" cannot be an operator" ] | 160 | false | true | 0 | 7 | 80 | 42 | 23 | 19 | null | null |
olsner/ghc | libraries/base/Data/Data.hs | bsd-3-clause | ------------------------------------------------------------------------------
--
-- From strings to constr's and vice versa: all data types
--
------------------------------------------------------------------------------
-- | Gets the string for a constructor
showConstr :: Constr -> String
showConstr = constri... | 322 | showConstr :: Constr -> String
showConstr = constring | 53 | showConstr = constring | 22 | true | true | 0 | 5 | 37 | 21 | 14 | 7 | null | null |
ancientlanguage/haskell-analysis | grammar/src/Grammar/Common/Decompose.hs | mit | decomposeChar '\x2F8D5' = "\x669C" | 34 | decomposeChar '\x2F8D5' = "\x669C" | 34 | decomposeChar '\x2F8D5' = "\x669C" | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
sdiehl/ghc | testsuite/tests/simplCore/should_compile/T9509.hs | bsd-3-clause | main = foo (5 :: Int) >>= print | 31 | main = foo (5 :: Int) >>= print | 31 | main = foo (5 :: Int) >>= print | 31 | false | false | 1 | 7 | 7 | 23 | 10 | 13 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Primitive.hs | isc | doBinOp LogAnd {} = doBoolBinOp (&&) | 36 | doBinOp LogAnd {} = doBoolBinOp (&&) | 36 | doBinOp LogAnd {} = doBoolBinOp (&&) | 36 | false | false | 1 | 5 | 5 | 19 | 9 | 10 | null | null |
oskimura/Lambda | Parser.hs | mit | fv (Apply m n) = (fv m) `Data.Set.union` (fv n) | 48 | fv (Apply m n) = (fv m) `Data.Set.union` (fv n) | 48 | fv (Apply m n) = (fv m) `Data.Set.union` (fv n) | 48 | false | false | 0 | 7 | 10 | 39 | 20 | 19 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/DiffCheck.hs | bsd-3-clause | exprSpans (Lam x e) = getSrcSpan x : exprSpans e | 54 | exprSpans (Lam x e) = getSrcSpan x : exprSpans e | 54 | exprSpans (Lam x e) = getSrcSpan x : exprSpans e | 54 | false | false | 0 | 6 | 15 | 28 | 12 | 16 | null | null |
beni55/LambdaHack | Game/LambdaHack/Atomic/PosAtomicRead.hs | bsd-3-clause | loudUpdAtomic :: MonadStateRead m
=> Bool -> FactionId -> UpdAtomic -> m (Maybe Msg)
loudUpdAtomic local fid cmd = do
msound <- case cmd of
UpdDestroyActor _ body _
-- Death of a party member does not need to be heard,
-- because it's seen.
| not $ fid == bfid body || bproj body ->... | 944 | loudUpdAtomic :: MonadStateRead m
=> Bool -> FactionId -> UpdAtomic -> m (Maybe Msg)
loudUpdAtomic local fid cmd = do
msound <- case cmd of
UpdDestroyActor _ body _
-- Death of a party member does not need to be heard,
-- because it's seen.
| not $ fid == bfid body || bproj body ->... | 944 | loudUpdAtomic local fid cmd = do
msound <- case cmd of
UpdDestroyActor _ body _
-- Death of a party member does not need to be heard,
-- because it's seen.
| not $ fid == bfid body || bproj body -> return $ Just "shriek"
UpdCreateItem _ _ _ (CActor _ CGround) -> return $ Just "clatter"
U... | 845 | false | true | 0 | 16 | 271 | 283 | 135 | 148 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/Enums.hs | mit | js_ApplePayContactFieldPhone = "phone" | 38 | js_ApplePayContactFieldPhone = "phone" | 38 | js_ApplePayContactFieldPhone = "phone" | 38 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
cheng81/schemish | src/Env.hs | bsd-3-clause | bindVars :: Env -> [(String, LispVal)] -> IO Env
bindVars envRef bindings = readIORef envRef >>= extendEnv bindings >>= newIORef
where extendEnv bindings env = fmap (++ env) (mapM addBinding bindings)
addBinding (var, value) = do ref <- newIORef value
return (var, ref) | 316 | bindVars :: Env -> [(String, LispVal)] -> IO Env
bindVars envRef bindings = readIORef envRef >>= extendEnv bindings >>= newIORef
where extendEnv bindings env = fmap (++ env) (mapM addBinding bindings)
addBinding (var, value) = do ref <- newIORef value
return (var, ref) | 316 | bindVars envRef bindings = readIORef envRef >>= extendEnv bindings >>= newIORef
where extendEnv bindings env = fmap (++ env) (mapM addBinding bindings)
addBinding (var, value) = do ref <- newIORef value
return (var, ref) | 267 | false | true | 1 | 9 | 89 | 115 | 58 | 57 | null | null |
brendanhay/gogol | gogol-fusiontables/gen/Network/Google/Resource/FusionTables/Table/RefetchSheet.hs | mpl-2.0 | -- | Table whose rows will be replaced from the spreadsheet.
trsTableId :: Lens' TableRefetchSheet Text
trsTableId
= lens _trsTableId (\ s a -> s{_trsTableId = a}) | 165 | trsTableId :: Lens' TableRefetchSheet Text
trsTableId
= lens _trsTableId (\ s a -> s{_trsTableId = a}) | 104 | trsTableId
= lens _trsTableId (\ s a -> s{_trsTableId = a}) | 61 | true | true | 1 | 9 | 28 | 46 | 22 | 24 | null | null |
randen/haddock | haddock-test/src/Test/Haddock/Config.hs | bsd-2-clause | processFileArgs' :: DirConfig -> [String] -> IO [TestPackage]
processFileArgs' dcfg args = do
(dirs, mdls) <- partitionM doesDirectoryExist' . map takeBaseName $ args
rootPkg <- pure $ TestPackage
{ tpkgName = ""
, tpkgFiles = map (srcDir </>) mdls
}
otherPkgs <- forM dirs $ \dir -> ... | 819 | processFileArgs' :: DirConfig -> [String] -> IO [TestPackage]
processFileArgs' dcfg args = do
(dirs, mdls) <- partitionM doesDirectoryExist' . map takeBaseName $ args
rootPkg <- pure $ TestPackage
{ tpkgName = ""
, tpkgFiles = map (srcDir </>) mdls
}
otherPkgs <- forM dirs $ \dir -> ... | 819 | processFileArgs' dcfg args = do
(dirs, mdls) <- partitionM doesDirectoryExist' . map takeBaseName $ args
rootPkg <- pure $ TestPackage
{ tpkgName = ""
, tpkgFiles = map (srcDir </>) mdls
}
otherPkgs <- forM dirs $ \dir -> do
let srcDir' = srcDir </> dir
files <- filte... | 757 | false | true | 0 | 16 | 234 | 272 | 137 | 135 | null | null |
tittoassini/flat | benchmarks/PkgBE.hs | bsd-3-clause | encodeCtr7 n a b c d e f g
= beginListLen 8 <> encode (n :: Word) <> encode a <> encode b
<> encode c <> encode d <> encode e <> encode f
<> encode g | 210 | encodeCtr7 n a b c d e f g
= beginListLen 8 <> encode (n :: Word) <> encode a <> encode b
<> encode c <> encode d <> encode e <> encode f
<> encode g | 210 | encodeCtr7 n a b c d e f g
= beginListLen 8 <> encode (n :: Word) <> encode a <> encode b
<> encode c <> encode d <> encode e <> encode f
<> encode g | 210 | false | false | 0 | 14 | 98 | 88 | 40 | 48 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-example/Drasil/SWHS/GenDefs.hs | bsd-2-clause | rocTempDerivArbVol :: [Sentence]
rocTempDerivArbVol = [S "We consider an arbitrary" +:+. phrase vol, S "The",
phrase volHtGen, S "is assumed constant. Then", eqN 1, S "can be written as"] | 189 | rocTempDerivArbVol :: [Sentence]
rocTempDerivArbVol = [S "We consider an arbitrary" +:+. phrase vol, S "The",
phrase volHtGen, S "is assumed constant. Then", eqN 1, S "can be written as"] | 189 | rocTempDerivArbVol = [S "We consider an arbitrary" +:+. phrase vol, S "The",
phrase volHtGen, S "is assumed constant. Then", eqN 1, S "can be written as"] | 156 | false | true | 0 | 8 | 30 | 64 | 30 | 34 | null | null |
hvr/jhc | src/Cmm/Op.hs | mit | readTy :: Monad m => String -> m Ty
readTy s = case runReadP preadTy s of
Nothing -> fail "readTy: not type"
Just x -> return x | 135 | readTy :: Monad m => String -> m Ty
readTy s = case runReadP preadTy s of
Nothing -> fail "readTy: not type"
Just x -> return x | 135 | readTy s = case runReadP preadTy s of
Nothing -> fail "readTy: not type"
Just x -> return x | 99 | false | true | 0 | 8 | 35 | 58 | 26 | 32 | null | null |
DougBurke/swish | tests/RDFGraphTest.hs | lgpl-2.1 | gm5, gm55 :: RDFGraph
gm5 = NSGraph
{ namespaces = nslist
, formulae = toFM [Formula b1 gm2]
, statements = S.fromList [tm01,tm02,tm03]
} | 172 | gm5, gm55 :: RDFGraph
gm5 = NSGraph
{ namespaces = nslist
, formulae = toFM [Formula b1 gm2]
, statements = S.fromList [tm01,tm02,tm03]
} | 172 | gm5 = NSGraph
{ namespaces = nslist
, formulae = toFM [Formula b1 gm2]
, statements = S.fromList [tm01,tm02,tm03]
} | 150 | false | true | 0 | 9 | 58 | 58 | 34 | 24 | null | null |
patperry/hs-linear-algebra | tests-old/STVector.hs | bsd-3-clause | ------------------------------------------------------------------------
--
-- The specification language
--
abstract :: (BLAS1 e) => STVector s e -> ST s [e]
abstract = getElems' | 185 | abstract :: (BLAS1 e) => STVector s e -> ST s [e]
abstract = getElems' | 70 | abstract = getElems' | 20 | true | true | 0 | 8 | 27 | 41 | 23 | 18 | null | null |
kyk0704/haskell-test | src/Shapes.hs | bsd-3-clause | surface (Rectangle (Point x1 y1) (Point x2 y2)) =
(abs $ x2 - x1) * (abs $ y2 - y1) | 87 | surface (Rectangle (Point x1 y1) (Point x2 y2)) =
(abs $ x2 - x1) * (abs $ y2 - y1) | 87 | surface (Rectangle (Point x1 y1) (Point x2 y2)) =
(abs $ x2 - x1) * (abs $ y2 - y1) | 87 | false | false | 0 | 9 | 23 | 59 | 30 | 29 | null | null |
sdiehl/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | pushAtom
:: StackDepth -> BCEnv -> AnnExpr' Id DVarSet -> BcM (BCInstrList, ByteOff)
pushAtom d p e
| Just e' <- bcView e
= pushAtom d p e' | 149 | pushAtom
:: StackDepth -> BCEnv -> AnnExpr' Id DVarSet -> BcM (BCInstrList, ByteOff)
pushAtom d p e
| Just e' <- bcView e
= pushAtom d p e' | 149 | pushAtom d p e
| Just e' <- bcView e
= pushAtom d p e' | 60 | false | true | 0 | 9 | 37 | 70 | 32 | 38 | null | null |
uuhan/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTT t@(P _ n _)
| n == reflm "Impossible" = return Impossible | 73 | reifyTT t@(P _ n _)
| n == reflm "Impossible" = return Impossible | 73 | reifyTT t@(P _ n _)
| n == reflm "Impossible" = return Impossible | 73 | false | false | 0 | 9 | 20 | 38 | 17 | 21 | null | null |
erantapaa/simple-hunt | src/TarUtil.hs | bsd-3-clause | latestVersions p = foldValues cmp p
where cmp old new = if (pe_version old < pe_version new) then new else old
-- | Return a Producer of the latest packages in an index.tar.gz file.
-- Assume that the packages names appear in sorted order. | 244 | latestVersions p = foldValues cmp p
where cmp old new = if (pe_version old < pe_version new) then new else old
-- | Return a Producer of the latest packages in an index.tar.gz file.
-- Assume that the packages names appear in sorted order. | 244 | latestVersions p = foldValues cmp p
where cmp old new = if (pe_version old < pe_version new) then new else old
-- | Return a Producer of the latest packages in an index.tar.gz file.
-- Assume that the packages names appear in sorted order. | 244 | false | false | 0 | 8 | 48 | 49 | 25 | 24 | null | null |
TravisWhitaker/Metawave | src/Metawave/Parsers/Bitwise.hs | mit | parseWord32le :: A.Parser Word32
parseWord32le = oneoff getWord32le $ A.take 4 | 78 | parseWord32le :: A.Parser Word32
parseWord32le = oneoff getWord32le $ A.take 4 | 78 | parseWord32le = oneoff getWord32le $ A.take 4 | 45 | false | true | 0 | 7 | 10 | 33 | 14 | 19 | null | null |
opqdonut/riot | Riot/Entry.hs | gpl-2.0 | ins_effect_firstunder (l:ll) [] ne = (l+ne):ll | 46 | ins_effect_firstunder (l:ll) [] ne = (l+ne):ll | 46 | ins_effect_firstunder (l:ll) [] ne = (l+ne):ll | 46 | false | false | 0 | 7 | 5 | 33 | 17 | 16 | null | null |
sagi-schein/curvelib | dist/build/autogen/Paths_CurveLib.hs | mit | sysconfdir = "C:\\src\\haskell\\curvelib\\.cabal-sandbox\\etc" | 62 | sysconfdir = "C:\\src\\haskell\\curvelib\\.cabal-sandbox\\etc" | 62 | sysconfdir = "C:\\src\\haskell\\curvelib\\.cabal-sandbox\\etc" | 62 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
xmonad/xmonad-contrib | XMonad/Layout/DecorationMadness.hs | bsd-3-clause | -- | Similar to 'tallSimpleDwmStyle' but with the
-- possibility of setting a custom shrinker and a custom theme.
tallDwmStyle :: Shrinker s => s -> Theme
-> ModifiedLayout (Decoration DwmStyle s) Tall Window
tallDwmStyle s t = decoration s t Dwm tall | 264 | tallDwmStyle :: Shrinker s => s -> Theme
-> ModifiedLayout (Decoration DwmStyle s) Tall Window
tallDwmStyle s t = decoration s t Dwm tall | 150 | tallDwmStyle s t = decoration s t Dwm tall | 42 | true | true | 0 | 10 | 55 | 57 | 28 | 29 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.