stack-1.4.0: The Haskell Tool Stack

Safe Haskell | None
Language | Haskell2010

Stack.Types.Config

Contents

- Main configuration types and classes
  - HasPlatform & HasStackRoot
  - Config & HasConfig
  - BuildConfig & HasBuildConfig
  - GHCVariant & HasGHCVariant
  - Constraint synonym for use with StackMini
  - EnvConfig & HasEnvConfig
- Details
  - ApplyGhcOptions
  - ConfigException
  - WhichSolverCmd
  - ConfigMonoid
  - DumpLogs
  - EnvSettings
  - GlobalOpts & GlobalOptsMonoid
  - LoadConfig
  - PackageEntry & PackageLocation
  - PackageIndex, IndexName & IndexLocation
  - Project & ProjectAndConfigMonoid
  - PvpBounds
  - ColorWhen
  - SCM
  - CustomSnapshot
  - GhcOptions
  - PackageFlags
- Paths
- Command-specific types
  - Eval
  - Exec
  - Setup
  - Docker entrypoint
- Lens helpers
- Lens reexport

Description

The Config type.

Synopsis

- class HasPlatform env where
- data PlatformVariant
  - = PlatformVariantNone
  - | PlatformVariant String
- data Config = Config {
  - configStackRoot :: !(Path Abs Dir)
  - configWorkDir :: !(Path Rel Dir)
  - configUserConfigPath :: !(Path Abs File)
  - configBuild :: !BuildOpts
  - configDocker :: !DockerOpts
  - configNix :: !NixOpts
  - configEnvOverride :: !(EnvSettings -> IO EnvOverride)
  - configLocalProgramsBase :: !(Path Abs Dir)
  - configLocalPrograms :: !(Path Abs Dir)
  - configConnectionCount :: !Int
  - configHideTHLoading :: !Bool
  - configPlatform :: !Platform
  - configPlatformVariant :: !PlatformVariant
  - configGHCVariant0 :: !(Maybe GHCVariant)
  - configGHCBuild :: !(Maybe CompilerBuild)
  - configUrls :: !Urls
  - configPackageIndices :: ![PackageIndex]
  - configSystemGHC :: !Bool
  - configInstallGHC :: !Bool
  - configSkipGHCCheck :: !Bool
  - configSkipMsys :: !Bool
  - configCompilerCheck :: !VersionCheck
  - configLocalBin :: !(Path Abs Dir)
  - configRequireStackVersion :: !VersionRange
  - configJobs :: !Int
  - configOverrideGccPath :: !(Maybe (Path Abs File))
  - configExtraIncludeDirs :: !(Set (Path Abs Dir))
  - configExtraLibDirs :: !(Set (Path Abs Dir))
  - configConcurrentTests :: !Bool
  - configImage :: !ImageOpts
  - configTemplateParams :: !(Map Text Text)
  - configScmInit :: !(Maybe SCM)
  - configGhcOptions :: !GhcOptions
  - configSetupInfoLocations :: ![SetupInfoLocation]
  - configPvpBounds :: !PvpBounds
  - configModifyCodePage :: !Bool
  - configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
  - configRebuildGhcOptions :: !Bool
  - configApplyGhcOptions :: !ApplyGhcOptions
  - configAllowNewer :: !Bool
  - configDefaultTemplate :: !(Maybe TemplateName)
  - configAllowDifferentUser :: !Bool
  - configPackageCaches :: !(IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize))))
  - configDumpLogs :: !DumpLogs
  - configMaybeProject :: !(Maybe (Project, Path Abs File))
  - configAllowLocals :: !Bool
  }
- class HasPlatform env => HasConfig env where
- askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text
- explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool
- getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride
- data BuildConfig = BuildConfig {
  - bcConfig :: !Config
  - bcResolver :: !LoadedResolver
  - bcWantedMiniBuildPlan :: !MiniBuildPlan
  - bcGHCVariant :: !GHCVariant
  - bcPackageEntries :: ![PackageEntry]
  - bcExtraDeps :: !(Map PackageName Version)
  - bcExtraPackageDBs :: ![Path Abs Dir]
  - bcStackYaml :: !(Path Abs File)
  - bcFlags :: !PackageFlags
  - bcImplicitGlobal :: !Bool
  }
- stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File)
- projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir)
- class HasConfig env => HasBuildConfig env where
- data GHCVariant
  - = GHCStandard
  - | GHCIntegerSimple
  - | GHCCustom String
- ghcVariantName :: GHCVariant -> String
- ghcVariantSuffix :: GHCVariant -> String
- parseGHCVariant :: MonadThrow m => String -> m GHCVariant
- class HasGHCVariant env where
- snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir)
- type StackMiniM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m)
- data EnvConfig = EnvConfig {
  - envConfigBuildConfig :: !BuildConfig
  - envConfigCabalVersion :: !Version
  - envConfigCompilerVersion :: !CompilerVersion
  - envConfigCompilerBuild :: !CompilerBuild
  - envConfigPackagesRef :: !(IORef (Maybe (Map (Path Abs Dir) TreatLikeExtraDep)))
  }
- class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where
- getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File)
- data ApplyGhcOptions
  - = AGOTargets
  - | AGOLocals
  - | AGOEverything
- data ConfigException
  - = ParseConfigFileException (Path Abs File) ParseException
  - | ParseCustomSnapshotException Text ParseException
  - | ParseResolverException Text
  - | NoProjectConfigFound (Path Abs Dir) (Maybe Text)
  - | UnexpectedArchiveContents [Path Abs Dir] [Path Abs File]
  - | UnableToExtractArchive Text (Path Abs File)
  - | BadStackVersionException VersionRange
  - | NoMatchingSnapshot WhichSolverCmd (NonEmpty SnapName)
  - | ResolverMismatch WhichSolverCmd (ResolverThat's l) String
  - | ResolverPartial WhichSolverCmd Resolver String
  - | NoSuchDirectory FilePath
  - | ParseGHCVariantException String
  - | BadStackRoot (Path Abs Dir)
  - | Won'tCreateStackRootInDirectoryOwnedByDifferentUser (Path Abs Dir) (Path Abs Dir)
  - | UserDoesn'tOwnDirectory (Path Abs Dir)
  - | FailedToCloneRepo String
  - | ManualGHCVariantSettingsAreIncompatibleWithSystemGHC
  - | NixRequiresSystemGhc
  - | NoResolverWhenUsingNoLocalConfig
  - | InvalidResolverForNoLocalConfig String
- data WhichSolverCmd
  - = IsInitCmd
  - | IsSolverCmd
  - | IsNewCmd
- data ConfigMonoid = ConfigMonoid {
  - configMonoidStackRoot :: !(First (Path Abs Dir))
  - configMonoidWorkDir :: !(First (Path Rel Dir))
  - configMonoidBuildOpts :: !BuildOptsMonoid
  - configMonoidDockerOpts :: !DockerOptsMonoid
  - configMonoidNixOpts :: !NixOptsMonoid
  - configMonoidConnectionCount :: !(First Int)
  - configMonoidHideTHLoading :: !(First Bool)
  - configMonoidLatestSnapshotUrl :: !(First Text)
  - configMonoidUrls :: !UrlsMonoid
  - configMonoidPackageIndices :: !(First [PackageIndex])
  - configMonoidSystemGHC :: !(First Bool)
  - configMonoidInstallGHC :: !(First Bool)
  - configMonoidSkipGHCCheck :: !(First Bool)
  - configMonoidSkipMsys :: !(First Bool)
  - configMonoidCompilerCheck :: !(First VersionCheck)
  - configMonoidRequireStackVersion :: !IntersectingVersionRange
  - configMonoidArch :: !(First String)
  - configMonoidGHCVariant :: !(First GHCVariant)
  - configMonoidGHCBuild :: !(First CompilerBuild)
  - configMonoidJobs :: !(First Int)
  - configMonoidExtraIncludeDirs :: !(Set (Path Abs Dir))
  - configMonoidExtraLibDirs :: !(Set (Path Abs Dir))
  - configMonoidOverrideGccPath :: !(First (Path Abs File))
  - configMonoidConcurrentTests :: !(First Bool)
  - configMonoidLocalBinPath :: !(First FilePath)
  - configMonoidImageOpts :: !ImageOptsMonoid
  - configMonoidTemplateParameters :: !(Map Text Text)
  - configMonoidScmInit :: !(First SCM)
  - configMonoidGhcOptions :: !GhcOptions
  - configMonoidExtraPath :: ![Path Abs Dir]
  - configMonoidSetupInfoLocations :: ![SetupInfoLocation]
  - configMonoidLocalProgramsBase :: !(First (Path Abs Dir))
  - configMonoidPvpBounds :: !(First PvpBounds)
  - configMonoidModifyCodePage :: !(First Bool)
  - configMonoidExplicitSetupDeps :: !(Map (Maybe PackageName) Bool)
  - configMonoidRebuildGhcOptions :: !(First Bool)
  - configMonoidApplyGhcOptions :: !(First ApplyGhcOptions)
  - configMonoidAllowNewer :: !(First Bool)
  - configMonoidDefaultTemplate :: !(First TemplateName)
  - configMonoidAllowDifferentUser :: !(First Bool)
  - configMonoidDumpLogs :: !(First DumpLogs)
  }
- configMonoidInstallGHCName :: Text
- configMonoidSystemGHCName :: Text
- data DumpLogs
  - = DumpNoLogs
  - | DumpWarningLogs
  - | DumpAllLogs
- data EnvSettings = EnvSettings {
  - esIncludeLocals :: !Bool
  - esIncludeGhcPackagePath :: !Bool
  - esStackExe :: !Bool
  - esLocaleUtf8 :: !Bool
  }
- minimalEnvSettings :: EnvSettings
- data GlobalOpts = GlobalOpts {
  - globalReExecVersion :: !(Maybe String)
  - globalDockerEntrypoint :: !(Maybe DockerEntrypoint)
  - globalLogLevel :: !LogLevel
  - globalTimeInLog :: !Bool
  - globalConfigMonoid :: !ConfigMonoid
  - globalResolver :: !(Maybe AbstractResolver)
  - globalCompiler :: !(Maybe CompilerVersion)
  - globalTerminal :: !Bool
  - globalColorWhen :: !ColorWhen
  - globalStackYaml :: !(StackYamlLoc FilePath)
  }
- data GlobalOptsMonoid = GlobalOptsMonoid {
  - globalMonoidReExecVersion :: !(First String)
  - globalMonoidDockerEntrypoint :: !(First DockerEntrypoint)
  - globalMonoidLogLevel :: !(First LogLevel)
  - globalMonoidTimeInLog :: !(First Bool)
  - globalMonoidConfigMonoid :: !ConfigMonoid
  - globalMonoidResolver :: !(First AbstractResolver)
  - globalMonoidCompiler :: !(First CompilerVersion)
  - globalMonoidTerminal :: !(First Bool)
  - globalMonoidColorWhen :: !(First ColorWhen)
  - globalMonoidStackYaml :: !(First FilePath)
  }
- data StackYamlLoc filepath
  - = SYLDefault
  - | SYLOverride !filepath
  - | SYLNoConfig
- defaultLogLevel :: LogLevel
- data LoadConfig m = LoadConfig {
  - lcConfig :: !Config
  - lcLoadBuildConfig :: !(Maybe CompilerVersion -> m BuildConfig)
  - lcProjectRoot :: !(Maybe (Path Abs Dir))
  }
- data PackageEntry = PackageEntry {
  - peExtraDepMaybe :: !(Maybe TreatLikeExtraDep)
  - peLocation :: !PackageLocation
  - peSubdirs :: ![FilePath]
  }
- type TreatLikeExtraDep = Bool
- data PackageLocation
  - = PLFilePath FilePath
  - | PLRemote Text RemotePackageType
- data RemotePackageType
  - = RPTHttp
  - | RPTGit Text
  - | RPTHg Text
- data PackageIndex = PackageIndex {
  - indexName :: !IndexName
  - indexLocation :: !IndexLocation
  - indexDownloadPrefix :: !Text
  - indexGpgVerify :: !Bool
  - indexRequireHashes :: !Bool
  }
- newtype IndexName = IndexName {
  - unIndexName :: ByteString
  }
- indexNameText :: IndexName -> Text
- data IndexLocation
  - = ILGit !Text
  - | ILHttp !Text !HttpType
  - | ILGitHttp !Text !Text !HttpType
- configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexCacheOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File)
- configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir)
- configPackageIndexRepo :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Maybe (Path Abs Dir))
- configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File)
- data Project = Project {
  - projectUserMsg :: !(Maybe String)
  - projectPackages :: ![PackageEntry]
  - projectExtraDeps :: !(Map PackageName Version)
  - projectFlags :: !PackageFlags
  - projectResolver :: !Resolver
  - projectCompiler :: !(Maybe CompilerVersion)
  - projectExtraPackageDBs :: ![FilePath]
  }
