Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Spago.Config
Synopsis
- defaultPath :: IsString t => t
- makeConfig :: (HasConfigPath env, HasLogFunc env) => Force -> TemplateComments -> RIO env Config
- makeTempConfig :: (HasLogFunc env, HasPurs env) => Set PackageName -> Maybe Text -> Set SourcePath -> Maybe Text -> RIO env Config
- ensureConfig :: (HasLogFunc env, HasConfigPath env) => RIO env (Either Utf8Builder Config)
- addDependencies :: (HasLogFunc env, HasConfigPath env) => Config -> [PackageName] -> RIO env ()
- parsePackage :: (MonadIO m, MonadThrow m, MonadReader env m, HasLogFunc env) => ResolvedExpr -> m Package
- parsePackageSet :: HasLogFunc env => Map Text (DhallExpr Void) -> RIO env PackageSet
- data Config = Config {}
- data PublishConfig = PublishConfig {}
Documentation
defaultPath :: IsString t => t #
Default path for the Spago Config
makeConfig :: (HasConfigPath env, HasLogFunc env) => Force -> TemplateComments -> RIO env Config #
Copies over `spago.dhall` to set up a Spago project. Eventually ports an existing `psc-package.json` to the new config.
makeTempConfig :: (HasLogFunc env, HasPurs env) => Set PackageName -> Maybe Text -> Set SourcePath -> Maybe Text -> RIO env Config #
Create a Config in memory | For use by `spago script` and `spago repl`
ensureConfig :: (HasLogFunc env, HasConfigPath env) => RIO env (Either Utf8Builder Config) #
Checks that the Spago config is there and readable
addDependencies :: (HasLogFunc env, HasConfigPath env) => Config -> [PackageName] -> RIO env () #
Try to add the newPackages
to the "dependencies" list in the Config.
It will not add any dependency if any of them is not in the package set.
If everything is fine instead, it will add the new deps, sort all the
dependencies, and write the Config back to file.
parsePackage :: (MonadIO m, MonadThrow m, MonadReader env m, HasLogFunc env) => ResolvedExpr -> m Package #
parsePackageSet :: HasLogFunc env => Map Text (DhallExpr Void) -> RIO env PackageSet #
Parse the contents of a "packages.dhall" file (or the "packages" key of an evaluated "spago.dhall")
Spago configuration file type
Constructors
Config | |
Fields |
Instances
Generic Config # | |
Show Config # | |
type Rep Config # | |
Defined in Spago.Types type Rep Config = D1 ('MetaData "Config" "Spago.Types" "spago-0.21.0-wuq2Fsi0665WDIPyS8qRJ" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "dependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set PackageName)) :*: S1 ('MetaSel ('Just "packageSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PackageSet))) :*: ((S1 ('MetaSel ('Just "alternateBackend") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "configSourcePaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set SourcePath))) :*: (S1 ('MetaSel ('Just "publishConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (ReadError Void) PublishConfig)) :*: S1 ('MetaSel ('Just "migrateConfig") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Either (ReadError Void) MigrateConfig)))))) |
data PublishConfig #
The extra fields that are only needed for publishing libraries.
Constructors
PublishConfig | |
Fields |
Instances
Generic PublishConfig # | |
Defined in Spago.Types Associated Types type Rep PublishConfig :: Type -> Type # | |
Show PublishConfig # | |
Defined in Spago.Types Methods showsPrec :: Int -> PublishConfig -> ShowS # show :: PublishConfig -> String # showList :: [PublishConfig] -> ShowS # | |
type Rep PublishConfig # | |
Defined in Spago.Types type Rep PublishConfig = D1 ('MetaData "PublishConfig" "Spago.Types" "spago-0.21.0-wuq2Fsi0665WDIPyS8qRJ" 'False) (C1 ('MetaCons "PublishConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "publishLicense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "publishRepository") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |