spago-0.21.0

Safe Haskell | None
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 {
  - name :: Text
  - dependencies :: Set PackageName
  - packageSet :: PackageSet
  - alternateBackend :: Maybe Text
  - configSourcePaths :: Set SourcePath
  - publishConfig :: Either (ReadError Void) PublishConfig
  - migrateConfig :: Either (ReadError Void) MigrateConfig
  }
- data PublishConfig = PublishConfig {
  - publishLicense :: Text
  - publishRepository :: Text
  }

# 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")

data Config #

Spago configuration file type

Constructors

Config |

Fields

- name :: Text
- dependencies :: Set PackageName
- packageSet :: PackageSet
- alternateBackend :: Maybe Text
- configSourcePaths :: Set SourcePath
- publishConfig :: Either (ReadError Void) PublishConfig
- migrateConfig :: Either (ReadError Void) MigrateConfig

#### Instances

Instances details

Generic Config # |

Instance details

Defined in Spago.Types

Associated Types

type Rep Config |

Instance details

Defined in Spago.Types

type Rep Config = D1 ('MetaData "Config" "Spago.Types" "spago-0.21.0-7fGZ7CPhD6UKUhYlrl5wZv" '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))))))

Methods

from :: Config -> Rep Config x #

to :: Rep Config x -> Config #

Show Config # |
Instance details Defined in Spago.Types Methods showsPrec :: Int -> Config -> ShowS # show :: Config -> String # showList :: [Config] -> ShowS #
type Rep Config # |

Instance details

Defined in Spago.Types

type Rep Config = D1 ('MetaData "Config" "Spago.Types" "spago-0.21.0-7fGZ7CPhD6UKUhYlrl5wZv" '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

- publishLicense :: Text
- publishRepository :: Text

#### Instances

Instances details

Generic PublishConfig # |

Instance details

Defined in Spago.Types

Associated Types

type Rep PublishConfig |

Instance details

Defined in Spago.Types

type Rep PublishConfig = D1 ('MetaData "PublishConfig" "Spago.Types" "spago-0.21.0-7fGZ7CPhD6UKUhYlrl5wZv" 'False) (C1 ('MetaCons "PublishConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "publishLicense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "publishRepository") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: PublishConfig -> Rep PublishConfig x #

to :: Rep PublishConfig x -> PublishConfig #

Show PublishConfig # |
Instance details Defined in Spago.Types Methods showsPrec :: Int -> PublishConfig -> ShowS # show :: PublishConfig -> String # showList :: [PublishConfig] -> ShowS #
type Rep PublishConfig # |

Instance details

Defined in Spago.Types

type Rep PublishConfig = D1 ('MetaData "PublishConfig" "Spago.Types" "spago-0.21.0-7fGZ7CPhD6UKUhYlrl5wZv" 'False) (C1 ('MetaCons "PublishConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "publishLicense") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "publishRepository") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))