- data ProjectAndConfigMonoid = ProjectAndConfigMonoid !Project !ConfigMonoid
- data PvpBounds
  - = PvpBoundsNone
  - | PvpBoundsUpper
  - | PvpBoundsLower
  - | PvpBoundsBoth
- parsePvpBounds :: Text -> Either String PvpBounds
- data ColorWhen
  - = ColorNever
  - | ColorAlways
  - | ColorAuto
- readColorWhen :: ReadM ColorWhen
- data SCM = Git
- data CustomSnapshot = CustomSnapshot {
  - csCompilerVersion :: !(Maybe CompilerVersion)
  - csPackages :: !(Set PackageIdentifier)
  - csDropPackages :: !(Set PackageName)
  - csFlags :: !PackageFlags
  - csGhcOptions :: !GhcOptions
  }
- newtype GhcOptions = GhcOptions {
  - unGhcOptions :: Map (Maybe PackageName) [Text]
  }
- ghcOptionsFor :: PackageName -> GhcOptions -> [Text]
- newtype PackageFlags = PackageFlags {
  - unPackageFlags :: Map PackageName (Map FlagName Bool)
  }
- bindirSuffix :: Path Rel Dir
- configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File)
- configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File)
- getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir)
- docDirSuffix :: Path Rel Dir
- flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir])
- hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File)
- packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- packageDatabaseExtra :: (MonadReader env m, HasEnvConfig env) => m [Path Abs Dir]
- packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir)
- platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir)
- platformGhcRelDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir)
- platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir)
- useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir)
- workDirL :: HasConfig env => Lens' env (Path Rel Dir)
- data EvalOpts = EvalOpts {
  - evalArg :: !String
  - evalExtra :: !ExecOptsExtra
  }
- data ExecOpts = ExecOpts {
  - eoCmd :: !SpecialExecCmd
  - eoArgs :: ![String]
  - eoExtra :: !ExecOptsExtra
  }
- data SpecialExecCmd
  - = ExecCmd String
  - | ExecGhc
  - | ExecRunGhc
- data ExecOptsExtra
  - = ExecOptsPlain
  - | ExecOptsEmbellished {
    - eoEnvSettings :: !EnvSettings
    - eoPackages :: ![String]
    - eoRtsOptions :: ![String]
    }
- data DownloadInfo = DownloadInfo {
  - downloadInfoUrl :: Text
  - downloadInfoContentLength :: Maybe Int
  - downloadInfoSha1 :: Maybe ByteString
  }
- data VersionedDownloadInfo = VersionedDownloadInfo {
  - vdiVersion :: Version
  - vdiDownloadInfo :: DownloadInfo
  }
- data GHCDownloadInfo = GHCDownloadInfo {
  - gdiConfigureOpts :: [Text]
  - gdiConfigureEnv :: Map Text Text
  - gdiDownloadInfo :: DownloadInfo
  }
- data SetupInfo = SetupInfo {
  - siSevenzExe :: Maybe DownloadInfo
  - siSevenzDll :: Maybe DownloadInfo
  - siMsys2 :: Map Text VersionedDownloadInfo
  - siGHCs :: Map Text (Map Version GHCDownloadInfo)
  - siGHCJSs :: Map Text (Map CompilerVersion DownloadInfo)
  - siStack :: Map Text (Map Version DownloadInfo)
  }
- data SetupInfoLocation
  - = SetupInfoFileOrURL String
  - | SetupInfoInline SetupInfo
- newtype DockerEntrypoint = DockerEntrypoint {
  - deUser :: Maybe DockerUser
  }
- data DockerUser = DockerUser {
  - duUid :: UserID
  - duGid :: GroupID
  - duGroups :: [GroupID]
  - duUmask :: FileMode
  }
- wantedCompilerVersionL :: HasBuildConfig s => Lens' s CompilerVersion
- actualCompilerVersionL :: HasEnvConfig s => Lens' s CompilerVersion
- buildOptsL :: HasConfig s => Lens' s BuildOpts
- globalOptsL :: Lens' GlobalOpts ConfigMonoid
- buildOptsInstallExesL :: Lens' BuildOpts Bool
- buildOptsMonoidHaddockL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidTestsL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsMonoidInstallExesL :: Lens' BuildOptsMonoid (Maybe Bool)
- buildOptsHaddockL :: Lens' BuildOpts Bool
- globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid
- packageIndicesL :: HasConfig s => Lens' s [PackageIndex]
- packageCachesL :: HasConfig env => Lens' env (IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize))))
- stackRootL :: HasConfig s => Lens' s (Path Abs Dir)
- configUrlsL :: HasConfig env => Lens' env Urls
- cabalVersionL :: HasEnvConfig env => Lens' env Version
- whichCompilerL :: Getting r CompilerVersion WhichCompiler
- view :: MonadReader s m => Getting a s a -> m a
- to :: (s -> a) -> SimpleGetter s a

# Main configuration types and classes

## HasPlatform & HasStackRoot

class HasPlatform env where #

Class for environment values which have a Platform

Methods

platformL :: Lens' env Platform #

platformL :: HasConfig env => Lens' env Platform #

platformVariantL :: Lens' env PlatformVariant #

platformVariantL :: HasConfig env => Lens' env PlatformVariant #

Instances

HasPlatform EnvConfig # |
Methods platformL :: Lens' EnvConfig Platform # platformVariantL :: Lens' EnvConfig PlatformVariant #
HasPlatform BuildConfig # |
Methods platformL :: Lens' BuildConfig Platform # platformVariantL :: Lens' BuildConfig PlatformVariant #
HasPlatform Config # |
Methods platformL :: Lens' Config Platform # platformVariantL :: Lens' Config PlatformVariant #
HasPlatform MiniConfig # |
Methods platformL :: Lens' MiniConfig Platform # platformVariantL :: Lens' MiniConfig PlatformVariant #
HasPlatform config => HasPlatform (Env config) # |
Methods platformL :: Lens' (Env config) Platform # platformVariantL :: Lens' (Env config) PlatformVariant #
HasPlatform (Platform, PlatformVariant) # |
Methods platformL :: Lens' (Platform, PlatformVariant) Platform # platformVariantL :: Lens' (Platform, PlatformVariant) PlatformVariant #

data PlatformVariant #

A variant of the platform, used to differentiate Docker builds from host

Constructors

PlatformVariantNone |
PlatformVariant String |

Instances

HasPlatform (Platform, PlatformVariant) # |
Methods platformL :: Lens' (Platform, PlatformVariant) Platform # platformVariantL :: Lens' (Platform, PlatformVariant) PlatformVariant #

## Config & HasConfig

data Config #

The top-level Stackage configuration.

Constructors

Config |
Fields configStackRoot :: !(Path Abs Dir) ~/.stack more often than not configWorkDir :: !(Path Rel Dir) this allows to override .stack-work directory configUserConfigPath :: !(Path Abs File) Path to user configuration file (usually ~.stackconfig.yaml) configBuild :: !BuildOpts Build configuration configDocker :: !DockerOpts Docker configuration configNix :: !NixOpts Execution environment (e.g nix-shell) configuration configEnvOverride :: !(EnvSettings -> IO EnvOverride) Environment variables to be passed to external tools configLocalProgramsBase :: !(Path Abs Dir) Non-platform-specific path containing local installations configLocalPrograms :: !(Path Abs Dir) Path containing local installations (mainly GHC) configConnectionCount :: !Int How many concurrent connections are allowed when downloading configHideTHLoading :: !Bool Hide the Template Haskell "Loading package ..." messages from the console configPlatform :: !Platform The platform we're building for, used in many directory names configPlatformVariant :: !PlatformVariant Variant of the platform, also used in directory names configGHCVariant0 :: !(Maybe GHCVariant) The variant of GHC requested by the user. In most cases, use `BuildConfig` or `MiniConfig`s version instead, which will have an auto-detected default. configGHCBuild :: !(Maybe CompilerBuild) Override build of the compiler distribution (e.g. standard, gmp4, tinfo6) configUrls :: !Urls URLs for other files used by stack. TODO: Better document e.g. The latest snapshot file. A build plan name (e.g. lts5.9.yaml) is appended when downloading the build plan actually. configPackageIndices :: ![PackageIndex] Information on package indices. This is left biased, meaning that packages in an earlier index will shadow those in a later index. Warning: if you override packages in an index vs what's available upstream, you may correct your compiled snapshots, as different projects may have different definitions of what pkg-ver means! This feature is primarily intended for adding local packages, not overriding. Overriding is better accomplished by adding to your list of packages. Note that indices specified in a later config file will override previous indices, not extend them. Using an assoc list instead of a Map to keep track of priority configSystemGHC :: !Bool Should we use the system-installed GHC (on the PATH) if available? Can be overridden by command line options. configInstallGHC :: !Bool Should we automatically install GHC if missing or the wrong version is available? Can be overridden by command line options. configSkipGHCCheck :: !Bool Don't bother checking the GHC version or architecture. configSkipMsys :: !Bool On Windows: don't use a sandboxed MSYS configCompilerCheck :: !VersionCheck Specifies which versions of the compiler are acceptable. configLocalBin :: !(Path Abs Dir) Directory we should install executables into configRequireStackVersion :: !VersionRange Require a version of stack within this range. configJobs :: !Int How many concurrent jobs to run, defaults to number of capabilities configOverrideGccPath :: !(Maybe (Path Abs File)) Optional gcc override path configExtraIncludeDirs :: !(Set (Path Abs Dir)) -extra-include-dirs arguments configExtraLibDirs :: !(Set (Path Abs Dir)) -extra-lib-dirs arguments configConcurrentTests :: !Bool Run test suites concurrently configImage :: !ImageOpts configTemplateParams :: !(Map Text Text) Parameters for templates. configScmInit :: !(Maybe SCM) Initialize SCM (e.g. git) when creating new projects. configGhcOptions :: !GhcOptions Additional GHC options to apply to either all packages (Nothing) or a specific package (Just). configSetupInfoLocations :: ![SetupInfoLocation] Additional SetupInfo (inline or remote) to use to find tools. configPvpBounds :: !PvpBounds How PVP upper bounds should be added to packages configModifyCodePage :: !Bool Force the code page to UTF-8 on Windows configExplicitSetupDeps :: !(Map (Maybe PackageName) Bool) See `explicitSetupDeps`. `Nothing` provides the default value. configRebuildGhcOptions :: !Bool Rebuild on GHC options changes configApplyGhcOptions :: !ApplyGhcOptions Which packages to ghc-options on the command line apply to? configAllowNewer :: !Bool Ignore version ranges in .cabal files. Funny naming chosen to match cabal. configDefaultTemplate :: !(Maybe TemplateName) The default template to use when none is specified. (If Nothing, the default default is used.) configAllowDifferentUser :: !Bool Allow users other than the stack root owner to use the stack installation. configPackageCaches :: !(IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize)))) In memory cache of hackage index. configDumpLogs :: !DumpLogs Dump logs of local non-dependencies when doing a build. configMaybeProject :: !(Maybe (Project, Path Abs File)) `Just` when a local project can be found, `Nothing` when stack must fall back on the implicit global project. configAllowLocals :: !Bool Are we allowed to build local packages? The script command disallows this.

Instances

HasConfig Config # |
Methods configL :: Lens' Config Config #
HasPlatform Config # |
Methods platformL :: Lens' Config Platform # platformVariantL :: Lens' Config PlatformVariant #

class HasPlatform env => HasConfig env where #

Class for environment values that can provide a `Config`.

Methods

configL :: Lens' env Config #

configL :: HasBuildConfig env => Lens' env Config #

Instances

HasConfig EnvConfig # |
Methods configL :: Lens' EnvConfig Config #
HasConfig BuildConfig # |
Methods configL :: Lens' BuildConfig Config #
HasConfig Config # |
Methods configL :: Lens' Config Config #
HasConfig MiniConfig # |
Methods configL :: Lens' MiniConfig Config #
HasConfig config => HasConfig (Env config) # |
Methods configL :: Lens' (Env config) Config #

askLatestSnapshotUrl :: (MonadReader env m, HasConfig env) => m Text #

Get the URL to request the information on the latest snapshots

explicitSetupDeps :: (MonadReader env m, HasConfig env) => PackageName -> m Bool #

Provide an explicit list of package dependencies when running a custom Setup.hs

getMinimalEnvOverride :: (MonadReader env m, HasConfig env, MonadIO m) => m EnvOverride #

Get the minimal environment override, useful for just calling external processes like git or ghc

## BuildConfig & HasBuildConfig

data BuildConfig #

A superset of `Config` adding information on how to build code. The reason for this breakdown is because we will need some of the information from `Config` in order to determine the values here.

These are the components which know nothing about local configuration.

Constructors

BuildConfig |
Fields bcConfig :: !Config bcResolver :: !LoadedResolver How we resolve which dependencies to install given a set of packages. bcWantedMiniBuildPlan :: !MiniBuildPlan Build plan wanted for this build bcGHCVariant :: !GHCVariant The variant of GHC used to select a GHC bindist. bcPackageEntries :: ![PackageEntry] Local packages bcExtraDeps :: !(Map PackageName Version) Extra dependencies specified in configuration. These dependencies will not be installed to a shared location, and will override packages provided by the resolver. bcExtraPackageDBs :: ![Path Abs Dir] Extra package databases bcStackYaml :: !(Path Abs File) Location of the stack.yaml file. Note: if the STACK_YAML environment variable is used, this may be different from projectRootL / "stack.yaml" FIXME MSS 2016-12-08: is the above comment still true? projectRootL is defined in terms of bcStackYaml bcFlags :: !PackageFlags Per-package flag overrides bcImplicitGlobal :: !Bool Are we loading from the implicit global stack.yaml? This is useful for providing better error messages.

Instances

HasBuildConfig BuildConfig # |
Methods buildConfigL :: Lens' BuildConfig BuildConfig #
HasConfig BuildConfig # |
Methods configL :: Lens' BuildConfig Config #
HasGHCVariant BuildConfig # |
Methods ghcVariantL :: Lens' BuildConfig GHCVariant #
HasPlatform BuildConfig # |
Methods platformL :: Lens' BuildConfig Platform # platformVariantL :: Lens' BuildConfig PlatformVariant #

stackYamlL :: HasBuildConfig env => Lens' env (Path Abs File) #

projectRootL :: HasBuildConfig env => Getting r env (Path Abs Dir) #

Directory containing the project's stack.yaml file

class HasConfig env => HasBuildConfig env where #

Methods

buildConfigL :: Lens' env BuildConfig #

buildConfigL :: HasEnvConfig env => Lens' env BuildConfig #

Instances

HasBuildConfig EnvConfig # |
Methods buildConfigL :: Lens' EnvConfig BuildConfig #
HasBuildConfig BuildConfig # |
Methods buildConfigL :: Lens' BuildConfig BuildConfig #
HasBuildConfig config => HasBuildConfig (Env config) # |
Methods buildConfigL :: Lens' (Env config) BuildConfig #

## GHCVariant & HasGHCVariant

data GHCVariant #

Specialized bariant of GHC (e.g. libgmp4 or integer-simple)

Constructors

GHCStandard | Standard bindist
GHCIntegerSimple | Bindist that uses integer-simple
GHCCustom String | Other bindists

Instances

Show GHCVariant # |
Methods showsPrec :: Int -> GHCVariant -> ShowS # show :: GHCVariant -> String # showList :: [GHCVariant] -> ShowS #
FromJSON GHCVariant # |
Methods parseJSON :: Value -> Parser GHCVariant # parseJSONList :: Value -> Parser [GHCVariant] #
HasGHCVariant GHCVariant # |
Methods ghcVariantL :: Lens' GHCVariant GHCVariant #

ghcVariantName :: GHCVariant -> String #

Render a GHC variant to a String.

ghcVariantSuffix :: GHCVariant -> String #

Render a GHC variant to a String suffix.

parseGHCVariant :: MonadThrow m => String -> m GHCVariant #

Parse GHC variant from a String.

class HasGHCVariant env where #

Class for environment values which have a GHCVariant

Methods

ghcVariantL :: Lens' env GHCVariant #

ghcVariantL :: HasBuildConfig env => Lens' env GHCVariant #

Instances

HasGHCVariant GHCVariant # |
Methods ghcVariantL :: Lens' GHCVariant GHCVariant #
HasGHCVariant EnvConfig # |
Methods ghcVariantL :: Lens' EnvConfig GHCVariant #
HasGHCVariant BuildConfig # |
Methods ghcVariantL :: Lens' BuildConfig GHCVariant #
HasGHCVariant MiniConfig # |
Methods ghcVariantL :: Lens' MiniConfig GHCVariant #
HasGHCVariant config => HasGHCVariant (Env config) # |
Methods ghcVariantL :: Lens' (Env config) GHCVariant #

snapshotsDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Abs Dir) #

Directory containing snapshots

## Constraint synonym for use with StackMini

type StackMiniM r m = (MonadReader r m, MonadIO m, MonadBaseControl IO m, MonadLoggerIO m, MonadMask m) #

Constraint synonym for constraints satisfied by a `MiniConfig` environment.

## EnvConfig & HasEnvConfig

data EnvConfig #

Configuration after the environment has been setup.

Constructors

EnvConfig |
Fields envConfigBuildConfig :: !BuildConfig envConfigCabalVersion :: !Version This is the version of Cabal that stack will use to compile Setup.hs files in the build process. Note that this is not necessarily the same version as the one that stack depends on as a library and which is displayed when running `stack list-dependencies | grep Cabal` in the stack project. envConfigCompilerVersion :: !CompilerVersion The actual version of the compiler to be used, as opposed to `wantedCompilerL`, which provides the version specified by the build plan. envConfigCompilerBuild :: !CompilerBuild envConfigPackagesRef :: !(IORef (Maybe (Map (Path Abs Dir) TreatLikeExtraDep))) Cache for `getLocalPackages`.

Instances

HasEnvConfig EnvConfig # |
Methods envConfigL :: Lens' EnvConfig EnvConfig #
HasBuildConfig EnvConfig # |
Methods buildConfigL :: Lens' EnvConfig BuildConfig #
HasConfig EnvConfig # |
Methods configL :: Lens' EnvConfig Config #
HasGHCVariant EnvConfig # |
Methods ghcVariantL :: Lens' EnvConfig GHCVariant #
HasPlatform EnvConfig # |
Methods platformL :: Lens' EnvConfig Platform # platformVariantL :: Lens' EnvConfig PlatformVariant #

class (HasBuildConfig env, HasGHCVariant env) => HasEnvConfig env where #

Minimal complete definition

envConfigL

Methods

envConfigL :: Lens' env EnvConfig #

Instances

HasEnvConfig EnvConfig # |
Methods envConfigL :: Lens' EnvConfig EnvConfig #
HasEnvConfig config => HasEnvConfig (Env config) # |
Methods envConfigL :: Lens' (Env config) EnvConfig #

getCompilerPath :: (MonadIO m, MonadThrow m, MonadReader env m, HasConfig env) => WhichCompiler -> m (Path Abs File) #

Get the path for the given compiler ignoring any local binaries.

https://github.com/commercialhaskell/stack/issues/1052

# Details

## ApplyGhcOptions

data ApplyGhcOptions #

Which packages do ghc-options on the command line apply to?

Constructors

AGOTargets | all local targets
AGOLocals | all local packages, even non-targets
AGOEverything | every package

Instances

Bounded ApplyGhcOptions # |
Methods minBound :: ApplyGhcOptions # maxBound :: ApplyGhcOptions #
Enum ApplyGhcOptions # |
Methods succ :: ApplyGhcOptions -> ApplyGhcOptions # pred :: ApplyGhcOptions -> ApplyGhcOptions # toEnum :: Int -> ApplyGhcOptions # fromEnum :: ApplyGhcOptions -> Int # enumFrom :: ApplyGhcOptions -> [ApplyGhcOptions] # enumFromThen :: ApplyGhcOptions -> ApplyGhcOptions -> [ApplyGhcOptions] # enumFromTo :: ApplyGhcOptions -> ApplyGhcOptions -> [ApplyGhcOptions] # enumFromThenTo :: ApplyGhcOptions -> ApplyGhcOptions -> ApplyGhcOptions -> [ApplyGhcOptions] #
Eq ApplyGhcOptions # |
Methods (==) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool # (/=) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool #
Ord ApplyGhcOptions # |
Methods compare :: ApplyGhcOptions -> ApplyGhcOptions -> Ordering # (<) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool # (<=) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool # (>) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool # (>=) :: ApplyGhcOptions -> ApplyGhcOptions -> Bool # max :: ApplyGhcOptions -> ApplyGhcOptions -> ApplyGhcOptions # min :: ApplyGhcOptions -> ApplyGhcOptions -> ApplyGhcOptions #
Read ApplyGhcOptions # |
Methods readsPrec :: Int -> ReadS ApplyGhcOptions # readList :: ReadS [ApplyGhcOptions] # readPrec :: ReadPrec ApplyGhcOptions # readListPrec :: ReadPrec [ApplyGhcOptions] #
Show ApplyGhcOptions # |
Methods showsPrec :: Int -> ApplyGhcOptions -> ShowS # show :: ApplyGhcOptions -> String # showList :: [ApplyGhcOptions] -> ShowS #
FromJSON ApplyGhcOptions # |
Methods parseJSON :: Value -> Parser ApplyGhcOptions # parseJSONList :: Value -> Parser [ApplyGhcOptions] #

## ConfigException

data ConfigException #

Constructors

ParseConfigFileException (Path Abs File) ParseException |
ParseCustomSnapshotException Text ParseException |
ParseResolverException Text |
NoProjectConfigFound (Path Abs Dir) (Maybe Text) |
UnexpectedArchiveContents [Path Abs Dir] [Path Abs File] |
UnableToExtractArchive Text (Path Abs File) |
BadStackVersionException VersionRange |
NoMatchingSnapshot WhichSolverCmd (NonEmpty SnapName) |
ResolverMismatch WhichSolverCmd (ResolverThat's l) String |
ResolverPartial WhichSolverCmd Resolver String |
NoSuchDirectory FilePath |
ParseGHCVariantException String |
BadStackRoot (Path Abs Dir) |
Won'tCreateStackRootInDirectoryOwnedByDifferentUser (Path Abs Dir) (Path Abs Dir) | `$STACK_ROOT`, parent dir
UserDoesn'tOwnDirectory (Path Abs Dir) |
FailedToCloneRepo String |
ManualGHCVariantSettingsAreIncompatibleWithSystemGHC |
NixRequiresSystemGhc |
NoResolverWhenUsingNoLocalConfig |
InvalidResolverForNoLocalConfig String |

Instances

Show ConfigException # |
Methods showsPrec :: Int -> ConfigException -> ShowS # show :: ConfigException -> String # showList :: [ConfigException] -> ShowS #
Exception ConfigException # |
Methods toException :: ConfigException -> SomeException # fromException :: SomeException -> Maybe ConfigException # displayException :: ConfigException -> String #

## WhichSolverCmd

data WhichSolverCmd #

Constructors

IsInitCmd |
IsSolverCmd |
IsNewCmd |

## ConfigMonoid

data ConfigMonoid #

Constructors

ConfigMonoid |
Fields configMonoidStackRoot :: !(First (Path Abs Dir)) See: `configStackRoot` configMonoidWorkDir :: !(First (Path Rel Dir)) See: `configWorkDir`. configMonoidBuildOpts :: !BuildOptsMonoid build options. configMonoidDockerOpts :: !DockerOptsMonoid Docker options. configMonoidNixOpts :: !NixOptsMonoid Options for the execution environment (nix-shell or container) configMonoidConnectionCount :: !(First Int) See: `configConnectionCount` configMonoidHideTHLoading :: !(First Bool) See: `configHideTHLoading` configMonoidLatestSnapshotUrl :: !(First Text) Deprecated in favour of `urlsMonoidLatestSnapshot` configMonoidUrls :: !UrlsMonoid See: 'configUrls configMonoidPackageIndices :: !(First [PackageIndex]) See: `configPackageIndices` configMonoidSystemGHC :: !(First Bool) See: `configSystemGHC` configMonoidInstallGHC :: !(First Bool) See: `configInstallGHC` configMonoidSkipGHCCheck :: !(First Bool) See: `configSkipGHCCheck` configMonoidSkipMsys :: !(First Bool) See: `configSkipMsys` configMonoidCompilerCheck :: !(First VersionCheck) See: `configCompilerCheck` configMonoidRequireStackVersion :: !IntersectingVersionRange See: `configRequireStackVersion` configMonoidArch :: !(First String) Used for overriding the platform configMonoidGHCVariant :: !(First GHCVariant) Used for overriding the platform configMonoidGHCBuild :: !(First CompilerBuild) Used for overriding the GHC build configMonoidJobs :: !(First Int) See: `configJobs` configMonoidExtraIncludeDirs :: !(Set (Path Abs Dir)) See: `configExtraIncludeDirs` configMonoidExtraLibDirs :: !(Set (Path Abs Dir)) See: `configExtraLibDirs` configMonoidOverrideGccPath :: !(First (Path Abs File)) Allow users to override the path to gcc configMonoidConcurrentTests :: !(First Bool) See: `configConcurrentTests` configMonoidLocalBinPath :: !(First FilePath) Used to override the binary installation dir configMonoidImageOpts :: !ImageOptsMonoid Image creation options. configMonoidTemplateParameters :: !(Map Text Text) Template parameters. configMonoidScmInit :: !(First SCM) Initialize SCM (e.g. git init) when making new projects? configMonoidGhcOptions :: !GhcOptions See `configGhcOptions` configMonoidExtraPath :: ![Path Abs Dir] Additional paths to search for executables in configMonoidSetupInfoLocations :: ![SetupInfoLocation] Additional setup info (inline or remote) to use for installing tools configMonoidLocalProgramsBase :: !(First (Path Abs Dir)) Override the default local programs dir, where e.g. GHC is installed. configMonoidPvpBounds :: !(First PvpBounds) See `configPvpBounds` configMonoidModifyCodePage :: !(First Bool) See `configModifyCodePage` configMonoidExplicitSetupDeps :: !(Map (Maybe PackageName) Bool) See `configExplicitSetupDeps` configMonoidRebuildGhcOptions :: !(First Bool) See `configMonoidRebuildGhcOptions` configMonoidApplyGhcOptions :: !(First ApplyGhcOptions) See `configApplyGhcOptions` configMonoidAllowNewer :: !(First Bool) See `configMonoidAllowNewer` configMonoidDefaultTemplate :: !(First TemplateName) The default template to use when none is specified. (If Nothing, the default default is used.) configMonoidAllowDifferentUser :: !(First Bool) Allow users other than the stack root owner to use the stack installation. configMonoidDumpLogs :: !(First DumpLogs) See `configDumpLogs`

Instances

Show ConfigMonoid # |
Methods showsPrec :: Int -> ConfigMonoid -> ShowS # show :: ConfigMonoid -> String # showList :: [ConfigMonoid] -> ShowS #
Generic ConfigMonoid # |
Associated Types type Rep ConfigMonoid :: * -> * # Methods from :: ConfigMonoid -> Rep ConfigMonoid x # to :: Rep ConfigMonoid x -> ConfigMonoid #
Monoid ConfigMonoid # |
Methods mempty :: ConfigMonoid # mappend :: ConfigMonoid -> ConfigMonoid -> ConfigMonoid # mconcat :: [ConfigMonoid] -> ConfigMonoid #
FromJSON (WithJSONWarnings ConfigMonoid) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings ConfigMonoid) # parseJSONList :: Value -> Parser [WithJSONWarnings ConfigMonoid] #
type Rep ConfigMonoid # |
type Rep ConfigMonoid = D1 (MetaData "ConfigMonoid" "Stack.Types.Config" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "ConfigMonoid" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidStackRoot") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First (Path Abs Dir)))) (S1 (MetaSel (Just Symbol "configMonoidWorkDir") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First (Path Rel Dir))))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidBuildOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BuildOptsMonoid)) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidDockerOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 DockerOptsMonoid)) (S1 (MetaSel (Just Symbol "configMonoidNixOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 NixOptsMonoid))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidConnectionCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Int))) (S1 (MetaSel (Just Symbol "configMonoidHideTHLoading") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidLatestSnapshotUrl") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Text))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidUrls") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 UrlsMonoid)) (S1 (MetaSel (Just Symbol "configMonoidPackageIndices") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First [PackageIndex]))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidSystemGHC") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidInstallGHC") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidSkipGHCCheck") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidSkipMsys") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidCompilerCheck") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First VersionCheck)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidRequireStackVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 IntersectingVersionRange)) (S1 (MetaSel (Just Symbol "configMonoidArch") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First String)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidGHCVariant") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First GHCVariant))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidGHCBuild") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First CompilerBuild))) (S1 (MetaSel (Just Symbol "configMonoidJobs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Int)))))))) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidExtraIncludeDirs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Set (Path Abs Dir)))) (S1 (MetaSel (Just Symbol "configMonoidExtraLibDirs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Set (Path Abs Dir))))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidOverrideGccPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First (Path Abs File)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidConcurrentTests") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidLocalBinPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First FilePath)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidImageOpts") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ImageOptsMonoid)) (S1 (MetaSel (Just Symbol "configMonoidTemplateParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map Text Text)))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidScmInit") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First SCM))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 GhcOptions)) (S1 (MetaSel (Just Symbol "configMonoidExtraPath") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Path Abs Dir])))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidSetupInfoLocations") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [SetupInfoLocation])) (S1 (MetaSel (Just Symbol "configMonoidLocalProgramsBase") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First (Path Abs Dir))))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidPvpBounds") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First PvpBounds))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidModifyCodePage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidExplicitSetupDeps") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map (Maybe PackageName) Bool)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidRebuildGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidApplyGhcOptions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First ApplyGhcOptions))) (S1 (MetaSel (Just Symbol "configMonoidAllowNewer") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidDefaultTemplate") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First TemplateName))) ((:*:) (S1 (MetaSel (Just Symbol "configMonoidAllowDifferentUser") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "configMonoidDumpLogs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First DumpLogs))))))))))

configMonoidInstallGHCName :: Text #

configMonoidSystemGHCName :: Text #

## DumpLogs

data DumpLogs #

Which build log files to dump

Constructors

DumpNoLogs | don't dump any logfiles
DumpWarningLogs | dump logfiles containing warnings
DumpAllLogs | dump all logfiles

Instances

Bounded DumpLogs # |
Methods minBound :: DumpLogs # maxBound :: DumpLogs #
Enum DumpLogs # |
Methods succ :: DumpLogs -> DumpLogs # pred :: DumpLogs -> DumpLogs # toEnum :: Int -> DumpLogs # fromEnum :: DumpLogs -> Int # enumFrom :: DumpLogs -> [DumpLogs] # enumFromThen :: DumpLogs -> DumpLogs -> [DumpLogs] # enumFromTo :: DumpLogs -> DumpLogs -> [DumpLogs] # enumFromThenTo :: DumpLogs -> DumpLogs -> DumpLogs -> [DumpLogs] #
Eq DumpLogs # |
Methods (==) :: DumpLogs -> DumpLogs -> Bool # (/=) :: DumpLogs -> DumpLogs -> Bool #
Ord DumpLogs # |
Methods compare :: DumpLogs -> DumpLogs -> Ordering # (<) :: DumpLogs -> DumpLogs -> Bool # (<=) :: DumpLogs -> DumpLogs -> Bool # (>) :: DumpLogs -> DumpLogs -> Bool # (>=) :: DumpLogs -> DumpLogs -> Bool # max :: DumpLogs -> DumpLogs -> DumpLogs # min :: DumpLogs -> DumpLogs -> DumpLogs #
Read DumpLogs # |
Methods readsPrec :: Int -> ReadS DumpLogs # readList :: ReadS [DumpLogs] # readPrec :: ReadPrec DumpLogs # readListPrec :: ReadPrec [DumpLogs] #
Show DumpLogs # |
Methods showsPrec :: Int -> DumpLogs -> ShowS # show :: DumpLogs -> String # showList :: [DumpLogs] -> ShowS #
FromJSON DumpLogs # |
Methods parseJSON :: Value -> Parser DumpLogs # parseJSONList :: Value -> Parser [DumpLogs] #

## EnvSettings

data EnvSettings #

Controls which version of the environment is used

Constructors

EnvSettings |
Fields esIncludeLocals :: !Bool include local project bin directory, GHC_PACKAGE_PATH, etc esIncludeGhcPackagePath :: !Bool include the GHC_PACKAGE_PATH variable esStackExe :: !Bool set the STACK_EXE variable to the current executable name esLocaleUtf8 :: !Bool set the locale to C.UTF-8

Instances

Eq EnvSettings # |
Methods (==) :: EnvSettings -> EnvSettings -> Bool # (/=) :: EnvSettings -> EnvSettings -> Bool #
Ord EnvSettings # |
Methods compare :: EnvSettings -> EnvSettings -> Ordering # (<) :: EnvSettings -> EnvSettings -> Bool # (<=) :: EnvSettings -> EnvSettings -> Bool # (>) :: EnvSettings -> EnvSettings -> Bool # (>=) :: EnvSettings -> EnvSettings -> Bool # max :: EnvSettings -> EnvSettings -> EnvSettings # min :: EnvSettings -> EnvSettings -> EnvSettings #
Show EnvSettings # |
Methods showsPrec :: Int -> EnvSettings -> ShowS # show :: EnvSettings -> String # showList :: [EnvSettings] -> ShowS #

minimalEnvSettings :: EnvSettings #

## GlobalOpts & GlobalOptsMonoid

data GlobalOpts #

Parsed global command-line options.

Constructors

GlobalOpts |
Fields globalReExecVersion :: !(Maybe String) Expected re-exec in container version globalDockerEntrypoint :: !(Maybe DockerEntrypoint) Data used when stack is acting as a Docker entrypoint (internal use only) globalLogLevel :: !LogLevel Log level globalTimeInLog :: !Bool Whether to include timings in logs. globalConfigMonoid :: !ConfigMonoid Config monoid, for passing into `loadConfig` globalResolver :: !(Maybe AbstractResolver) Resolver override globalCompiler :: !(Maybe CompilerVersion) Compiler override globalTerminal :: !Bool We're in a terminal? globalColorWhen :: !ColorWhen When to use ansi terminal colors globalStackYaml :: !(StackYamlLoc FilePath) Override project stack.yaml

Instances

Show GlobalOpts # |
Methods showsPrec :: Int -> GlobalOpts -> ShowS # show :: GlobalOpts -> String # showList :: [GlobalOpts] -> ShowS #

data GlobalOptsMonoid #

Parsed global command-line options monoid.

Constructors

GlobalOptsMonoid |
Fields globalMonoidReExecVersion :: !(First String) Expected re-exec in container version globalMonoidDockerEntrypoint :: !(First DockerEntrypoint) Data used when stack is acting as a Docker entrypoint (internal use only) globalMonoidLogLevel :: !(First LogLevel) Log level globalMonoidTimeInLog :: !(First Bool) Whether to include timings in logs. globalMonoidConfigMonoid :: !ConfigMonoid Config monoid, for passing into `loadConfig` globalMonoidResolver :: !(First AbstractResolver) Resolver override globalMonoidCompiler :: !(First CompilerVersion) Compiler override globalMonoidTerminal :: !(First Bool) We're in a terminal? globalMonoidColorWhen :: !(First ColorWhen) When to use ansi colors globalMonoidStackYaml :: !(First FilePath) Override project stack.yaml

Instances

