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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol | gogol-storage/gen/Network/Google/Storage/Types/Product.hs | mpl-2.0 | -- | The kind of item this is. For lists of objects, this is always
-- storage#objects.
oKind :: Lens' Objects Text
oKind = lens _oKind (\ s a -> s{_oKind = a}) | 160 | oKind :: Lens' Objects Text
oKind = lens _oKind (\ s a -> s{_oKind = a}) | 72 | oKind = lens _oKind (\ s a -> s{_oKind = a}) | 44 | true | true | 0 | 9 | 32 | 41 | 23 | 18 | null | null |
zmoazeni/csscss-haskell | spec/Text/CSS/Shorthand/BackgroundSpec.hs | mit | parseSingle f = fromJust . f . parse | 36 | parseSingle f = fromJust . f . parse | 36 | parseSingle f = fromJust . f . parse | 36 | false | false | 0 | 6 | 7 | 17 | 8 | 9 | null | null |
keithodulaigh/Hets | OWL2/DMU2OWL2.hs | gpl-2.0 | readOWL :: Monad m => String -> m (Sign, [Named Axiom])
readOWL str = case runParser (liftM2 const (basicSpec Map.empty) eof) () "" str of
Left er -> fail $ show er
Right ontoFile -> let
newont = function Expand (StringMap $ prefixDeclaration ontoFile) ontoFile
newstate = execState (extractSign newont) emptySign
in case basicOWL2Analysis
(ontoFile, newstate, emptyGlobalAnnos) of
Result ds ms -> case ms of
Nothing -> fail $ showRelDiags 1 ds
Just (_, ExtSign sig _, sens) -> return (sig, sens) | 532 | readOWL :: Monad m => String -> m (Sign, [Named Axiom])
readOWL str = case runParser (liftM2 const (basicSpec Map.empty) eof) () "" str of
Left er -> fail $ show er
Right ontoFile -> let
newont = function Expand (StringMap $ prefixDeclaration ontoFile) ontoFile
newstate = execState (extractSign newont) emptySign
in case basicOWL2Analysis
(ontoFile, newstate, emptyGlobalAnnos) of
Result ds ms -> case ms of
Nothing -> fail $ showRelDiags 1 ds
Just (_, ExtSign sig _, sens) -> return (sig, sens) | 532 | readOWL str = case runParser (liftM2 const (basicSpec Map.empty) eof) () "" str of
Left er -> fail $ show er
Right ontoFile -> let
newont = function Expand (StringMap $ prefixDeclaration ontoFile) ontoFile
newstate = execState (extractSign newont) emptySign
in case basicOWL2Analysis
(ontoFile, newstate, emptyGlobalAnnos) of
Result ds ms -> case ms of
Nothing -> fail $ showRelDiags 1 ds
Just (_, ExtSign sig _, sens) -> return (sig, sens) | 476 | false | true | 4 | 14 | 117 | 210 | 106 | 104 | null | null |
tjakway/ghcjvm | compiler/typecheck/TcType.hs | bsd-3-clause | to_tc_mapper :: TyCoMapper VarSet Identity
to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet -> TyVar -> Identity Type
tyvar ftvs tv
| Just var <- lookupVarSet ftvs tv = return $ TyVarTy var
| isTcTyVar tv = TyVarTy <$> updateTyVarKindM (to_tc_type ftvs) tv
| otherwise
= do { kind' <- to_tc_type ftvs (tyVarKind tv)
; return $ TyVarTy $ mkTcTyVar (tyVarName tv) kind' vanillaSkolemTv }
covar :: VarSet -> CoVar -> Identity Coercion
covar ftvs cv
| Just var <- lookupVarSet ftvs cv = return $ CoVarCo var
| otherwise = CoVarCo <$> updateVarTypeM (to_tc_type ftvs) cv
hole :: VarSet -> CoercionHole -> Role -> Type -> Type
-> Identity Coercion
hole ftvs h r t1 t2 = mkHoleCo h r <$> to_tc_type ftvs t1
<*> to_tc_type ftvs t2
tybinder :: VarSet -> TyVar -> VisibilityFlag -> Identity (VarSet, TyVar)
tybinder ftvs tv _vis = do { kind' <- to_tc_type ftvs (tyVarKind tv)
; let tv' = mkTcTyVar (tyVarName tv) kind'
vanillaSkolemTv
; return (ftvs `extendVarSet` tv', tv') } | 1,436 | to_tc_mapper :: TyCoMapper VarSet Identity
to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet -> TyVar -> Identity Type
tyvar ftvs tv
| Just var <- lookupVarSet ftvs tv = return $ TyVarTy var
| isTcTyVar tv = TyVarTy <$> updateTyVarKindM (to_tc_type ftvs) tv
| otherwise
= do { kind' <- to_tc_type ftvs (tyVarKind tv)
; return $ TyVarTy $ mkTcTyVar (tyVarName tv) kind' vanillaSkolemTv }
covar :: VarSet -> CoVar -> Identity Coercion
covar ftvs cv
| Just var <- lookupVarSet ftvs cv = return $ CoVarCo var
| otherwise = CoVarCo <$> updateVarTypeM (to_tc_type ftvs) cv
hole :: VarSet -> CoercionHole -> Role -> Type -> Type
-> Identity Coercion
hole ftvs h r t1 t2 = mkHoleCo h r <$> to_tc_type ftvs t1
<*> to_tc_type ftvs t2
tybinder :: VarSet -> TyVar -> VisibilityFlag -> Identity (VarSet, TyVar)
tybinder ftvs tv _vis = do { kind' <- to_tc_type ftvs (tyVarKind tv)
; let tv' = mkTcTyVar (tyVarName tv) kind'
vanillaSkolemTv
; return (ftvs `extendVarSet` tv', tv') } | 1,436 | to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet -> TyVar -> Identity Type
tyvar ftvs tv
| Just var <- lookupVarSet ftvs tv = return $ TyVarTy var
| isTcTyVar tv = TyVarTy <$> updateTyVarKindM (to_tc_type ftvs) tv
| otherwise
= do { kind' <- to_tc_type ftvs (tyVarKind tv)
; return $ TyVarTy $ mkTcTyVar (tyVarName tv) kind' vanillaSkolemTv }
covar :: VarSet -> CoVar -> Identity Coercion
covar ftvs cv
| Just var <- lookupVarSet ftvs cv = return $ CoVarCo var
| otherwise = CoVarCo <$> updateVarTypeM (to_tc_type ftvs) cv
hole :: VarSet -> CoercionHole -> Role -> Type -> Type
-> Identity Coercion
hole ftvs h r t1 t2 = mkHoleCo h r <$> to_tc_type ftvs t1
<*> to_tc_type ftvs t2
tybinder :: VarSet -> TyVar -> VisibilityFlag -> Identity (VarSet, TyVar)
tybinder ftvs tv _vis = do { kind' <- to_tc_type ftvs (tyVarKind tv)
; let tv' = mkTcTyVar (tyVarName tv) kind'
vanillaSkolemTv
; return (ftvs `extendVarSet` tv', tv') } | 1,393 | false | true | 1 | 13 | 520 | 455 | 218 | 237 | null | null |
mgsloan/language-typescript | src/Language/TypeScript/Parser.hs | mit | typeParameter = TypeParameter <$> identifier <*> optionMaybe (reserved "extends" >> _type) | 90 | typeParameter = TypeParameter <$> identifier <*> optionMaybe (reserved "extends" >> _type) | 90 | typeParameter = TypeParameter <$> identifier <*> optionMaybe (reserved "extends" >> _type) | 90 | false | false | 1 | 9 | 10 | 30 | 13 | 17 | null | null |
dmbarbour/awelon | hsrc/ABC/Imperative/Interpreter.hs | bsd-3-clause | op Op_v = v
| 12 | iop Op_v = v | 12 | iop Op_v = v | 12 | false | false | 1 | 4 | 4 | 12 | 4 | 8 | null | null |
phadej/stack | src/Stack/GhcPkg.hs | bsd-3-clause | findGhcPkgVersion :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m, MonadThrow m)
=> EnvOverride
-> WhichCompiler
-> [Path Abs Dir] -- ^ package databases
-> PackageName
-> m (Maybe Version)
findGhcPkgVersion menv wc pkgDbs name = do
mv <- findGhcPkgField menv wc pkgDbs (packageNameString name) "version"
case mv of
Just !v -> return (parseVersion v)
_ -> return Nothing | 502 | findGhcPkgVersion :: (MonadIO m, MonadLogger m, MonadBaseControl IO m, MonadCatch m, MonadThrow m)
=> EnvOverride
-> WhichCompiler
-> [Path Abs Dir] -- ^ package databases
-> PackageName
-> m (Maybe Version)
findGhcPkgVersion menv wc pkgDbs name = do
mv <- findGhcPkgField menv wc pkgDbs (packageNameString name) "version"
case mv of
Just !v -> return (parseVersion v)
_ -> return Nothing | 502 | findGhcPkgVersion menv wc pkgDbs name = do
mv <- findGhcPkgField menv wc pkgDbs (packageNameString name) "version"
case mv of
Just !v -> return (parseVersion v)
_ -> return Nothing | 204 | false | true | 0 | 13 | 173 | 153 | 72 | 81 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/UTF8.hs | gpl-2.0 | readFile :: FilePath -> IO String
readFile f = do
h <- openFile (encodePath f) ReadMode
hGetContents h | 106 | readFile :: FilePath -> IO String
readFile f = do
h <- openFile (encodePath f) ReadMode
hGetContents h | 106 | readFile f = do
h <- openFile (encodePath f) ReadMode
hGetContents h | 72 | false | true | 0 | 11 | 21 | 50 | 21 | 29 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | buildVerbose :: BuildFlags -> Verbosity
buildVerbose = fromFlagOrDefault normal . buildVerbosity | 96 | buildVerbose :: BuildFlags -> Verbosity
buildVerbose = fromFlagOrDefault normal . buildVerbosity | 96 | buildVerbose = fromFlagOrDefault normal . buildVerbosity | 56 | false | true | 0 | 6 | 10 | 22 | 11 | 11 | null | null |
conal/shady-examples | src/SurfaceExamples.hs | agpl-3.0 | a3 :: SB
a3 t = ((1 + sin t / 3) *^) . sphere1 | 46 | a3 :: SB
a3 t = ((1 + sin t / 3) *^) . sphere1 | 46 | a3 t = ((1 + sin t / 3) *^) . sphere1 | 37 | false | true | 0 | 10 | 14 | 36 | 19 | 17 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | happyReduction_155 (_ `HappyStk`
(HappyAbsSyn30 happy_var_3) `HappyStk`
_ `HappyStk`
_ `HappyStk`
happyRest)
= HappyAbsSyn34
(Sizeof happy_var_3
) `HappyStk` happyRest | 234 | happyReduction_155 (_ `HappyStk`
(HappyAbsSyn30 happy_var_3) `HappyStk`
_ `HappyStk`
_ `HappyStk`
happyRest)
= HappyAbsSyn34
(Sizeof happy_var_3
) `HappyStk` happyRest | 234 | happyReduction_155 (_ `HappyStk`
(HappyAbsSyn30 happy_var_3) `HappyStk`
_ `HappyStk`
_ `HappyStk`
happyRest)
= HappyAbsSyn34
(Sizeof happy_var_3
) `HappyStk` happyRest | 234 | false | false | 0 | 10 | 84 | 57 | 33 | 24 | null | null |
andorp/bead | src/Bead/View/TemplateAndComponentNames.hs | bsd-3-clause | delUserFromCourseField = HomeField "del-user-form-course" | 57 | delUserFromCourseField = HomeField "del-user-form-course" | 57 | delUserFromCourseField = HomeField "del-user-form-course" | 57 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ghc-android/ghc | testsuite/tests/ghci/should_run/ghcirun004.hs | bsd-3-clause | 1832 = 1831 | 11 | 1832 = 1831 | 11 | 1832 = 1831 | 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
brendanhay/gogol | gogol-monitoring/gen/Network/Google/Resource/Monitoring/Projects/MonitoredResourceDescriptors/List.hs | mpl-2.0 | -- | Creates a value of 'ProjectsMonitoredResourceDescriptorsList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pmrdlXgafv'
--
-- * 'pmrdlUploadProtocol'
--
-- * 'pmrdlAccessToken'
--
-- * 'pmrdlUploadType'
--
-- * 'pmrdlName'
--
-- * 'pmrdlFilter'
--
-- * 'pmrdlPageToken'
--
-- * 'pmrdlPageSize'
--
-- * 'pmrdlCallback'
projectsMonitoredResourceDescriptorsList
:: Text -- ^ 'pmrdlName'
-> ProjectsMonitoredResourceDescriptorsList
projectsMonitoredResourceDescriptorsList pPmrdlName_ =
ProjectsMonitoredResourceDescriptorsList'
{ _pmrdlXgafv = Nothing
, _pmrdlUploadProtocol = Nothing
, _pmrdlAccessToken = Nothing
, _pmrdlUploadType = Nothing
, _pmrdlName = pPmrdlName_
, _pmrdlFilter = Nothing
, _pmrdlPageToken = Nothing
, _pmrdlPageSize = Nothing
, _pmrdlCallback = Nothing
} | 919 | projectsMonitoredResourceDescriptorsList
:: Text -- ^ 'pmrdlName'
-> ProjectsMonitoredResourceDescriptorsList
projectsMonitoredResourceDescriptorsList pPmrdlName_ =
ProjectsMonitoredResourceDescriptorsList'
{ _pmrdlXgafv = Nothing
, _pmrdlUploadProtocol = Nothing
, _pmrdlAccessToken = Nothing
, _pmrdlUploadType = Nothing
, _pmrdlName = pPmrdlName_
, _pmrdlFilter = Nothing
, _pmrdlPageToken = Nothing
, _pmrdlPageSize = Nothing
, _pmrdlCallback = Nothing
} | 508 | projectsMonitoredResourceDescriptorsList pPmrdlName_ =
ProjectsMonitoredResourceDescriptorsList'
{ _pmrdlXgafv = Nothing
, _pmrdlUploadProtocol = Nothing
, _pmrdlAccessToken = Nothing
, _pmrdlUploadType = Nothing
, _pmrdlName = pPmrdlName_
, _pmrdlFilter = Nothing
, _pmrdlPageToken = Nothing
, _pmrdlPageSize = Nothing
, _pmrdlCallback = Nothing
} | 390 | true | true | 0 | 6 | 164 | 96 | 68 | 28 | null | null |
spechub/Hets | Temporal/ModalCaslToCtl.hs | gpl-2.0 | convert (Casl.A (Casl.B phi psi)) = convert (Casl.A (Casl.Pnot
(Casl.Pnot phi `Casl.U'` psi))) | 102 | convert (Casl.A (Casl.B phi psi)) = convert (Casl.A (Casl.Pnot
(Casl.Pnot phi `Casl.U'` psi))) | 102 | convert (Casl.A (Casl.B phi psi)) = convert (Casl.A (Casl.Pnot
(Casl.Pnot phi `Casl.U'` psi))) | 102 | false | false | 0 | 13 | 20 | 62 | 31 | 31 | null | null |
kolmodin/cabal | Cabal/tests/PackageTests/PackageTester.hs | bsd-3-clause | runInstalledExe :: String -> [String] -> TestM ()
runInstalledExe exe_name args = void (runInstalledExe' exe_name args) | 119 | runInstalledExe :: String -> [String] -> TestM ()
runInstalledExe exe_name args = void (runInstalledExe' exe_name args) | 119 | runInstalledExe exe_name args = void (runInstalledExe' exe_name args) | 69 | false | true | 0 | 8 | 15 | 43 | 21 | 22 | null | null |
ku-fpg/kansas-amber | System/Hardware/Haskino/Data.hs | bsd-3-clause | i2cConfigE :: Arduino (Expr ())
i2cConfigE = Arduino $ primitive $ I2CConfigE | 78 | i2cConfigE :: Arduino (Expr ())
i2cConfigE = Arduino $ primitive $ I2CConfigE | 78 | i2cConfigE = Arduino $ primitive $ I2CConfigE | 46 | false | true | 0 | 8 | 12 | 30 | 15 | 15 | null | null |
olorin/amazonka | amazonka-lambda/gen/Network/AWS/Lambda/Types.hs | mpl-2.0 | -- | One of the parameters in the request is invalid. For example, if you
-- provided an IAM role for AWS Lambda to assume in the 'CreateFunction' or
-- the 'UpdateFunctionConfiguration' API, that AWS Lambda is unable to
-- assume you will get this exception.
_InvalidParameterValueException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterValueException =
_ServiceError . hasStatus 400 . hasCode "InvalidParameterValueException" | 462 | _InvalidParameterValueException :: AsError a => Getting (First ServiceError) a ServiceError
_InvalidParameterValueException =
_ServiceError . hasStatus 400 . hasCode "InvalidParameterValueException" | 202 | _InvalidParameterValueException =
_ServiceError . hasStatus 400 . hasCode "InvalidParameterValueException" | 110 | true | true | 0 | 8 | 68 | 49 | 25 | 24 | null | null |
cartazio/arithmoi | test-suite/Math/NumberTheory/Primes/FactorisationTests.hs | mit | factoriseProperty2 :: Positive Integer -> Bool
factoriseProperty2 (Positive n) = factorise n == factorise (negate n) | 116 | factoriseProperty2 :: Positive Integer -> Bool
factoriseProperty2 (Positive n) = factorise n == factorise (negate n) | 116 | factoriseProperty2 (Positive n) = factorise n == factorise (negate n) | 69 | false | true | 0 | 8 | 15 | 43 | 20 | 23 | null | null |
tjakway/ghcjvm | compiler/coreSyn/CoreSeq.hs | bsd-3-clause | seqBndrs :: [CoreBndr] -> ()
seqBndrs [] = () | 45 | seqBndrs :: [CoreBndr] -> ()
seqBndrs [] = () | 45 | seqBndrs [] = () | 16 | false | true | 0 | 6 | 8 | 27 | 14 | 13 | null | null |
urbanslug/ghc | compiler/prelude/THNames.hs | bsd-3-clause | listEIdKey = mkPreludeMiscIdUnique 292 | 45 | listEIdKey = mkPreludeMiscIdUnique 292 | 45 | listEIdKey = mkPreludeMiscIdUnique 292 | 45 | false | false | 1 | 5 | 10 | 12 | 4 | 8 | null | null |
mcschroeder/ghc | compiler/nativeGen/PPC/Ppr.hs | bsd-3-clause | pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
case topInfoTable proc of
Nothing ->
sdocWithPlatform $ \platform ->
case blocks of
[] -> -- special case for split markers:
pprLabel lbl
blocks -> -- special case for code without info table:
pprSectionAlign (Section Text lbl) $$
(case platformArch platform of
ArchPPC_64 ELF_V1 -> pprFunctionDescriptor lbl
ArchPPC_64 ELF_V2 -> pprFunctionPrologue lbl
_ -> pprLabel lbl) $$ -- blocks guaranteed not null,
-- so label needed
vcat (map (pprBasicBlock top_info) blocks)
Just (Statics info_lbl _) ->
sdocWithPlatform $ \platform ->
pprSectionAlign (Section Text info_lbl) $$
(if platformHasSubsectionsViaSymbols platform
then ppr (mkDeadStripPreventer info_lbl) <> char ':'
else empty) $$
vcat (map (pprBasicBlock top_info) blocks) $$
-- above: Even the first block gets a label, because with branch-chain
-- elimination, it might be the target of a goto.
(if platformHasSubsectionsViaSymbols platform
then
-- See Note [Subsections Via Symbols]
text "\t.long "
<+> ppr info_lbl
<+> char '-'
<+> ppr (mkDeadStripPreventer info_lbl)
else empty) | 1,410 | pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
case topInfoTable proc of
Nothing ->
sdocWithPlatform $ \platform ->
case blocks of
[] -> -- special case for split markers:
pprLabel lbl
blocks -> -- special case for code without info table:
pprSectionAlign (Section Text lbl) $$
(case platformArch platform of
ArchPPC_64 ELF_V1 -> pprFunctionDescriptor lbl
ArchPPC_64 ELF_V2 -> pprFunctionPrologue lbl
_ -> pprLabel lbl) $$ -- blocks guaranteed not null,
-- so label needed
vcat (map (pprBasicBlock top_info) blocks)
Just (Statics info_lbl _) ->
sdocWithPlatform $ \platform ->
pprSectionAlign (Section Text info_lbl) $$
(if platformHasSubsectionsViaSymbols platform
then ppr (mkDeadStripPreventer info_lbl) <> char ':'
else empty) $$
vcat (map (pprBasicBlock top_info) blocks) $$
-- above: Even the first block gets a label, because with branch-chain
-- elimination, it might be the target of a goto.
(if platformHasSubsectionsViaSymbols platform
then
-- See Note [Subsections Via Symbols]
text "\t.long "
<+> ppr info_lbl
<+> char '-'
<+> ppr (mkDeadStripPreventer info_lbl)
else empty) | 1,410 | pprNatCmmDecl proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
case topInfoTable proc of
Nothing ->
sdocWithPlatform $ \platform ->
case blocks of
[] -> -- special case for split markers:
pprLabel lbl
blocks -> -- special case for code without info table:
pprSectionAlign (Section Text lbl) $$
(case platformArch platform of
ArchPPC_64 ELF_V1 -> pprFunctionDescriptor lbl
ArchPPC_64 ELF_V2 -> pprFunctionPrologue lbl
_ -> pprLabel lbl) $$ -- blocks guaranteed not null,
-- so label needed
vcat (map (pprBasicBlock top_info) blocks)
Just (Statics info_lbl _) ->
sdocWithPlatform $ \platform ->
pprSectionAlign (Section Text info_lbl) $$
(if platformHasSubsectionsViaSymbols platform
then ppr (mkDeadStripPreventer info_lbl) <> char ':'
else empty) $$
vcat (map (pprBasicBlock top_info) blocks) $$
-- above: Even the first block gets a label, because with branch-chain
-- elimination, it might be the target of a goto.
(if platformHasSubsectionsViaSymbols platform
then
-- See Note [Subsections Via Symbols]
text "\t.long "
<+> ppr info_lbl
<+> char '-'
<+> ppr (mkDeadStripPreventer info_lbl)
else empty) | 1,410 | false | false | 0 | 19 | 463 | 299 | 147 | 152 | null | null |
rbermani/ib-api | src/IB/Client/Types.hs | gpl-3.0 | msgToId msg | otherwise = conToId msg | 37 | msgToId msg | otherwise = conToId msg | 37 | msgToId msg | otherwise = conToId msg | 37 | false | false | 0 | 7 | 6 | 18 | 7 | 11 | null | null |
text-utf8/text | tests/Tests/Properties.hs | bsd-2-clause | t_any p = L.any p `eqP` T.any p | 47 | t_any p = L.any p `eqP` T.any p | 47 | t_any p = L.any p `eqP` T.any p | 47 | false | false | 0 | 7 | 23 | 25 | 12 | 13 | null | null |
michalkonecny/polypaver | src/Numeric/ER/Real/Base/Float.hs | bsd-3-clause | apfloatFromRational ::
Granularity -> Rational -> ERFloat
apfloatFromRational gran rat =
(setERFloatMinGranularity gran (fromInteger $ numerator rat))
/ (fromInteger $ denominator rat) | 202 | apfloatFromRational ::
Granularity -> Rational -> ERFloat
apfloatFromRational gran rat =
(setERFloatMinGranularity gran (fromInteger $ numerator rat))
/ (fromInteger $ denominator rat) | 202 | apfloatFromRational gran rat =
(setERFloatMinGranularity gran (fromInteger $ numerator rat))
/ (fromInteger $ denominator rat) | 140 | false | true | 2 | 9 | 39 | 58 | 28 | 30 | null | null |
wxwxwwxxx/ghc | libraries/base/GHC/List.hs | bsd-3-clause | foldl1' _ [] = errorEmptyList "foldl1'" | 52 | foldl1' _ [] = errorEmptyList "foldl1'" | 52 | foldl1' _ [] = errorEmptyList "foldl1'" | 52 | false | false | 0 | 6 | 18 | 16 | 7 | 9 | null | null |
abakst/liquidhaskell | src/Language/Haskell/Liquid/Constraint/ProofToCore.hs | bsd-3-clause | -- | Filling up dictionaries
makeDictionaries dname e = go (exprType e)
where
go (ForAllTy _ t) = go t
go (FunTy tx t ) | isClassPred tx = (makeDictionary dname tx):go t
go _ = [] | 207 | makeDictionaries dname e = go (exprType e)
where
go (ForAllTy _ t) = go t
go (FunTy tx t ) | isClassPred tx = (makeDictionary dname tx):go t
go _ = [] | 178 | makeDictionaries dname e = go (exprType e)
where
go (ForAllTy _ t) = go t
go (FunTy tx t ) | isClassPred tx = (makeDictionary dname tx):go t
go _ = [] | 178 | true | false | 0 | 8 | 64 | 96 | 43 | 53 | null | null |
romanb/wai-route | src/Network/Wai/Route.hs | mpl-2.0 | -- | Capture a parameter as an unnamed variable, e.g.
--
-- >>> let p = some @Text ./ end
-- >>> :t p
-- p :: Path '[Some Text]
some :: (Eq a, FromHttpApiData a)
=> Path vars
-> Path (Some a ': vars)
some = var @"" | 222 | some :: (Eq a, FromHttpApiData a)
=> Path vars
-> Path (Some a ': vars)
some = var @"" | 94 | some = var @"" | 14 | true | true | 0 | 11 | 56 | 64 | 32 | 32 | null | null |
charukiewicz/charukiewicz | site.hs | apache-2.0 | directory :: (Pattern -> Rules a) -> String -> Rules a
directory act f = act $ fromGlob $ f ++ "/**" | 100 | directory :: (Pattern -> Rules a) -> String -> Rules a
directory act f = act $ fromGlob $ f ++ "/**" | 100 | directory act f = act $ fromGlob $ f ++ "/**" | 45 | false | true | 0 | 8 | 21 | 49 | 24 | 25 | null | null |
cjlarose/advent-2016 | src/BathroomSecurity.hs | bsd-3-clause | directionLine = many1 direction <* eol | 38 | directionLine = many1 direction <* eol | 38 | directionLine = many1 direction <* eol | 38 | false | false | 0 | 6 | 5 | 13 | 6 | 7 | null | null |
mrmonday/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSExt ITChar (ITFixed to)) [x]
= doOp v (LSExt ITNative (ITFixed to)) [x] | 85 | doOp v (LSExt ITChar (ITFixed to)) [x]
= doOp v (LSExt ITNative (ITFixed to)) [x] | 85 | doOp v (LSExt ITChar (ITFixed to)) [x]
= doOp v (LSExt ITNative (ITFixed to)) [x] | 85 | false | false | 0 | 9 | 18 | 54 | 27 | 27 | null | null |
vaibhavsagar/duffer.hs | duffer-json/src/Duffer/JSON.hs | bsd-3-clause | treeEntryPairs :: KeyValue t => TreeEntry -> [t]
treeEntryPairs TreeEntry {..} =
["mode" .= octMode, "name" .= dName, "ref" .= dRef]
where octMode = T.pack $ printf "%06o" (fromEnum entryPerms) :: T.Text
dName = E.decodeUtf8 entryName
dRef = decodeRef entryRef | 293 | treeEntryPairs :: KeyValue t => TreeEntry -> [t]
treeEntryPairs TreeEntry {..} =
["mode" .= octMode, "name" .= dName, "ref" .= dRef]
where octMode = T.pack $ printf "%06o" (fromEnum entryPerms) :: T.Text
dName = E.decodeUtf8 entryName
dRef = decodeRef entryRef | 293 | treeEntryPairs TreeEntry {..} =
["mode" .= octMode, "name" .= dName, "ref" .= dRef]
where octMode = T.pack $ printf "%06o" (fromEnum entryPerms) :: T.Text
dName = E.decodeUtf8 entryName
dRef = decodeRef entryRef | 244 | false | true | 0 | 10 | 72 | 102 | 53 | 49 | null | null |
SPbAU-ProgrammingParadigms/materials | haskell_2/mysum3.hs | unlicense | mysum acc (x:xs) = n `seq` mysum n xs where n = acc + x | 55 | mysum acc (x:xs) = n `seq` mysum n xs where n = acc + x | 55 | mysum acc (x:xs) = n `seq` mysum n xs where n = acc + x | 55 | false | false | 0 | 7 | 14 | 40 | 21 | 19 | null | null |
eigengrau/hlint | data/Default.hs | bsd-3-clause | error = head (drop n x) ==> x !! n where _ = isNat n | 52 | error = head (drop n x) ==> x !! n where _ = isNat n | 52 | error = head (drop n x) ==> x !! n where _ = isNat n | 52 | false | false | 0 | 9 | 14 | 39 | 18 | 21 | null | null |
DanielSchuessler/hstri | bin/blenderify.hs | gpl-3.0 | inter :: Double -> Vertex -> Vertex -> Vec3
inter p = interpolate p `on` co
where
co :: Vertex -> Vec3
co = vertlbl tet3d | 141 | inter :: Double -> Vertex -> Vertex -> Vec3
inter p = interpolate p `on` co
where
co :: Vertex -> Vec3
co = vertlbl tet3d | 141 | inter p = interpolate p `on` co
where
co :: Vertex -> Vec3
co = vertlbl tet3d | 97 | false | true | 0 | 9 | 45 | 67 | 30 | 37 | null | null |
ezyang/ghc | testsuite/tests/th/T5700a.hs | bsd-3-clause | mkC :: Name -> Q [Dec]
mkC n = return
[InstanceD Nothing [] (AppT (ConT ''C) (ConT n))
[ FunD 'inlinable [Clause [WildP] (NormalB (ConE '())) []],
PragmaD (InlineP 'inlinable Inline FunLike AllPhases)
]
] | 227 | mkC :: Name -> Q [Dec]
mkC n = return
[InstanceD Nothing [] (AppT (ConT ''C) (ConT n))
[ FunD 'inlinable [Clause [WildP] (NormalB (ConE '())) []],
PragmaD (InlineP 'inlinable Inline FunLike AllPhases)
]
] | 227 | mkC n = return
[InstanceD Nothing [] (AppT (ConT ''C) (ConT n))
[ FunD 'inlinable [Clause [WildP] (NormalB (ConE '())) []],
PragmaD (InlineP 'inlinable Inline FunLike AllPhases)
]
] | 204 | false | true | 0 | 14 | 57 | 121 | 63 | 58 | null | null |
allanderek/ipclib | Language/Pepa/Print.hs | gpl-2.0 | pprintComponent (IdProcess ident) = pprintComponentName ident | 82 | pprintComponent (IdProcess ident) = pprintComponentName ident | 82 | pprintComponent (IdProcess ident) = pprintComponentName ident | 82 | false | false | 0 | 7 | 26 | 18 | 8 | 10 | null | null |
acowley/concurrent-machines | tests/SPlotTests.hs | bsd-3-clause | main :: IO ()
main = do
catch
(T.defaultMain
(T.testGroup "concurrent-machines"
[ pipeline, buffering1, rolling1, workStealing ]))
(\e -> if e == ExitSuccess
then return ()
else throwIO e)
when writeSPlot $ do
let splots = [ "pipeline-seq.splot"
, "pipeline-par.splot"
, "buffering1-seq.splot"
, "buffering1-par.splot"
, "rolling1-seq.splot"
, "rolling1-par.splot"
, "work-stealing-seq.splot"
, "work-stealing-par.splot"
]
forM_ splots $ \path -> do
l:_ <- lines <$> readFile path
case readP_to_S (readPTime False defaultTimeLocale "%Y-%m-%d %H:%M:%S%Q") l of
[] ->
fail "Shit no."
(fromTime,_):_ -> do
let toTime = addUTCTime 2.5 fromTime
let args = [ "-if", path
, "-o", path ++ ".png"
, "-w", "2048"
, "-h", "200"
, "-bh", "1"
, "-tickInterval", "100"
, "-legendWidth", "20"
, "-numTracks", "4"
, "-fromTime", showTime fromTime
, "-toTime", showTime toTime
]
Proc.readProcess "splot" args "" >>= putStr
putStrLn $ "OK: " ++ show (fromTime :: UTCTime) ++ " " ++ path
exitSuccess | 1,466 | main :: IO ()
main = do
catch
(T.defaultMain
(T.testGroup "concurrent-machines"
[ pipeline, buffering1, rolling1, workStealing ]))
(\e -> if e == ExitSuccess
then return ()
else throwIO e)
when writeSPlot $ do
let splots = [ "pipeline-seq.splot"
, "pipeline-par.splot"
, "buffering1-seq.splot"
, "buffering1-par.splot"
, "rolling1-seq.splot"
, "rolling1-par.splot"
, "work-stealing-seq.splot"
, "work-stealing-par.splot"
]
forM_ splots $ \path -> do
l:_ <- lines <$> readFile path
case readP_to_S (readPTime False defaultTimeLocale "%Y-%m-%d %H:%M:%S%Q") l of
[] ->
fail "Shit no."
(fromTime,_):_ -> do
let toTime = addUTCTime 2.5 fromTime
let args = [ "-if", path
, "-o", path ++ ".png"
, "-w", "2048"
, "-h", "200"
, "-bh", "1"
, "-tickInterval", "100"
, "-legendWidth", "20"
, "-numTracks", "4"
, "-fromTime", showTime fromTime
, "-toTime", showTime toTime
]
Proc.readProcess "splot" args "" >>= putStr
putStrLn $ "OK: " ++ show (fromTime :: UTCTime) ++ " " ++ path
exitSuccess | 1,466 | main = do
catch
(T.defaultMain
(T.testGroup "concurrent-machines"
[ pipeline, buffering1, rolling1, workStealing ]))
(\e -> if e == ExitSuccess
then return ()
else throwIO e)
when writeSPlot $ do
let splots = [ "pipeline-seq.splot"
, "pipeline-par.splot"
, "buffering1-seq.splot"
, "buffering1-par.splot"
, "rolling1-seq.splot"
, "rolling1-par.splot"
, "work-stealing-seq.splot"
, "work-stealing-par.splot"
]
forM_ splots $ \path -> do
l:_ <- lines <$> readFile path
case readP_to_S (readPTime False defaultTimeLocale "%Y-%m-%d %H:%M:%S%Q") l of
[] ->
fail "Shit no."
(fromTime,_):_ -> do
let toTime = addUTCTime 2.5 fromTime
let args = [ "-if", path
, "-o", path ++ ".png"
, "-w", "2048"
, "-h", "200"
, "-bh", "1"
, "-tickInterval", "100"
, "-legendWidth", "20"
, "-numTracks", "4"
, "-fromTime", showTime fromTime
, "-toTime", showTime toTime
]
Proc.readProcess "splot" args "" >>= putStr
putStrLn $ "OK: " ++ show (fromTime :: UTCTime) ++ " " ++ path
exitSuccess | 1,452 | false | true | 0 | 20 | 632 | 348 | 182 | 166 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp ReadJIntArrayOp = _ILIT(1126) | 42 | tagOf_PrimOp ReadJIntArrayOp = _ILIT(1126) | 42 | tagOf_PrimOp ReadJIntArrayOp = _ILIT(1126) | 42 | false | false | 0 | 6 | 3 | 15 | 7 | 8 | null | null |
ygale/yesod | yesod-auth/Yesod/Auth.hs | mit | messageJsonStatus :: MonadResourceBase m
=> Status
-> Text
-> HandlerT master m Html
-> HandlerT master m TypedContent
messageJsonStatus status msg html = selectRep $ do
provideRep html
provideRep $ do
let obj = object ["message" .= msg]
void $ sendResponseStatus status obj
return obj | 389 | messageJsonStatus :: MonadResourceBase m
=> Status
-> Text
-> HandlerT master m Html
-> HandlerT master m TypedContent
messageJsonStatus status msg html = selectRep $ do
provideRep html
provideRep $ do
let obj = object ["message" .= msg]
void $ sendResponseStatus status obj
return obj | 389 | messageJsonStatus status msg html = selectRep $ do
provideRep html
provideRep $ do
let obj = object ["message" .= msg]
void $ sendResponseStatus status obj
return obj | 198 | false | true | 0 | 16 | 148 | 105 | 47 | 58 | null | null |
dmp1ce/Haskell-Programming-Exercises | Chapter 24/src/ChapterExercises_5.hs | unlicense | printAverageForEachActivity :: IO ()
printAverageForEachActivity = do
let avg = maybe (0) (activityAverage . sumTimeForEachActivity) $
maybeSuccess $ parseString parseLog mempty logFile
putStrLn $ showFloat (fromRat avg::Double) ""
-- Verify Bidirectional parsing is working for some the constructed
-- Arbitrary Log | 333 | printAverageForEachActivity :: IO ()
printAverageForEachActivity = do
let avg = maybe (0) (activityAverage . sumTimeForEachActivity) $
maybeSuccess $ parseString parseLog mempty logFile
putStrLn $ showFloat (fromRat avg::Double) ""
-- Verify Bidirectional parsing is working for some the constructed
-- Arbitrary Log | 333 | printAverageForEachActivity = do
let avg = maybe (0) (activityAverage . sumTimeForEachActivity) $
maybeSuccess $ parseString parseLog mempty logFile
putStrLn $ showFloat (fromRat avg::Double) ""
-- Verify Bidirectional parsing is working for some the constructed
-- Arbitrary Log | 296 | false | true | 0 | 14 | 57 | 78 | 39 | 39 | null | null |
ambiata/highlighting-kate | Text/Highlighting/Kate/Syntax/Javascript.hs | gpl-2.0 | list_reserved = Set.fromList $ words $ "class enum extends super implements interface let private protected public static yield" | 128 | list_reserved = Set.fromList $ words $ "class enum extends super implements interface let private protected public static yield" | 128 | list_reserved = Set.fromList $ words $ "class enum extends super implements interface let private protected public static yield" | 128 | false | false | 0 | 7 | 17 | 16 | 8 | 8 | null | null |
pbv/codex | src/Codex/Utils.hs | mit | isAdmin :: AuthUser -> Bool
isAdmin au = Role "admin" `elem` userRoles au | 73 | isAdmin :: AuthUser -> Bool
isAdmin au = Role "admin" `elem` userRoles au | 73 | isAdmin au = Role "admin" `elem` userRoles au | 45 | false | true | 0 | 6 | 12 | 30 | 15 | 15 | null | null |
katydid/nwe | src/Deriv.hs | bsd-3-clause | derivReturn refs input (Reference name) ns = derivReturn refs input (lookupRef refs name) ns | 92 | derivReturn refs input (Reference name) ns = derivReturn refs input (lookupRef refs name) ns | 92 | derivReturn refs input (Reference name) ns = derivReturn refs input (lookupRef refs name) ns | 92 | false | false | 0 | 7 | 13 | 38 | 18 | 20 | null | null |
achirkin/fgeom | src/Geometry/Math/Calculus.hs | bsd-3-clause | derivative ThreePoint dx f x = (f1 .- f0) /.. (2*dx)
where f0 = mapColumns f $ xm .- ddx
f1 = mapColumns f $ xm .+ ddx
xm = fromRowCol $ pure x
ddx = toDiag dx | 193 | derivative ThreePoint dx f x = (f1 .- f0) /.. (2*dx)
where f0 = mapColumns f $ xm .- ddx
f1 = mapColumns f $ xm .+ ddx
xm = fromRowCol $ pure x
ddx = toDiag dx | 193 | derivative ThreePoint dx f x = (f1 .- f0) /.. (2*dx)
where f0 = mapColumns f $ xm .- ddx
f1 = mapColumns f $ xm .+ ddx
xm = fromRowCol $ pure x
ddx = toDiag dx | 193 | false | false | 3 | 10 | 71 | 91 | 44 | 47 | null | null |
JPMoresmau/leksah | tests/Tests.hs | gpl-2.0 | prop_parseHiddenModule = parseHiddenModule testString == Just HiddenModuleResult {hiddenModule = "Graphics.UI.Gtk", missingPackage = PackageIdentifier {pkgName = PackageName "gtk", pkgVersion = Version {versionBranch = [0,11,0], versionTags = []}}} | 248 | prop_parseHiddenModule = parseHiddenModule testString == Just HiddenModuleResult {hiddenModule = "Graphics.UI.Gtk", missingPackage = PackageIdentifier {pkgName = PackageName "gtk", pkgVersion = Version {versionBranch = [0,11,0], versionTags = []}}} | 248 | prop_parseHiddenModule = parseHiddenModule testString == Just HiddenModuleResult {hiddenModule = "Graphics.UI.Gtk", missingPackage = PackageIdentifier {pkgName = PackageName "gtk", pkgVersion = Version {versionBranch = [0,11,0], versionTags = []}}} | 248 | false | false | 0 | 13 | 25 | 72 | 42 | 30 | null | null |
GaloisInc/ivory | ivory-examples/examples/Alloc.hs | bsd-3-clause | runAlloc :: IO ()
runAlloc = runCompiler [cmodule] [] initialOpts { outDir = Nothing } | 86 | runAlloc :: IO ()
runAlloc = runCompiler [cmodule] [] initialOpts { outDir = Nothing } | 86 | runAlloc = runCompiler [cmodule] [] initialOpts { outDir = Nothing } | 68 | false | true | 0 | 7 | 14 | 36 | 19 | 17 | null | null |
flyrry/tictactoe | src/TicTacToe/Board.hs | mit | nextPlayer ((PlayerO,_):_) = PlayerX | 36 | nextPlayer ((PlayerO,_):_) = PlayerX | 36 | nextPlayer ((PlayerO,_):_) = PlayerX | 36 | false | false | 0 | 7 | 3 | 23 | 12 | 11 | null | null |
prl-tokyo/bigul-configuration-adaptation | Transformations/src/Generics/BiGUL/TH.hs | mit | constructorToProduct :: (Name, Name, Name, Name, Name) -> ([Maybe Name], Con) -> Type
constructorToProduct (k1, r, u1, prod, s1) (_, NormalC _ [] ) = ConT u1 | 161 | constructorToProduct :: (Name, Name, Name, Name, Name) -> ([Maybe Name], Con) -> Type
constructorToProduct (k1, r, u1, prod, s1) (_, NormalC _ [] ) = ConT u1 | 161 | constructorToProduct (k1, r, u1, prod, s1) (_, NormalC _ [] ) = ConT u1 | 75 | false | true | 0 | 9 | 30 | 82 | 47 | 35 | null | null |
gleber/erlhask | src/Language/Erlang/Bifs.hs | apache-2.0 | random :: ErlModule
random =
HModule "random" (
M.fromList [(("uniform", 0), ErlStdFun random_uniform)]) | 110 | random :: ErlModule
random =
HModule "random" (
M.fromList [(("uniform", 0), ErlStdFun random_uniform)]) | 110 | random =
HModule "random" (
M.fromList [(("uniform", 0), ErlStdFun random_uniform)]) | 90 | false | true | 0 | 10 | 18 | 50 | 24 | 26 | null | null |
frenetic-lang/nettle-openflow | src/Nettle/OpenFlow/MessagesBinary.hs | bsd-3-clause | typeOfAction :: Action -> ActionType
typeOfAction a =
case a of
SendOutPort _ -> OutputToPortType
SetVlanVID _ -> SetVlanVIDType
SetVlanPriority _ -> SetVlanPriorityType
StripVlanHeader -> StripVlanHeaderType
SetEthSrcAddr _ -> SetEthSrcAddrType
SetEthDstAddr _ -> SetEthDstAddrType
SetIPSrcAddr _ -> SetIPSrcAddrType
SetIPDstAddr _ -> SetIPDstAddrType
SetIPToS _ -> SetIPTypeOfServiceType
SetTransportSrcPort _ -> SetTransportSrcPortType
SetTransportDstPort _ -> SetTransportDstPortType
Enqueue _ _ -> EnqueueType
VendorAction _ _ -> VendorActionType
| 714 | typeOfAction :: Action -> ActionType
typeOfAction a =
case a of
SendOutPort _ -> OutputToPortType
SetVlanVID _ -> SetVlanVIDType
SetVlanPriority _ -> SetVlanPriorityType
StripVlanHeader -> StripVlanHeaderType
SetEthSrcAddr _ -> SetEthSrcAddrType
SetEthDstAddr _ -> SetEthDstAddrType
SetIPSrcAddr _ -> SetIPSrcAddrType
SetIPDstAddr _ -> SetIPDstAddrType
SetIPToS _ -> SetIPTypeOfServiceType
SetTransportSrcPort _ -> SetTransportSrcPortType
SetTransportDstPort _ -> SetTransportDstPortType
Enqueue _ _ -> EnqueueType
VendorAction _ _ -> VendorActionType
| 714 | typeOfAction a =
case a of
SendOutPort _ -> OutputToPortType
SetVlanVID _ -> SetVlanVIDType
SetVlanPriority _ -> SetVlanPriorityType
StripVlanHeader -> StripVlanHeaderType
SetEthSrcAddr _ -> SetEthSrcAddrType
SetEthDstAddr _ -> SetEthDstAddrType
SetIPSrcAddr _ -> SetIPSrcAddrType
SetIPDstAddr _ -> SetIPDstAddrType
SetIPToS _ -> SetIPTypeOfServiceType
SetTransportSrcPort _ -> SetTransportSrcPortType
SetTransportDstPort _ -> SetTransportDstPortType
Enqueue _ _ -> EnqueueType
VendorAction _ _ -> VendorActionType
| 677 | false | true | 0 | 8 | 226 | 145 | 65 | 80 | null | null |
gnn/hsgsom | Data/Datamining/Clustering/Gsom/node.hs | bsd-3-clause | -- | @'left' direction@ returns the index which points to the left of
-- @direction@.
left i = (i+1) `mod` 4 | 108 | left i = (i+1) `mod` 4 | 22 | left i = (i+1) `mod` 4 | 22 | true | false | 1 | 6 | 20 | 30 | 15 | 15 | null | null |
esengie/fpl-exploration-tool | src/langGenerator/Lang.hs | bsd-3-clause | fromScope3 x = fromScope $ fromScope2 x | 39 | fromScope3 x = fromScope $ fromScope2 x | 39 | fromScope3 x = fromScope $ fromScope2 x | 39 | false | false | 0 | 6 | 6 | 16 | 7 | 9 | null | null |
forsyde/forsyde-shallow | src/ForSyDe/Shallow/MoC/SADF.hs | bsd-3-clause | inpOut5n ((it, _, f):-xs) = (it, 1, \a b c d e -> [f a b c d e]) :- inpOut5n xs | 79 | inpOut5n ((it, _, f):-xs) = (it, 1, \a b c d e -> [f a b c d e]) :- inpOut5n xs | 79 | inpOut5n ((it, _, f):-xs) = (it, 1, \a b c d e -> [f a b c d e]) :- inpOut5n xs | 79 | false | false | 0 | 9 | 21 | 69 | 37 | 32 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/catchHugsException_1.hs | mit | pt :: (c -> b) -> (a -> c) -> a -> b;
pt f g x = f (g x) | 66 | pt :: (c -> b) -> (a -> c) -> a -> b
pt f g x = f (g x) | 65 | pt f g x = f (g x) | 18 | false | true | 0 | 8 | 30 | 54 | 28 | 26 | null | null |
patrikja/progolymp | open/towers/Main.hs | bsd-3-clause | -- TODO: complete the last case
-- TODO: find performance bugs (finding big primes is too costly - don't call factorise unless factors are known to be small)
{-
λ> findProblemseqPert2
*** Failed! Exception: 'eqPert2 (1,[2,2,7]) 1 (1,[2,11,2])' (after 2 tests and 99 shrinks):
Positive {getPositive = 1}
1
Positive {getPositive = 1}
[2,2,7]
[2,11,2]
-- other examples:
eqPert2 (1,[21,88]) 1 (1,[99,99])
-}
findProblemseqPert2 =
quickCheck (\(Positive a) m (Positive j) ->
forAllShrink genPT shPT $ \is ->
forAllShrink genPT shPT $ \js ->
eqPert2 (a,is) m (j,js) `seq` True) | 625 | findProblemseqPert2 =
quickCheck (\(Positive a) m (Positive j) ->
forAllShrink genPT shPT $ \is ->
forAllShrink genPT shPT $ \js ->
eqPert2 (a,is) m (j,js) `seq` True) | 217 | findProblemseqPert2 =
quickCheck (\(Positive a) m (Positive j) ->
forAllShrink genPT shPT $ \is ->
forAllShrink genPT shPT $ \js ->
eqPert2 (a,is) m (j,js) `seq` True) | 217 | true | false | 0 | 14 | 142 | 89 | 49 | 40 | null | null |
ekmett/doctest | test/ParseSpec.hs | mit | spec :: Spec
spec = do
describe "getDocTests" $ do
it "extracts properties from a module" $ do
getDocTests ["test/parse/property/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
prop_ "foo"
prop_ "bar"
prop_ "baz"
it "extracts examples from a module" $ do
getDocTests ["test/parse/simple/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts examples from documentation for non-exported names" $ do
getDocTests ["test/parse/non-exported/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts multiple examples from a module" $ do
getDocTests ["test/parse/multiple-examples/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
group $ do
ghci "bar"
"42"
it "returns an empty list, if documentation contains no examples" $ do
getDocTests ["test/parse/no-examples/Fib.hs"] >>= (`shouldBe` [])
it "sets setup code to Nothing, if it does not contain any tests" $ do
getDocTests ["test/parse/setup-empty/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
it "keeps modules that only contain setup code" $ do
getDocTests ["test/parse/setup-only/Foo.hs"] `shouldGive` do
tell [Module "Foo" (Just [Example "foo" ["23"]]) []]
describe "parseInteractions (an internal function)" $ do
let parse_ = map unLoc . parseInteractions . noLocation . build
it "parses an interaction" $ do
parse_ $ do
">>> foo"
"23"
`shouldBe` [("foo", ["23"])] | 2,068 | spec :: Spec
spec = do
describe "getDocTests" $ do
it "extracts properties from a module" $ do
getDocTests ["test/parse/property/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
prop_ "foo"
prop_ "bar"
prop_ "baz"
it "extracts examples from a module" $ do
getDocTests ["test/parse/simple/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts examples from documentation for non-exported names" $ do
getDocTests ["test/parse/non-exported/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts multiple examples from a module" $ do
getDocTests ["test/parse/multiple-examples/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
group $ do
ghci "bar"
"42"
it "returns an empty list, if documentation contains no examples" $ do
getDocTests ["test/parse/no-examples/Fib.hs"] >>= (`shouldBe` [])
it "sets setup code to Nothing, if it does not contain any tests" $ do
getDocTests ["test/parse/setup-empty/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
it "keeps modules that only contain setup code" $ do
getDocTests ["test/parse/setup-only/Foo.hs"] `shouldGive` do
tell [Module "Foo" (Just [Example "foo" ["23"]]) []]
describe "parseInteractions (an internal function)" $ do
let parse_ = map unLoc . parseInteractions . noLocation . build
it "parses an interaction" $ do
parse_ $ do
">>> foo"
"23"
`shouldBe` [("foo", ["23"])] | 2,068 | spec = do
describe "getDocTests" $ do
it "extracts properties from a module" $ do
getDocTests ["test/parse/property/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
prop_ "foo"
prop_ "bar"
prop_ "baz"
it "extracts examples from a module" $ do
getDocTests ["test/parse/simple/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts examples from documentation for non-exported names" $ do
getDocTests ["test/parse/non-exported/Fib.hs"] `shouldGive` do
module_ "Fib" $ do
group $ do
ghci "putStrLn \"foo\""
"foo"
ghci "putStr \"bar\""
"bar"
ghci "putStrLn \"baz\""
"baz"
it "extracts multiple examples from a module" $ do
getDocTests ["test/parse/multiple-examples/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
group $ do
ghci "bar"
"42"
it "returns an empty list, if documentation contains no examples" $ do
getDocTests ["test/parse/no-examples/Fib.hs"] >>= (`shouldBe` [])
it "sets setup code to Nothing, if it does not contain any tests" $ do
getDocTests ["test/parse/setup-empty/Foo.hs"] `shouldGive` do
module_ "Foo" $ do
group $ do
ghci "foo"
"23"
it "keeps modules that only contain setup code" $ do
getDocTests ["test/parse/setup-only/Foo.hs"] `shouldGive` do
tell [Module "Foo" (Just [Example "foo" ["23"]]) []]
describe "parseInteractions (an internal function)" $ do
let parse_ = map unLoc . parseInteractions . noLocation . build
it "parses an interaction" $ do
parse_ $ do
">>> foo"
"23"
`shouldBe` [("foo", ["23"])] | 2,055 | false | true | 0 | 46 | 725 | 505 | 223 | 282 | null | null |
jcollard/simple-server | Network/SimpleServer/Examples/ChatServer.hs | gpl-3.0 | -- Keys
-- The display name for a ClientConn
username = "username" | 66 | username = "username" | 21 | username = "username" | 21 | true | false | 0 | 4 | 11 | 8 | 5 | 3 | null | null |
benkolera/talk-stacking-your-monads | code/src/Utils.hs | mit | throwAccValidation :: (Applicative m, MonadError e m) => (es -> e) -> AccValidation es a -> m a
throwAccValidation f (AccFailure es) = throwError (f es) | 152 | throwAccValidation :: (Applicative m, MonadError e m) => (es -> e) -> AccValidation es a -> m a
throwAccValidation f (AccFailure es) = throwError (f es) | 152 | throwAccValidation f (AccFailure es) = throwError (f es) | 56 | false | true | 0 | 8 | 25 | 71 | 35 | 36 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/lens/2019-12-chris-penner-advent-of-optics/test/TestDay01.hs | unlicense | test_iterated :: TestTree
test_iterated =
testGroup "test_day01_iterated"
[ -- Note: iterated emits first input without any iteration
testCase "chris" $
1 ^.. taking 10 (iterated (+1)) @?=
[1,2,3,4,5,6,7,8,9,10::Int]
, testCase " 1969 listOf" $
1969 ^.. taking 7 (iterated calculateRequiredFuel) @?=
[1969,654,216,70,21,5,-1]
, testCase " 1969 sumOf" $
(1969 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
966.0
, testCase "100756 listOf" $
100756 ^.. taking 12 (iterated calculateRequiredFuel) @?=
[100756.0,33583.0,11192.0,3728.0,1240.0,411.0,135.0,43.0,12.0,2.0,-2.0,-3.0]
, testCase "100756 sumOf" $
(100756 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
50346.0
] | 795 | test_iterated :: TestTree
test_iterated =
testGroup "test_day01_iterated"
[ -- Note: iterated emits first input without any iteration
testCase "chris" $
1 ^.. taking 10 (iterated (+1)) @?=
[1,2,3,4,5,6,7,8,9,10::Int]
, testCase " 1969 listOf" $
1969 ^.. taking 7 (iterated calculateRequiredFuel) @?=
[1969,654,216,70,21,5,-1]
, testCase " 1969 sumOf" $
(1969 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
966.0
, testCase "100756 listOf" $
100756 ^.. taking 12 (iterated calculateRequiredFuel) @?=
[100756.0,33583.0,11192.0,3728.0,1240.0,411.0,135.0,43.0,12.0,2.0,-2.0,-3.0]
, testCase "100756 sumOf" $
(100756 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
50346.0
] | 795 | test_iterated =
testGroup "test_day01_iterated"
[ -- Note: iterated emits first input without any iteration
testCase "chris" $
1 ^.. taking 10 (iterated (+1)) @?=
[1,2,3,4,5,6,7,8,9,10::Int]
, testCase " 1969 listOf" $
1969 ^.. taking 7 (iterated calculateRequiredFuel) @?=
[1969,654,216,70,21,5,-1]
, testCase " 1969 sumOf" $
(1969 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
966.0
, testCase "100756 listOf" $
100756 ^.. taking 12 (iterated calculateRequiredFuel) @?=
[100756.0,33583.0,11192.0,3728.0,1240.0,411.0,135.0,43.0,12.0,2.0,-2.0,-3.0]
, testCase "100756 sumOf" $
(100756 & sumOf (takingWhile (>0) (dropping 1 (iterated calculateRequiredFuel)))) @?=
50346.0
] | 769 | false | true | 0 | 17 | 153 | 312 | 170 | 142 | null | null |
phadej/generics-sop | src/Generics/SOP/TH.hs | bsd-3-clause | conInfo (RecGadtC _ _ _) = fail "GADTs not supported" | 53 | conInfo (RecGadtC _ _ _) = fail "GADTs not supported" | 53 | conInfo (RecGadtC _ _ _) = fail "GADTs not supported" | 53 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
sumeetchhetri/FrameworkBenchmarks | frameworks/Haskell/spock/src/Main.hs | bsd-3-clause | -- | Test 6: Plain text
test6 :: MonadIO m => ActionCtxT ctx m a
test6 = do
setHeader "Content-Type" "text/plain"
lazyBytes "Hello, World!"
| 148 | test6 :: MonadIO m => ActionCtxT ctx m a
test6 = do
setHeader "Content-Type" "text/plain"
lazyBytes "Hello, World!"
| 124 | test6 = do
setHeader "Content-Type" "text/plain"
lazyBytes "Hello, World!"
| 83 | true | true | 0 | 7 | 32 | 40 | 18 | 22 | null | null |
gianlucagiorgolo/glue-tp | TestTP.hs | mit | atom :: String -> Formula
atom s = Atom s (TAtomic s) | 53 | atom :: String -> Formula
atom s = Atom s (TAtomic s) | 53 | atom s = Atom s (TAtomic s) | 27 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
spechub/Hets | Maude/Symbol.hs | gpl-2.0 | -- * Construction
-- | Create a total 'Operator' 'Symbol' with the given profile.
mkOpTotal :: Qid -> [Qid] -> Qid -> Symbol
mkOpTotal qid dom cod = Operator qid (map Sort dom) (Sort cod) | 188 | mkOpTotal :: Qid -> [Qid] -> Qid -> Symbol
mkOpTotal qid dom cod = Operator qid (map Sort dom) (Sort cod) | 105 | mkOpTotal qid dom cod = Operator qid (map Sort dom) (Sort cod) | 62 | true | true | 0 | 7 | 35 | 56 | 29 | 27 | null | null |
mitchellwrosen/Haskell-Turtle-Library | src/Turtle/Line.hs | bsd-3-clause | -- | Merge lines into a single text value.
linesToText :: [Line] -> Text
linesToText =
#if __GLASGOW_HASKELL__ >= 708
coerce Text.unlines | 139 | linesToText :: [Line] -> Text
linesToText =
#if __GLASGOW_HASKELL__ >= 708
coerce Text.unlines | 96 | linesToText =
#if __GLASGOW_HASKELL__ >= 708
coerce Text.unlines | 66 | true | true | 0 | 7 | 23 | 32 | 15 | 17 | null | null |
gridaphobe/ghc | compiler/main/DynFlags.hs | bsd-3-clause | setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } | 79 | setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } | 79 | setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } | 79 | false | false | 0 | 8 | 21 | 35 | 18 | 17 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/Types/Product.hs | mpl-2.0 | -- | Specifies whether IAM users are required to change their password after
-- a specified number of days.
ppExpirePasswords :: Lens' PasswordPolicy (Maybe Bool)
ppExpirePasswords = lens _ppExpirePasswords (\ s a -> s{_ppExpirePasswords = a}) | 243 | ppExpirePasswords :: Lens' PasswordPolicy (Maybe Bool)
ppExpirePasswords = lens _ppExpirePasswords (\ s a -> s{_ppExpirePasswords = a}) | 135 | ppExpirePasswords = lens _ppExpirePasswords (\ s a -> s{_ppExpirePasswords = a}) | 80 | true | true | 0 | 9 | 35 | 47 | 26 | 21 | null | null |
pellagic-puffbomb/simpleservantblog | app/Plumbing.hs | bsd-3-clause | userLoop conn _ = do
_ <- makeUser conn
putStrLn "Would you like to make another user? y|n"
hFlush stdout
answer <- getLine
if answer == "y" then userLoop conn True else return () | 190 | userLoop conn _ = do
_ <- makeUser conn
putStrLn "Would you like to make another user? y|n"
hFlush stdout
answer <- getLine
if answer == "y" then userLoop conn True else return () | 190 | userLoop conn _ = do
_ <- makeUser conn
putStrLn "Would you like to make another user? y|n"
hFlush stdout
answer <- getLine
if answer == "y" then userLoop conn True else return () | 190 | false | false | 0 | 9 | 44 | 67 | 28 | 39 | null | null |
robeverest/accelerate | Data/Array/Accelerate/Interpreter.hs | bsd-3-clause | evalSig (FloatingNumType ty) | FloatingDict <- floatingDict ty = signum | 71 | evalSig (FloatingNumType ty) | FloatingDict <- floatingDict ty = signum | 71 | evalSig (FloatingNumType ty) | FloatingDict <- floatingDict ty = signum | 71 | false | false | 0 | 9 | 9 | 28 | 12 | 16 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Util/Stack.hs | bsd-2-clause | getI i (_:as) = getI (i-1) as | 29 | getI i (_:as) = getI (i-1) as | 29 | getI i (_:as) = getI (i-1) as | 29 | false | false | 0 | 7 | 6 | 30 | 15 | 15 | null | null |
RoboNickBot/nlp-tools | src/NLP/Tools/Database.hs | bsd-2-clause | lengthTable = "lengthTable" | 27 | lengthTable = "lengthTable" | 27 | lengthTable = "lengthTable" | 27 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
forste/haReFork | tools/base/lib/Monads/MT.hs | bsd-3-clause | this = at::Z | 13 | this = at::Z | 13 | this = at::Z | 13 | false | false | 2 | 5 | 3 | 16 | 5 | 11 | null | null |
whitehead1415/cql | src/Database/CQL/Protocol/Response.hs | mpl-2.0 | decodeResult :: forall k a b. (Tuple a, Tuple b) => Version -> Get (Result k a b)
decodeResult v = decodeInt >>= go
where
go 0x1 = return VoidResult
go 0x2 = do
m <- decodeMetaData
n <- decodeInt
let c = untag (count :: Tagged b Int)
unless (columnCount m == fromIntegral c) $
fail $ "column count: "
++ show (columnCount m)
++ " =/= "
++ show c
let typecheck = untag (check :: Tagged b ([ColumnType] -> [ColumnType]))
let ctypes = map columnType (columnSpecs m)
let expected = typecheck ctypes
let message = "expected: " ++ show expected ++ ", but got " ++ show ctypes
unless (null expected) $
fail $ "column-type error: " ++ message
RowsResult m <$> replicateM (fromIntegral n) (tuple v)
go 0x3 = SetKeyspaceResult <$> decodeKeyspace
go 0x4 = PreparedResult <$> decodeQueryId <*> decodeMetaData <*> decodeMetaData
go 0x5 = SchemaChangeResult <$> decodeSchemaChange v
go int = fail $ "decode-result: unknown: " ++ show int | 1,107 | decodeResult :: forall k a b. (Tuple a, Tuple b) => Version -> Get (Result k a b)
decodeResult v = decodeInt >>= go
where
go 0x1 = return VoidResult
go 0x2 = do
m <- decodeMetaData
n <- decodeInt
let c = untag (count :: Tagged b Int)
unless (columnCount m == fromIntegral c) $
fail $ "column count: "
++ show (columnCount m)
++ " =/= "
++ show c
let typecheck = untag (check :: Tagged b ([ColumnType] -> [ColumnType]))
let ctypes = map columnType (columnSpecs m)
let expected = typecheck ctypes
let message = "expected: " ++ show expected ++ ", but got " ++ show ctypes
unless (null expected) $
fail $ "column-type error: " ++ message
RowsResult m <$> replicateM (fromIntegral n) (tuple v)
go 0x3 = SetKeyspaceResult <$> decodeKeyspace
go 0x4 = PreparedResult <$> decodeQueryId <*> decodeMetaData <*> decodeMetaData
go 0x5 = SchemaChangeResult <$> decodeSchemaChange v
go int = fail $ "decode-result: unknown: " ++ show int | 1,107 | decodeResult v = decodeInt >>= go
where
go 0x1 = return VoidResult
go 0x2 = do
m <- decodeMetaData
n <- decodeInt
let c = untag (count :: Tagged b Int)
unless (columnCount m == fromIntegral c) $
fail $ "column count: "
++ show (columnCount m)
++ " =/= "
++ show c
let typecheck = untag (check :: Tagged b ([ColumnType] -> [ColumnType]))
let ctypes = map columnType (columnSpecs m)
let expected = typecheck ctypes
let message = "expected: " ++ show expected ++ ", but got " ++ show ctypes
unless (null expected) $
fail $ "column-type error: " ++ message
RowsResult m <$> replicateM (fromIntegral n) (tuple v)
go 0x3 = SetKeyspaceResult <$> decodeKeyspace
go 0x4 = PreparedResult <$> decodeQueryId <*> decodeMetaData <*> decodeMetaData
go 0x5 = SchemaChangeResult <$> decodeSchemaChange v
go int = fail $ "decode-result: unknown: " ++ show int | 1,025 | false | true | 0 | 15 | 347 | 379 | 180 | 199 | null | null |
phadej/stack | src/Stack/Types/StackT.hs | bsd-3-clause | newTLSManager :: MonadIO m => m Manager
newTLSManager = liftIO $ newManager tlsManagerSettings | 94 | newTLSManager :: MonadIO m => m Manager
newTLSManager = liftIO $ newManager tlsManagerSettings | 94 | newTLSManager = liftIO $ newManager tlsManagerSettings | 54 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
sordina/wai | wai-extra/test/WaiExtraSpec.hs | bsd-2-clause | vhostApp1, vhostApp2, vhostApp :: Application
vhostApp1 _ f = f $ responseLBS status200 [] "app1" | 97 | vhostApp1, vhostApp2, vhostApp :: Application
vhostApp1 _ f = f $ responseLBS status200 [] "app1" | 97 | vhostApp1 _ f = f $ responseLBS status200 [] "app1" | 51 | false | true | 6 | 6 | 14 | 47 | 19 | 28 | null | null |
sdiehl/ghc | compiler/utils/OrdList.hs | bsd-3-clause | reverseOL :: OrdList a -> OrdList a
reverseOL None = None | 57 | reverseOL :: OrdList a -> OrdList a
reverseOL None = None | 57 | reverseOL None = None | 21 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
jwiegley/ghc-release | utils/haddock/src/Haddock/Backends/LaTeX.hs | gpl-3.0 | documentationToLaTeX :: Documentation DocName -> Maybe LaTeX
documentationToLaTeX = fmap docToLaTeX . combineDocumentation | 122 | documentationToLaTeX :: Documentation DocName -> Maybe LaTeX
documentationToLaTeX = fmap docToLaTeX . combineDocumentation | 122 | documentationToLaTeX = fmap docToLaTeX . combineDocumentation | 61 | false | true | 0 | 6 | 12 | 28 | 13 | 15 | null | null |
asivitz/Hickory | Hickory/Graphics/Shader.hs | mit | linkProgram :: GLuint -> [GLuint] -> IO Bool
linkProgram programId shaders = do
mapM_ (glAttachShader programId) shaders
glLinkProgram programId
linked <- glGetProgrami programId GL_LINK_STATUS
let didLink = linked /= 0
unless didLink $ do
infoLog <- retrieveLog (glGetProgrami programId) (glGetProgramInfoLog programId)
case infoLog of
Just i -> do
print ("*** ERROR: Can't link shader program" :: String)
print i
_ -> return ()
return didLink | 495 | linkProgram :: GLuint -> [GLuint] -> IO Bool
linkProgram programId shaders = do
mapM_ (glAttachShader programId) shaders
glLinkProgram programId
linked <- glGetProgrami programId GL_LINK_STATUS
let didLink = linked /= 0
unless didLink $ do
infoLog <- retrieveLog (glGetProgrami programId) (glGetProgramInfoLog programId)
case infoLog of
Just i -> do
print ("*** ERROR: Can't link shader program" :: String)
print i
_ -> return ()
return didLink | 495 | linkProgram programId shaders = do
mapM_ (glAttachShader programId) shaders
glLinkProgram programId
linked <- glGetProgrami programId GL_LINK_STATUS
let didLink = linked /= 0
unless didLink $ do
infoLog <- retrieveLog (glGetProgrami programId) (glGetProgramInfoLog programId)
case infoLog of
Just i -> do
print ("*** ERROR: Can't link shader program" :: String)
print i
_ -> return ()
return didLink | 450 | false | true | 0 | 17 | 115 | 165 | 72 | 93 | null | null |
jozefg/c-dsl | src/Language/C/DSL/Decl.hs | mit | -- | The 'CDeclSpec' for declarations of type @short@
shortTy :: CDeclSpec
shortTy = CTypeSpec $ CShortType undefNode | 118 | shortTy :: CDeclSpec
shortTy = CTypeSpec $ CShortType undefNode | 64 | shortTy = CTypeSpec $ CShortType undefNode | 43 | true | true | 0 | 6 | 18 | 19 | 10 | 9 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/Printing/Helpers.hs | bsd-2-clause | sufx 3 = "rd" | 13 | sufx 3 = "rd" | 13 | sufx 3 = "rd" | 13 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
olorin/amazonka | amazonka-storagegateway/gen/Network/AWS/StorageGateway/Types.hs | mpl-2.0 | -- | API version '2013-06-30' of the Amazon Storage Gateway SDK configuration.
storageGateway :: Service
storageGateway =
Service
{ _svcAbbrev = "StorageGateway"
, _svcSigner = v4
, _svcPrefix = "storagegateway"
, _svcVersion = "2013-06-30"
, _svcEndpoint = defaultEndpoint storageGateway
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
-- | An exception occurred because an invalid gateway request was issued to
-- the service. See the error and message fields for more information. | 1,137 | storageGateway :: Service
storageGateway =
Service
{ _svcAbbrev = "StorageGateway"
, _svcSigner = v4
, _svcPrefix = "storagegateway"
, _svcVersion = "2013-06-30"
, _svcEndpoint = defaultEndpoint storageGateway
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
-- | An exception occurred because an invalid gateway request was issued to
-- the service. See the error and message fields for more information. | 1,058 | storageGateway =
Service
{ _svcAbbrev = "StorageGateway"
, _svcSigner = v4
, _svcPrefix = "storagegateway"
, _svcVersion = "2013-06-30"
, _svcEndpoint = defaultEndpoint storageGateway
, _svcTimeout = Just 70
, _svcCheck = statusSuccess
, _svcError = parseJSONError
, _svcRetry = retry
}
where
retry =
Exponential
{ _retryBase = 5.0e-2
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check e
| has (hasCode "ThrottlingException" . hasStatus 400) e =
Just "throttling_exception"
| has (hasCode "Throttling" . hasStatus 400) e = Just "throttling"
| has (hasStatus 503) e = Just "service_unavailable"
| has (hasStatus 500) e = Just "general_server_error"
| has (hasStatus 509) e = Just "limit_exceeded"
| otherwise = Nothing
-- | An exception occurred because an invalid gateway request was issued to
-- the service. See the error and message fields for more information. | 1,032 | true | true | 1 | 11 | 303 | 266 | 137 | 129 | null | null |
egison/egison | hs-src/Language/Egison/Desugar.hs | mit | extractSubSupIndex (VSymmScripts xs) = concatMap extractSubSupIndex xs | 74 | extractSubSupIndex (VSymmScripts xs) = concatMap extractSubSupIndex xs | 74 | extractSubSupIndex (VSymmScripts xs) = concatMap extractSubSupIndex xs | 74 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
christiaanb/ghc | compiler/hsSyn/HsBinds.hs | bsd-3-clause | pprMinimalSig :: OutputableBndr name => BooleanFormula (Located name) -> SDoc
pprMinimalSig bf = ptext (sLit "MINIMAL") <+> ppr (fmap unLoc bf) | 143 | pprMinimalSig :: OutputableBndr name => BooleanFormula (Located name) -> SDoc
pprMinimalSig bf = ptext (sLit "MINIMAL") <+> ppr (fmap unLoc bf) | 143 | pprMinimalSig bf = ptext (sLit "MINIMAL") <+> ppr (fmap unLoc bf) | 65 | false | true | 0 | 10 | 20 | 63 | 28 | 35 | null | null |
bitemyapp/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | matchEnv :: [Id] -- x1..xn
-> CoreExpr -- e
-> DsM CoreExpr
matchEnv env_ids body = do
uniqs <- newUniqueSupply
tup_id <- newSysLocalDs (mkBigCoreVarTupTy env_ids)
return (Lam tup_id (coreCaseTuple uniqs tup_id env_ids body))
----------------------------------------------
-- matchVarStack
--
-- case (x1, ...(xn, s)...) -> e
-- =>
-- case z0 of (x1,z1) ->
-- case zn-1 of (xn,s) ->
-- e | 466 | matchEnv :: [Id] -- x1..xn
-> CoreExpr -- e
-> DsM CoreExpr
matchEnv env_ids body = do
uniqs <- newUniqueSupply
tup_id <- newSysLocalDs (mkBigCoreVarTupTy env_ids)
return (Lam tup_id (coreCaseTuple uniqs tup_id env_ids body))
----------------------------------------------
-- matchVarStack
--
-- case (x1, ...(xn, s)...) -> e
-- =>
-- case z0 of (x1,z1) ->
-- case zn-1 of (xn,s) ->
-- e | 466 | matchEnv env_ids body = do
uniqs <- newUniqueSupply
tup_id <- newSysLocalDs (mkBigCoreVarTupTy env_ids)
return (Lam tup_id (coreCaseTuple uniqs tup_id env_ids body))
----------------------------------------------
-- matchVarStack
--
-- case (x1, ...(xn, s)...) -> e
-- =>
-- case z0 of (x1,z1) ->
-- case zn-1 of (xn,s) ->
-- e | 378 | false | true | 0 | 12 | 138 | 94 | 48 | 46 | null | null |
vkomenda/CoALP | lib/CoALP/UI/Parser.hs | lgpl-3.0 | termParse :: (Stream s Identity t) => Parsec s TermParserSt a ->
SourceName -> s -> Either ParseError a
termParse p = runP p tpsInit | 145 | termParse :: (Stream s Identity t) => Parsec s TermParserSt a ->
SourceName -> s -> Either ParseError a
termParse p = runP p tpsInit | 145 | termParse p = runP p tpsInit | 28 | false | true | 0 | 10 | 37 | 62 | 28 | 34 | null | null |
corngood/cabal | Cabal/Distribution/Simple/Utils.hs | bsd-3-clause | startsWithBOM :: String -> Bool
startsWithBOM ('\xFEFF':_) = True | 65 | startsWithBOM :: String -> Bool
startsWithBOM ('\xFEFF':_) = True | 65 | startsWithBOM ('\xFEFF':_) = True | 33 | false | true | 0 | 7 | 8 | 25 | 13 | 12 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/DescribeSpotDatafeedSubscription.hs | mpl-2.0 | -- | The Spot Instance data feed subscription.
dsdsrSpotDatafeedSubscription :: Lens' DescribeSpotDatafeedSubscriptionResponse (Maybe SpotDatafeedSubscription)
dsdsrSpotDatafeedSubscription =
lens _dsdsrSpotDatafeedSubscription
(\s a -> s { _dsdsrSpotDatafeedSubscription = a }) | 290 | dsdsrSpotDatafeedSubscription :: Lens' DescribeSpotDatafeedSubscriptionResponse (Maybe SpotDatafeedSubscription)
dsdsrSpotDatafeedSubscription =
lens _dsdsrSpotDatafeedSubscription
(\s a -> s { _dsdsrSpotDatafeedSubscription = a }) | 243 | dsdsrSpotDatafeedSubscription =
lens _dsdsrSpotDatafeedSubscription
(\s a -> s { _dsdsrSpotDatafeedSubscription = a }) | 130 | true | true | 1 | 9 | 38 | 51 | 25 | 26 | null | null |
andorp/grin | grin/src/Transformations/Names.hs | bsd-3-clause | mapNameDefExpM :: Monad m => (Name -> m Name) -> Exp -> m Exp
mapNameDefExpM f = \case
Def name args body -> Def <$> f name <*> mapM f args <*> pure body
EBind leftExp lpat rightExp -> EBind leftExp <$> mapNamesValM f lpat <*> pure rightExp
Alt cpat body -> Alt <$> mapNamesCPatM f cpat <*> pure body
exp -> pure exp | 371 | mapNameDefExpM :: Monad m => (Name -> m Name) -> Exp -> m Exp
mapNameDefExpM f = \case
Def name args body -> Def <$> f name <*> mapM f args <*> pure body
EBind leftExp lpat rightExp -> EBind leftExp <$> mapNamesValM f lpat <*> pure rightExp
Alt cpat body -> Alt <$> mapNamesCPatM f cpat <*> pure body
exp -> pure exp | 371 | mapNameDefExpM f = \case
Def name args body -> Def <$> f name <*> mapM f args <*> pure body
EBind leftExp lpat rightExp -> EBind leftExp <$> mapNamesValM f lpat <*> pure rightExp
Alt cpat body -> Alt <$> mapNamesCPatM f cpat <*> pure body
exp -> pure exp | 309 | false | true | 0 | 12 | 118 | 153 | 68 | 85 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxDB_MAX_COLUMN_NAME_LEN :: Int
wxDB_MAX_COLUMN_NAME_LEN = 128 | 62 | wxDB_MAX_COLUMN_NAME_LEN :: Int
wxDB_MAX_COLUMN_NAME_LEN = 128 | 62 | wxDB_MAX_COLUMN_NAME_LEN = 128 | 30 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
pnlbwh/test-tensormasking | pipeline-lib/Pipeline/HCP/old/Topup.hs | bsd-3-clause | hifib0 :: FilePath
hifib0 = outdir </> "hifib0.nii.gz" | 54 | hifib0 :: FilePath
hifib0 = outdir </> "hifib0.nii.gz" | 54 | hifib0 = outdir </> "hifib0.nii.gz" | 35 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
rudyl313/factual-haskell-driver | Data/Factual/Response.hs | bsd-3-clause | -- The following helper functions aid the lookup functions.
formErrorResponse :: Value -> Response
formErrorResponse value = Response { status = lookupString "status" value
, version = lookupNumber "version" value
, response = Null
, errorMessage = Just $ lookupString "message" value
, errorType = Just $ lookupString "error_type" value } | 479 | formErrorResponse :: Value -> Response
formErrorResponse value = Response { status = lookupString "status" value
, version = lookupNumber "version" value
, response = Null
, errorMessage = Just $ lookupString "message" value
, errorType = Just $ lookupString "error_type" value } | 419 | formErrorResponse value = Response { status = lookupString "status" value
, version = lookupNumber "version" value
, response = Null
, errorMessage = Just $ lookupString "message" value
, errorType = Just $ lookupString "error_type" value } | 380 | true | true | 0 | 9 | 190 | 83 | 44 | 39 | null | null |
juodaspaulius/bclafer_old | src/Language/ClaferT.hs | mit | runClafer :: ClaferArgs -> ClaferM a -> Either [ClaferErr] a
runClafer args = runIdentity . runClaferT args | 107 | runClafer :: ClaferArgs -> ClaferM a -> Either [ClaferErr] a
runClafer args = runIdentity . runClaferT args | 107 | runClafer args = runIdentity . runClaferT args | 46 | false | true | 0 | 8 | 16 | 40 | 19 | 21 | null | null |
chrisbloecker/accelerate-nmf | src/LinearAlgebra.hs | bsd-3-clause | mul :: (Elt a, IsNum a) => Acc (Matrix a) -> Acc (Matrix a) -> Acc (Matrix a)
mul = undefined | 93 | mul :: (Elt a, IsNum a) => Acc (Matrix a) -> Acc (Matrix a) -> Acc (Matrix a)
mul = undefined | 93 | mul = undefined | 15 | false | true | 0 | 11 | 20 | 67 | 31 | 36 | null | null |
rubik/stack | src/Stack/Build/Execute.hs | bsd-3-clause | checkForUnlistedFiles :: M env m => TaskType -> ModTime -> Path Abs Dir -> m ()
checkForUnlistedFiles (TTLocal lp) preBuildTime pkgDir = do
(addBuildCache,warnings) <-
addUnlistedToBuildCache
preBuildTime
(lpPackage lp)
(lpCabalFile lp)
(lpNewBuildCache lp)
mapM_ ($logWarn . ("Warning: " <>) . T.pack . show) warnings
unless (null addBuildCache) $
writeBuildCache pkgDir $
Map.unions (lpNewBuildCache lp : addBuildCache) | 505 | checkForUnlistedFiles :: M env m => TaskType -> ModTime -> Path Abs Dir -> m ()
checkForUnlistedFiles (TTLocal lp) preBuildTime pkgDir = do
(addBuildCache,warnings) <-
addUnlistedToBuildCache
preBuildTime
(lpPackage lp)
(lpCabalFile lp)
(lpNewBuildCache lp)
mapM_ ($logWarn . ("Warning: " <>) . T.pack . show) warnings
unless (null addBuildCache) $
writeBuildCache pkgDir $
Map.unions (lpNewBuildCache lp : addBuildCache) | 505 | checkForUnlistedFiles (TTLocal lp) preBuildTime pkgDir = do
(addBuildCache,warnings) <-
addUnlistedToBuildCache
preBuildTime
(lpPackage lp)
(lpCabalFile lp)
(lpNewBuildCache lp)
mapM_ ($logWarn . ("Warning: " <>) . T.pack . show) warnings
unless (null addBuildCache) $
writeBuildCache pkgDir $
Map.unions (lpNewBuildCache lp : addBuildCache) | 425 | false | true | 0 | 12 | 139 | 163 | 78 | 85 | null | null |
gabesoft/kapi | src/Api/Lono.hs | bsd-3-clause | mkTagsGetMultipleLink :: ApiGetMultipleLink
mkTagsGetMultipleLink = mkLink5 apiTagsProxy apiTagsProxyGetMultiple | 112 | mkTagsGetMultipleLink :: ApiGetMultipleLink
mkTagsGetMultipleLink = mkLink5 apiTagsProxy apiTagsProxyGetMultiple | 112 | mkTagsGetMultipleLink = mkLink5 apiTagsProxy apiTagsProxyGetMultiple | 68 | false | true | 0 | 5 | 7 | 16 | 8 | 8 | null | null |
kustomzone/plush | src/Plush/Server.hs | apache-2.0 | report _ _ OutputJson (Right si) = outStrLn (encode si) >> success | 66 | report _ _ OutputJson (Right si) = outStrLn (encode si) >> success | 66 | report _ _ OutputJson (Right si) = outStrLn (encode si) >> success | 66 | false | false | 0 | 8 | 11 | 34 | 16 | 18 | null | null |
JamesSullivan1/Minisculus | src/MinisculusParser.hs | mit | moreTerm ((_,T_Div):ts) =
((R16 Div t), ts1) where
(t,ts1) = term ts | 77 | moreTerm ((_,T_Div):ts) =
((R16 Div t), ts1) where
(t,ts1) = term ts | 77 | moreTerm ((_,T_Div):ts) =
((R16 Div t), ts1) where
(t,ts1) = term ts | 77 | false | false | 0 | 7 | 20 | 54 | 29 | 25 | null | null |
Noeda/adeonbot | bot/src/Bot/NetHack/MonadAI.hs | mit | runAbortAI_ :: MonadAI m => AbortAI m () -> m ()
runAbortAI_ ai = void $ runAbortAI ai | 86 | runAbortAI_ :: MonadAI m => AbortAI m () -> m ()
runAbortAI_ ai = void $ runAbortAI ai | 86 | runAbortAI_ ai = void $ runAbortAI ai | 37 | false | true | 2 | 9 | 17 | 49 | 21 | 28 | null | null |
lostbean/neo4j-haskell-http-client | src/Database/Neo4j/Types.hs | bsd-3-clause | parseProperties _ = fail "properties couldn't be parsed" | 56 | parseProperties _ = fail "properties couldn't be parsed" | 56 | parseProperties _ = fail "properties couldn't be parsed" | 56 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
forked-upstream-packages-for-ghcjs/ghc | testsuite/tests/typecheck/should_compile/tc076.hs | bsd-3-clause | xs :: [Bool]
xs = [x | x <- x, x <- x] | 38 | xs :: [Bool]
xs = [x | x <- x, x <- x] | 38 | xs = [x | x <- x, x <- x] | 25 | false | true | 0 | 8 | 12 | 40 | 19 | 21 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.