Show GlobalOptsMonoid # |
Methods showsPrec :: Int -> GlobalOptsMonoid -> ShowS # show :: GlobalOptsMonoid -> String # showList :: [GlobalOptsMonoid] -> ShowS #
Generic GlobalOptsMonoid # |
Associated Types type Rep GlobalOptsMonoid :: * -> * # Methods from :: GlobalOptsMonoid -> Rep GlobalOptsMonoid x # to :: Rep GlobalOptsMonoid x -> GlobalOptsMonoid #
Monoid GlobalOptsMonoid # |
Methods mempty :: GlobalOptsMonoid # mappend :: GlobalOptsMonoid -> GlobalOptsMonoid -> GlobalOptsMonoid # mconcat :: [GlobalOptsMonoid] -> GlobalOptsMonoid #
type Rep GlobalOptsMonoid # |
type Rep GlobalOptsMonoid = D1 (MetaData "GlobalOptsMonoid" "Stack.Types.Config" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) (C1 (MetaCons "GlobalOptsMonoid" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidReExecVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First String))) (S1 (MetaSel (Just Symbol "globalMonoidDockerEntrypoint") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First DockerEntrypoint)))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidLogLevel") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First LogLevel))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidTimeInLog") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) (S1 (MetaSel (Just Symbol "globalMonoidConfigMonoid") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ConfigMonoid))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidResolver") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First AbstractResolver))) (S1 (MetaSel (Just Symbol "globalMonoidCompiler") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First CompilerVersion)))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidTerminal") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First Bool))) ((:*:) (S1 (MetaSel (Just Symbol "globalMonoidColorWhen") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First ColorWhen))) (S1 (MetaSel (Just Symbol "globalMonoidStackYaml") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (First FilePath))))))))

data StackYamlLoc filepath #

Constructors

SYLDefault |
SYLOverride !filepath |
SYLNoConfig |

Instances

Functor StackYamlLoc # |
Methods fmap :: (a -> b) -> StackYamlLoc a -> StackYamlLoc b # (<$) :: a -> StackYamlLoc b -> StackYamlLoc a #
Foldable StackYamlLoc # |
Methods fold :: Monoid m => StackYamlLoc m -> m # foldMap :: Monoid m => (a -> m) -> StackYamlLoc a -> m # foldr :: (a -> b -> b) -> b -> StackYamlLoc a -> b # foldr' :: (a -> b -> b) -> b -> StackYamlLoc a -> b # foldl :: (b -> a -> b) -> b -> StackYamlLoc a -> b # foldl' :: (b -> a -> b) -> b -> StackYamlLoc a -> b # foldr1 :: (a -> a -> a) -> StackYamlLoc a -> a # foldl1 :: (a -> a -> a) -> StackYamlLoc a -> a # toList :: StackYamlLoc a -> [a] # null :: StackYamlLoc a -> Bool # length :: StackYamlLoc a -> Int # elem :: Eq a => a -> StackYamlLoc a -> Bool # maximum :: Ord a => StackYamlLoc a -> a # minimum :: Ord a => StackYamlLoc a -> a # sum :: Num a => StackYamlLoc a -> a # product :: Num a => StackYamlLoc a -> a #
Traversable StackYamlLoc # |
Methods traverse :: Applicative f => (a -> f b) -> StackYamlLoc a -> f (StackYamlLoc b) # sequenceA :: Applicative f => StackYamlLoc (f a) -> f (StackYamlLoc a) # mapM :: Monad m => (a -> m b) -> StackYamlLoc a -> m (StackYamlLoc b) # sequence :: Monad m => StackYamlLoc (m a) -> m (StackYamlLoc a) #
Show filepath => Show (StackYamlLoc filepath) # |
Methods showsPrec :: Int -> StackYamlLoc filepath -> ShowS # show :: StackYamlLoc filepath -> String # showList :: [StackYamlLoc filepath] -> ShowS #

defaultLogLevel :: LogLevel #

Default logging level should be something useful but not crazy.

## LoadConfig

data LoadConfig m #

Value returned by `loadConfig`.

Constructors

LoadConfig |
Fields lcConfig :: !Config Top-level Stack configuration. lcLoadBuildConfig :: !(Maybe CompilerVersion -> m BuildConfig) Action to load the remaining `BuildConfig`. lcProjectRoot :: !(Maybe (Path Abs Dir)) The project root directory, if in a project.

## PackageEntry & PackageLocation

data PackageEntry #

Constructors

PackageEntry |
Fields peExtraDepMaybe :: !(Maybe TreatLikeExtraDep) peLocation :: !PackageLocation peSubdirs :: ![FilePath]

Instances

Show PackageEntry # |
Methods showsPrec :: Int -> PackageEntry -> ShowS # show :: PackageEntry -> String # showList :: [PackageEntry] -> ShowS #
ToJSON PackageEntry # |
Methods toJSON :: PackageEntry -> Value # toEncoding :: PackageEntry -> Encoding # toJSONList :: [PackageEntry] -> Value # toEncodingList :: [PackageEntry] -> Encoding #
FromJSON (WithJSONWarnings PackageEntry) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageEntry) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageEntry] #

type TreatLikeExtraDep = Bool #

Should a package be treated just like an extra-dep?

`True` means, it will only be built as a dependency for others, and its test suite/benchmarks will not be run.

Useful modifying an upstream package, see: https://github.com/commercialhaskell/stack/issues/219 https://github.com/commercialhaskell/stack/issues/386

data PackageLocation #

Constructors

PLFilePath FilePath | Note that we use `FilePath` and not `Path`s. The goal is: first parse the value raw, and then use `canonicalizePath` and `parseAbsDir`.
PLRemote Text RemotePackageType | URL and further details

Instances

Show PackageLocation # |
Methods showsPrec :: Int -> PackageLocation -> ShowS # show :: PackageLocation -> String # showList :: [PackageLocation] -> ShowS #
ToJSON PackageLocation # |
Methods toJSON :: PackageLocation -> Value # toEncoding :: PackageLocation -> Encoding # toJSONList :: [PackageLocation] -> Value # toEncodingList :: [PackageLocation] -> Encoding #
FromJSON (WithJSONWarnings PackageLocation) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageLocation) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageLocation] #

data RemotePackageType #

Constructors

RPTHttp |
RPTGit Text | Commit
RPTHg Text | Commit

Instances

Show RemotePackageType # |
Methods showsPrec :: Int -> RemotePackageType -> ShowS # show :: RemotePackageType -> String # showList :: [RemotePackageType] -> ShowS #

## PackageIndex, IndexName & IndexLocation

data PackageIndex #

Information on a single package index

Constructors

PackageIndex |
Fields indexName :: !IndexName indexLocation :: !IndexLocation indexDownloadPrefix :: !Text URL prefix for downloading packages indexGpgVerify :: !Bool GPG-verify the package index during download. Only applies to Git repositories for now. indexRequireHashes :: !Bool Require that hashes and package size information be available for packages in this index

Instances

Show PackageIndex # |
Methods showsPrec :: Int -> PackageIndex -> ShowS # show :: PackageIndex -> String # showList :: [PackageIndex] -> ShowS #
FromJSON (WithJSONWarnings PackageIndex) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings PackageIndex) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageIndex] #

newtype IndexName #

Unique name for a package index

Constructors

IndexName |
Fields unIndexName :: ByteString

Instances

Eq IndexName # |
Methods (==) :: IndexName -> IndexName -> Bool # (/=) :: IndexName -> IndexName -> Bool #
Ord IndexName # |
Methods compare :: IndexName -> IndexName -> Ordering # (<) :: IndexName -> IndexName -> Bool # (<=) :: IndexName -> IndexName -> Bool # (>) :: IndexName -> IndexName -> Bool # (>=) :: IndexName -> IndexName -> Bool # max :: IndexName -> IndexName -> IndexName # min :: IndexName -> IndexName -> IndexName #
Show IndexName # |
Methods showsPrec :: Int -> IndexName -> ShowS # show :: IndexName -> String # showList :: [IndexName] -> ShowS #
Hashable IndexName # |
Methods hashWithSalt :: Int -> IndexName -> Int # hash :: IndexName -> Int #
FromJSON IndexName # |
Methods parseJSON :: Value -> Parser IndexName # parseJSONList :: Value -> Parser [IndexName] #
ToJSON IndexName # |
Methods toJSON :: IndexName -> Value # toEncoding :: IndexName -> Encoding # toJSONList :: [IndexName] -> Value # toEncodingList :: [IndexName] -> Encoding #
Store IndexName # |
Methods size :: Size IndexName # poke :: IndexName -> Poke () # peek :: Peek IndexName #

indexNameText :: IndexName -> Text #

data IndexLocation #

Location of the package index. This ensures that at least one of Git or HTTP is available.

Constructors

ILGit !Text |
ILHttp !Text !HttpType |
ILGitHttp !Text !Text !HttpType |

Instances

Eq IndexLocation # |
Methods (==) :: IndexLocation -> IndexLocation -> Bool # (/=) :: IndexLocation -> IndexLocation -> Bool #
Ord IndexLocation # |
Methods compare :: IndexLocation -> IndexLocation -> Ordering # (<) :: IndexLocation -> IndexLocation -> Bool # (<=) :: IndexLocation -> IndexLocation -> Bool # (>) :: IndexLocation -> IndexLocation -> Bool # (>=) :: IndexLocation -> IndexLocation -> Bool # max :: IndexLocation -> IndexLocation -> IndexLocation # min :: IndexLocation -> IndexLocation -> IndexLocation #
Show IndexLocation # |
Methods showsPrec :: Int -> IndexLocation -> ShowS # show :: IndexLocation -> String # showList :: [IndexLocation] -> ShowS #

configPackageIndex :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 01-index.tar file

configPackageIndexOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 00-index.tar file. This file is just a copy of the 01-index.tar file, provided for tools which still look for the 00-index.tar file.

configPackageIndexCache :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 01-index.cache file

configPackageIndexCacheOld :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 00-index.cache file

configPackageIndexGz :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs File) #

Location of the 01-index.tar.gz file

configPackageIndexRoot :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Path Abs Dir) #

Root for a specific package index

configPackageIndexRepo :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> m (Maybe (Path Abs Dir)) #

Git repo directory for a specific package index, returns `Nothing` if not a Git repo

configPackageTarball :: (MonadReader env m, HasConfig env, MonadThrow m) => IndexName -> PackageIdentifier -> m (Path Abs File) #

Location of a package tarball

## Project & ProjectAndConfigMonoid

data Project #

A project is a collection of packages. We can have multiple stack.yaml files, but only one of them may contain project information.

Constructors

Project |
Fields projectUserMsg :: !(Maybe String) A warning message to display to the user when the auto generated config may have issues. projectPackages :: ![PackageEntry] Components of the package list projectExtraDeps :: !(Map PackageName Version) Components of the package list referring to package/version combos, see: https://github.com/fpco/stack/issues/41 projectFlags :: !PackageFlags Per-package flag overrides projectResolver :: !Resolver How we resolve which dependencies to use projectCompiler :: !(Maybe CompilerVersion) When specified, overrides which compiler to use projectExtraPackageDBs :: ![FilePath]

Instances

Show Project # |
Methods showsPrec :: Int -> Project -> ShowS # show :: Project -> String # showList :: [Project] -> ShowS #
ToJSON Project # |
Methods toJSON :: Project -> Value # toEncoding :: Project -> Encoding # toJSONList :: [Project] -> Value # toEncodingList :: [Project] -> Encoding #

data ProjectAndConfigMonoid #

Constructors

ProjectAndConfigMonoid !Project !ConfigMonoid |

Instances

FromJSON (WithJSONWarnings ProjectAndConfigMonoid) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings ProjectAndConfigMonoid) # parseJSONList :: Value -> Parser [WithJSONWarnings ProjectAndConfigMonoid] #

## PvpBounds

data PvpBounds #

How PVP bounds should be added to .cabal files

Constructors

PvpBoundsNone |
PvpBoundsUpper |
PvpBoundsLower |
PvpBoundsBoth |

Instances

Bounded PvpBounds # |
Methods minBound :: PvpBounds # maxBound :: PvpBounds #
Enum PvpBounds # |
Methods succ :: PvpBounds -> PvpBounds # pred :: PvpBounds -> PvpBounds # toEnum :: Int -> PvpBounds # fromEnum :: PvpBounds -> Int # enumFrom :: PvpBounds -> [PvpBounds] # enumFromThen :: PvpBounds -> PvpBounds -> [PvpBounds] # enumFromTo :: PvpBounds -> PvpBounds -> [PvpBounds] # enumFromThenTo :: PvpBounds -> PvpBounds -> PvpBounds -> [PvpBounds] #
Eq PvpBounds # |
Methods (==) :: PvpBounds -> PvpBounds -> Bool # (/=) :: PvpBounds -> PvpBounds -> Bool #
Ord PvpBounds # |
Methods compare :: PvpBounds -> PvpBounds -> Ordering # (<) :: PvpBounds -> PvpBounds -> Bool # (<=) :: PvpBounds -> PvpBounds -> Bool # (>) :: PvpBounds -> PvpBounds -> Bool # (>=) :: PvpBounds -> PvpBounds -> Bool # max :: PvpBounds -> PvpBounds -> PvpBounds # min :: PvpBounds -> PvpBounds -> PvpBounds #
Read PvpBounds # |
Methods readsPrec :: Int -> ReadS PvpBounds # readList :: ReadS [PvpBounds] # readPrec :: ReadPrec PvpBounds # readListPrec :: ReadPrec [PvpBounds] #
Show PvpBounds # |
Methods showsPrec :: Int -> PvpBounds -> ShowS # show :: PvpBounds -> String # showList :: [PvpBounds] -> ShowS #
FromJSON PvpBounds # |
Methods parseJSON :: Value -> Parser PvpBounds # parseJSONList :: Value -> Parser [PvpBounds] #
ToJSON PvpBounds # |
Methods toJSON :: PvpBounds -> Value # toEncoding :: PvpBounds -> Encoding # toJSONList :: [PvpBounds] -> Value # toEncodingList :: [PvpBounds] -> Encoding #

parsePvpBounds :: Text -> Either String PvpBounds #

## ColorWhen

data ColorWhen #

Constructors

ColorNever |
ColorAlways |
ColorAuto |

Instances

Show ColorWhen # |
Methods showsPrec :: Int -> ColorWhen -> ShowS # show :: ColorWhen -> String # showList :: [ColorWhen] -> ShowS #
Generic ColorWhen # |
Associated Types type Rep ColorWhen :: * -> * # Methods from :: ColorWhen -> Rep ColorWhen x # to :: Rep ColorWhen x -> ColorWhen #
type Rep ColorWhen # |
type Rep ColorWhen = D1 (MetaData "ColorWhen" "Stack.Types.Config" "stack-1.4.0-5VbagGyw9hyAgBJq8WQvrq" False) ((:+:) (C1 (MetaCons "ColorNever" PrefixI False) U1) ((:+:) (C1 (MetaCons "ColorAlways" PrefixI False) U1) (C1 (MetaCons "ColorAuto" PrefixI False) U1)))

readColorWhen :: ReadM ColorWhen #

## SCM

data SCM #

A software control system.

Constructors

Git |

Instances

Show SCM # |
Methods showsPrec :: Int -> SCM -> ShowS # show :: SCM -> String # showList :: [SCM] -> ShowS #
FromJSON SCM # |
Methods parseJSON :: Value -> Parser SCM # parseJSONList :: Value -> Parser [SCM] #
ToJSON SCM # |
Methods toJSON :: SCM -> Value # toEncoding :: SCM -> Encoding # toJSONList :: [SCM] -> Value # toEncodingList :: [SCM] -> Encoding #

## CustomSnapshot

data CustomSnapshot #

Constructors

CustomSnapshot |
Fields csCompilerVersion :: !(Maybe CompilerVersion) csPackages :: !(Set PackageIdentifier) csDropPackages :: !(Set PackageName) csFlags :: !PackageFlags csGhcOptions :: !GhcOptions

Instances

FromJSON (WithJSONWarnings (CustomSnapshot, Maybe Resolver)) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings (CustomSnapshot, Maybe Resolver)) # parseJSONList :: Value -> Parser [WithJSONWarnings (CustomSnapshot, Maybe Resolver)] #

## GhcOptions

newtype GhcOptions #

Constructors

GhcOptions |
Fields unGhcOptions :: Map (Maybe PackageName) [Text]

Instances

Show GhcOptions # |
Methods showsPrec :: Int -> GhcOptions -> ShowS # show :: GhcOptions -> String # showList :: [GhcOptions] -> ShowS #
Monoid GhcOptions # |
Methods mempty :: GhcOptions # mappend :: GhcOptions -> GhcOptions -> GhcOptions # mconcat :: [GhcOptions] -> GhcOptions #
FromJSON GhcOptions # |
Methods parseJSON :: Value -> Parser GhcOptions # parseJSONList :: Value -> Parser [GhcOptions] #

ghcOptionsFor :: PackageName -> GhcOptions -> [Text] #

## PackageFlags

newtype PackageFlags #

Constructors

PackageFlags |
Fields unPackageFlags :: Map PackageName (Map FlagName Bool)

Instances

Show PackageFlags # |
Methods showsPrec :: Int -> PackageFlags -> ShowS # show :: PackageFlags -> String # showList :: [PackageFlags] -> ShowS #
Monoid PackageFlags # |
Methods mempty :: PackageFlags # mappend :: PackageFlags -> PackageFlags -> PackageFlags # mconcat :: [PackageFlags] -> PackageFlags #
FromJSON PackageFlags # |
Methods parseJSON :: Value -> Parser PackageFlags # parseJSONList :: Value -> Parser [PackageFlags] #
ToJSON PackageFlags # |
Methods toJSON :: PackageFlags -> Value # toEncoding :: PackageFlags -> Encoding # toJSONList :: [PackageFlags] -> Value # toEncodingList :: [PackageFlags] -> Encoding #

# Paths

bindirSuffix :: Path Rel Dir #

Suffix applied to an installation root to get the bin dir

configInstalledCache :: (HasBuildConfig env, MonadReader env m) => m (Path Abs File) #

File containing the installed cache, see Stack.PackageDump

configMiniBuildPlanCache :: (MonadThrow m, MonadReader env m, HasConfig env, HasGHCVariant env) => SnapName -> m (Path Abs File) #

Where to store mini build plan caches

getProjectWorkDir :: (HasBuildConfig env, MonadReader env m) => m (Path Abs Dir) #

Per-project work dir

docDirSuffix :: Path Rel Dir #

Suffix applied to an installation root to get the doc dir

flagCacheLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Directory for holding flag cache information

extraBinDirs :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Bool -> [Path Abs Dir]) #

Get the extra bin directories (for the PATH). Puts more local first

Bool indicates whether or not to include the locals

hpcReportDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Where HPC reports and tix files get stored.

installationRootDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Installation root for dependencies

installationRootLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Installation root for locals

hoogleRoot :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Hoogle directory.

hoogleDatabasePath :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs File) #

Get the hoogle database path.

packageDatabaseDeps :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Package database for installing dependencies into

packageDatabaseExtra :: (MonadReader env m, HasEnvConfig env) => m [Path Abs Dir] #

Extra package databases

packageDatabaseLocal :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Abs Dir) #

Package database for installing local packages into

platformOnlyRelDir :: (MonadReader env m, HasPlatform env, MonadThrow m) => m (Path Rel Dir) #

Relative directory for the platform identifier

platformGhcRelDir :: (MonadReader env m, HasEnvConfig env, MonadThrow m) => m (Path Rel Dir) #

Relative directory for the platform and GHC identifier

platformGhcVerOnlyRelDir :: (MonadReader env m, HasPlatform env, HasGHCVariant env, MonadThrow m) => m (Path Rel Dir) #

Relative directory for the platform and GHC identifier without GHC bindist build

useShaPathOnWindows :: MonadThrow m => Path Rel Dir -> m (Path Rel Dir) #

This is an attempt to shorten stack paths on Windows to decrease our chances of hitting 260 symbol path limit. The idea is to calculate SHA1 hash of the path used on other architectures, encode with base 16 and take first 8 symbols of it.

workDirL :: HasConfig env => Lens' env (Path Rel Dir) #

    ".stack-work"

# Command-specific types

## Eval

data EvalOpts #

Constructors

EvalOpts |
Fields evalArg :: !String evalExtra :: !ExecOptsExtra

Instances

Show EvalOpts # |
Methods showsPrec :: Int -> EvalOpts -> ShowS # show :: EvalOpts -> String # showList :: [EvalOpts] -> ShowS #

## Exec

data ExecOpts #

Constructors

ExecOpts |
Fields eoCmd :: !SpecialExecCmd eoArgs :: ![String] eoExtra :: !ExecOptsExtra

Instances

Show ExecOpts # |
Methods showsPrec :: Int -> ExecOpts -> ShowS # show :: ExecOpts -> String # showList :: [ExecOpts] -> ShowS #

data SpecialExecCmd #

Constructors

ExecCmd String |
ExecGhc |
ExecRunGhc |

Instances

Eq SpecialExecCmd # |
Methods (==) :: SpecialExecCmd -> SpecialExecCmd -> Bool # (/=) :: SpecialExecCmd -> SpecialExecCmd -> Bool #
Show SpecialExecCmd # |
Methods showsPrec :: Int -> SpecialExecCmd -> ShowS # show :: SpecialExecCmd -> String # showList :: [SpecialExecCmd] -> ShowS #

data ExecOptsExtra #

Constructors

ExecOptsPlain |
ExecOptsEmbellished |
Fields eoEnvSettings :: !EnvSettings eoPackages :: ![String] eoRtsOptions :: ![String]

Instances

Show ExecOptsExtra # |
Methods showsPrec :: Int -> ExecOptsExtra -> ShowS # show :: ExecOptsExtra -> String # showList :: [ExecOptsExtra] -> ShowS #

## Setup

data DownloadInfo #

Build of the compiler distribution (e.g. standard, gmp4, tinfo6) | Information for a file to download.

Constructors

DownloadInfo |
Fields downloadInfoUrl :: Text URL or absolute file path downloadInfoContentLength :: Maybe Int downloadInfoSha1 :: Maybe ByteString

Instances

Show DownloadInfo # |
Methods showsPrec :: Int -> DownloadInfo -> ShowS # show :: DownloadInfo -> String # showList :: [DownloadInfo] -> ShowS #
FromJSON (WithJSONWarnings DownloadInfo) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings DownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings DownloadInfo] #

data VersionedDownloadInfo #

Constructors

VersionedDownloadInfo |
Fields vdiVersion :: Version vdiDownloadInfo :: DownloadInfo

Instances

Show VersionedDownloadInfo # |
Methods showsPrec :: Int -> VersionedDownloadInfo -> ShowS # show :: VersionedDownloadInfo -> String # showList :: [VersionedDownloadInfo] -> ShowS #
FromJSON (WithJSONWarnings VersionedDownloadInfo) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings VersionedDownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings VersionedDownloadInfo] #

data GHCDownloadInfo #

Constructors

GHCDownloadInfo |
Fields gdiConfigureOpts :: [Text] gdiConfigureEnv :: Map Text Text gdiDownloadInfo :: DownloadInfo

Instances

Show GHCDownloadInfo # |
Methods showsPrec :: Int -> GHCDownloadInfo -> ShowS # show :: GHCDownloadInfo -> String # showList :: [GHCDownloadInfo] -> ShowS #
FromJSON (WithJSONWarnings GHCDownloadInfo) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings GHCDownloadInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings GHCDownloadInfo] #

data SetupInfo #

Constructors

SetupInfo |
Fields siSevenzExe :: Maybe DownloadInfo siSevenzDll :: Maybe DownloadInfo siMsys2 :: Map Text VersionedDownloadInfo siGHCs :: Map Text (Map Version GHCDownloadInfo) siGHCJSs :: Map Text (Map CompilerVersion DownloadInfo) siStack :: Map Text (Map Version DownloadInfo)

Instances

Show SetupInfo # |
Methods showsPrec :: Int -> SetupInfo -> ShowS # show :: SetupInfo -> String # showList :: [SetupInfo] -> ShowS #
Monoid SetupInfo # | For `siGHCs` and `siGHCJSs` fields maps are deeply merged. For all fields the values from the last `SetupInfo` win.
Methods mempty :: SetupInfo # mappend :: SetupInfo -> SetupInfo -> SetupInfo # mconcat :: [SetupInfo] -> SetupInfo #
FromJSON (WithJSONWarnings SetupInfo) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings SetupInfo) # parseJSONList :: Value -> Parser [WithJSONWarnings SetupInfo] #

data SetupInfoLocation #

Remote or inline `SetupInfo`

Constructors

SetupInfoFileOrURL String |
SetupInfoInline SetupInfo |

Instances

Show SetupInfoLocation # |
Methods showsPrec :: Int -> SetupInfoLocation -> ShowS # show :: SetupInfoLocation -> String # showList :: [SetupInfoLocation] -> ShowS #
FromJSON (WithJSONWarnings SetupInfoLocation) # |
Methods parseJSON :: Value -> Parser (WithJSONWarnings SetupInfoLocation) # parseJSONList :: Value -> Parser [WithJSONWarnings SetupInfoLocation] #

## Docker entrypoint

newtype DockerEntrypoint #

Data passed into Docker container for the Docker entrypoint's use

Constructors

DockerEntrypoint |
Fields deUser :: Maybe DockerUser UIDGIDetc of host user, if we wish to perform UID/GID switch in container

Instances

Read DockerEntrypoint # |
Methods readsPrec :: Int -> ReadS DockerEntrypoint # readList :: ReadS [DockerEntrypoint] # readPrec :: ReadPrec DockerEntrypoint # readListPrec :: ReadPrec [DockerEntrypoint] #
Show DockerEntrypoint # |
Methods showsPrec :: Int -> DockerEntrypoint -> ShowS # show :: DockerEntrypoint -> String # showList :: [DockerEntrypoint] -> ShowS #

data DockerUser #

Docker host user info

Constructors

DockerUser |
Fields duUid :: UserID uid duGid :: GroupID gid duGroups :: [GroupID] Supplemantal groups duUmask :: FileMode File creation mask }

Instances

Read DockerUser # |
Methods readsPrec :: Int -> ReadS DockerUser # readList :: ReadS [DockerUser] # readPrec :: ReadPrec DockerUser # readListPrec :: ReadPrec [DockerUser] #
Show DockerUser # |
Methods showsPrec :: Int -> DockerUser -> ShowS # show :: DockerUser -> String # showList :: [DockerUser] -> ShowS #

# Lens helpers

wantedCompilerVersionL :: HasBuildConfig s => Lens' s CompilerVersion #

The compiler specified by the `MiniBuildPlan`. This may be different from the actual compiler used!

actualCompilerVersionL :: HasEnvConfig s => Lens' s CompilerVersion #

The version of the compiler which will actually be used. May be different than that specified in the `MiniBuildPlan` and returned by `wantedCompilerVersionL`.

buildOptsL :: HasConfig s => Lens' s BuildOpts #

globalOptsL :: Lens' GlobalOpts ConfigMonoid #

buildOptsInstallExesL :: Lens' BuildOpts Bool #

buildOptsMonoidHaddockL :: Lens' BuildOptsMonoid (Maybe Bool) #

buildOptsMonoidTestsL :: Lens' BuildOptsMonoid (Maybe Bool) #

buildOptsMonoidBenchmarksL :: Lens' BuildOptsMonoid (Maybe Bool) #

buildOptsMonoidInstallExesL :: Lens' BuildOptsMonoid (Maybe Bool) #

buildOptsHaddockL :: Lens' BuildOpts Bool #

globalOptsBuildOptsMonoidL :: Lens' GlobalOpts BuildOptsMonoid #

packageIndicesL :: HasConfig s => Lens' s [PackageIndex] #

packageCachesL :: HasConfig env => Lens' env (IORef (Maybe (Map PackageIdentifier (PackageIndex, PackageCache), HashMap GitSHA1 (PackageIndex, OffsetSize)))) #

stackRootL :: HasConfig s => Lens' s (Path Abs Dir) #

configUrlsL :: HasConfig env => Lens' env Urls #

cabalVersionL :: HasEnvConfig env => Lens' env Version #

whichCompilerL :: Getting r CompilerVersion WhichCompiler #

# Lens reexport

view :: MonadReader s m => Getting a s a -> m a #

`view` is a synonym for (`^.`), generalised for `MonadReader` (we are able to use it instead of (`^.`) since functions are instances of the `MonadReader` class):

    >>> view _1 (1, 2)
    1

When you're using `Reader` for config and your config type has lenses generated for it, most of the time you'll be using `view` instead of `asks`:

    doSomething :: (MonadReader Config m) => m Int
    doSomething = do
      thingy        <- view setting1  -- same as “asks (^. setting1)”
      anotherThingy <- view setting2
      ...

to :: (s -> a) -> SimpleGetter s a #

`to` creates a getter from any function:

    a ^. to f = f a

It's most useful in chains, because it lets you mix lenses and ordinary functions. Suppose you have a record which comes from some third-party library and doesn't have any lens accessors. You want to do something like this:

    value ^. _1 . field . at 2

However, `field` isn't a getter, and you have to do this instead:

    field (value ^. _1) ^. at 2

but now `value` is in the middle and it's hard to read the resulting code. A variant with `to` is prettier and more readable:

    value ^. _1 . to field . at 2