{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards   #-}

module Stack.Types.ConfigMonoid
  ( ConfigMonoid (..)
  , parseConfigMonoid
  , parseConfigMonoidObject
  , configMonoidAllowDifferentUserName
  , configMonoidGHCVariantName
  , configMonoidInstallGHCName
  , configMonoidSystemGHCName
  ) where

import           Data.Aeson.Types ( Object, Value )
import           Data.Aeson.WarningParser
                   ( WarningParser, WithJSONWarnings, (..:?), (..!=)
                   , jsonSubWarnings, jsonSubWarningsT, jsonSubWarningsTT
                   , withObjectWarnings
                   )
import           Casa.Client ( CasaRepoPrefix )
import           Control.Monad.Writer ( tell )
import           Data.Coerce ( coerce )
import qualified Data.Map as Map
import qualified Data.Map.Strict as M
import qualified Data.Monoid as Monoid
import           Data.Monoid.Map ( MonoidMap (..) )
import qualified Data.Yaml as Yaml
import           Distribution.Version ( anyVersion )
import           Generics.Deriving.Monoid ( mappenddefault, memptydefault )
import           Stack.Prelude
import           Stack.Types.AllowNewerDeps ( AllowNewerDeps )
import           Stack.Types.ApplyGhcOptions ( ApplyGhcOptions (..) )
import           Stack.Types.ApplyProgOptions ( ApplyProgOptions (..) )
import           Stack.Types.BuildOpts ( BuildOptsMonoid )
import           Stack.Types.Casa ( CasaOptsMonoid )
import           Stack.Types.CabalConfigKey ( CabalConfigKey )
import           Stack.Types.ColorWhen ( ColorWhen )
import           Stack.Types.Compiler ( CompilerRepository )
import           Stack.Types.CompilerBuild ( CompilerBuild )
import           Stack.Types.Docker ( DockerOptsMonoid, VersionRangeJSON (..) )
import           Stack.Types.DumpLogs ( DumpLogs )
import           Stack.Types.GhcOptionKey ( GhcOptionKey (..) )
import           Stack.Types.GhcOptions ( GhcOptions (..) )
import           Stack.Types.GHCVariant ( GHCVariant )
import           Stack.Types.Nix ( NixOptsMonoid )
import           Stack.Types.PvpBounds ( PvpBounds )
import           Stack.Types.SCM ( SCM )
import           Stack.Types.SetupInfo ( SetupInfo )
import           Stack.Types.TemplateName ( TemplateName )
import           Stack.Types.Version
                   ( IntersectingVersionRange (..), VersionCheck )
import qualified System.FilePath as FilePath

-- | An uninterpreted representation of configuration options.

-- Configurations may be "cascaded" using mappend (left-biased).

data ConfigMonoid = ConfigMonoid
  { ConfigMonoid -> First (Path Abs Dir)
configMonoidStackRoot          :: !(First (Path Abs Dir))
    -- ^ See: 'clStackRoot'

  , ConfigMonoid -> First (Path Rel Dir)
configMonoidWorkDir            :: !(First (Path Rel Dir))
    -- ^ See: 'configWorkDir'.

  , ConfigMonoid -> BuildOptsMonoid
configMonoidBuildOpts          :: !BuildOptsMonoid
    -- ^ build options.

  , ConfigMonoid -> DockerOptsMonoid
configMonoidDockerOpts         :: !DockerOptsMonoid
    -- ^ Docker options.

  , ConfigMonoid -> NixOptsMonoid
configMonoidNixOpts            :: !NixOptsMonoid
    -- ^ Options for the execution environment (nix-shell or container)

  , ConfigMonoid -> First Int
configMonoidConnectionCount    :: !(First Int)
    -- ^ See: 'configConnectionCount'

  , ConfigMonoid -> FirstTrue
configMonoidHideTHLoading      :: !FirstTrue
    -- ^ See: 'configHideTHLoading'

  , ConfigMonoid -> First Bool
configMonoidPrefixTimestamps   :: !(First Bool)
    -- ^ See: 'configPrefixTimestamps'

  , ConfigMonoid -> First Text
configMonoidLatestSnapshot     :: !(First Text)
    -- ^ See: 'configLatestSnapshot'

  , ConfigMonoid -> First PackageIndexConfig
configMonoidPackageIndex     :: !(First PackageIndexConfig)
    -- ^ See: 'withPantryConfig'

  , ConfigMonoid -> First [PackageIndexConfig]
configMonoidPackageIndices     :: !(First [PackageIndexConfig])
    -- ^ Deprecated in favour of package-index

  , ConfigMonoid -> First Bool
configMonoidSystemGHC          :: !(First Bool)
    -- ^ See: 'configSystemGHC'

  , ConfigMonoid -> FirstTrue
configMonoidInstallGHC          :: !FirstTrue
    -- ^ See: 'configInstallGHC'

  , ConfigMonoid -> FirstFalse
configMonoidSkipGHCCheck        :: !FirstFalse
    -- ^ See: 'configSkipGHCCheck'

  , ConfigMonoid -> FirstFalse
configMonoidSkipMsys            :: !FirstFalse
    -- ^ See: 'configSkipMsys'

  , ConfigMonoid -> First VersionCheck
configMonoidCompilerCheck       :: !(First VersionCheck)
    -- ^ See: 'configCompilerCheck'

  , ConfigMonoid -> First CompilerRepository
configMonoidCompilerRepository  :: !(First CompilerRepository)
    -- ^ See: 'configCompilerRepository'

  , ConfigMonoid -> IntersectingVersionRange
configMonoidRequireStackVersion :: !IntersectingVersionRange
    -- ^ See: 'configRequireStackVersion'

  , ConfigMonoid -> First String
configMonoidArch                :: !(First String)
    -- ^ Used for overriding the platform

  , ConfigMonoid -> First GHCVariant
configMonoidGHCVariant          :: !(First GHCVariant)
    -- ^ Used for overriding the platform

  , ConfigMonoid -> First CompilerBuild
configMonoidGHCBuild            :: !(First CompilerBuild)
    -- ^ Used for overriding the GHC build

  , ConfigMonoid -> First Int
configMonoidJobs                :: !(First Int)
    -- ^ See: 'configJobs'

  , ConfigMonoid -> [String]
configMonoidExtraIncludeDirs    :: ![FilePath]
    -- ^ See: 'configExtraIncludeDirs'

  , ConfigMonoid -> [String]
configMonoidExtraLibDirs        :: ![FilePath]
    -- ^ See: 'configExtraLibDirs'

  , ConfigMonoid -> [Text]
configMonoidCustomPreprocessorExts :: ![Text]
    -- ^ See: 'configCustomPreprocessorExts'

  , ConfigMonoid -> First (Path Abs File)
configMonoidOverrideGccPath    :: !(First (Path Abs File))
    -- ^ Allow users to override the path to gcc

  , ConfigMonoid -> First String
configMonoidOverrideHpack       :: !(First FilePath)
    -- ^ Use Hpack executable (overrides bundled Hpack)

  , ConfigMonoid -> First Bool
configMonoidConcurrentTests     :: !(First Bool)
    -- ^ See: 'configConcurrentTests'

  , ConfigMonoid -> First String
configMonoidLocalBinPath        :: !(First FilePath)
    -- ^ Used to override the binary installation dir

  , ConfigMonoid -> Map Text Text
configMonoidTemplateParameters  :: !(Map Text Text)
    -- ^ Template parameters.

  , ConfigMonoid -> First SCM
configMonoidScmInit             :: !(First SCM)
    -- ^ Initialize SCM (e.g. git init) when making new projects?

  , ConfigMonoid -> MonoidMap PackageName (Dual [Text])
configMonoidGhcOptionsByName    :: !(MonoidMap PackageName (Monoid.Dual [Text]))
    -- ^ See 'configGhcOptionsByName'. Uses 'Monoid.Dual' so that

    -- options from the configs on the right come first, so that they

    -- can be overridden.

  , ConfigMonoid -> MonoidMap ApplyGhcOptions (Dual [Text])
configMonoidGhcOptionsByCat     :: !(MonoidMap ApplyGhcOptions (Monoid.Dual [Text]))
    -- ^ See 'configGhcOptionsAll'. Uses 'Monoid.Dual' so that options

    -- from the configs on the right come first, so that they can be

    -- overridden.

  , ConfigMonoid -> MonoidMap CabalConfigKey (Dual [Text])
configMonoidCabalConfigOpts     :: !(MonoidMap CabalConfigKey (Monoid.Dual [Text]))
    -- ^ See 'configCabalConfigOpts'.

  , ConfigMonoid -> [Path Abs Dir]
configMonoidExtraPath           :: ![Path Abs Dir]
    -- ^ Additional paths to search for executables in

  , ConfigMonoid -> [String]
configMonoidSetupInfoLocations  :: ![String]
    -- ^ See 'configSetupInfoLocations'

  , ConfigMonoid -> SetupInfo
configMonoidSetupInfoInline     :: !SetupInfo
    -- ^ See 'configSetupInfoInline'

  , ConfigMonoid -> First (Path Abs Dir)
configMonoidLocalProgramsBase   :: !(First (Path Abs Dir))
    -- ^ Override the default local programs dir, where e.g. GHC is installed.

  , ConfigMonoid -> First PvpBounds
configMonoidPvpBounds           :: !(First PvpBounds)
    -- ^ See 'configPvpBounds'

  , ConfigMonoid -> FirstTrue
configMonoidModifyCodePage      :: !FirstTrue
    -- ^ See 'configModifyCodePage'

  , ConfigMonoid -> FirstFalse
configMonoidRebuildGhcOptions   :: !FirstFalse
    -- ^ See 'configMonoidRebuildGhcOptions'

  , ConfigMonoid -> First ApplyGhcOptions
configMonoidApplyGhcOptions     :: !(First ApplyGhcOptions)
    -- ^ See 'configApplyGhcOptions'

  , ConfigMonoid -> First ApplyProgOptions
configMonoidApplyProgOptions     :: !(First ApplyProgOptions)
    -- ^ See 'configApplyProgOptions'

  , ConfigMonoid -> First Bool
configMonoidAllowNewer          :: !(First Bool)
    -- ^ See 'configMonoidAllowNewer'

  , ConfigMonoid -> Maybe AllowNewerDeps
configMonoidAllowNewerDeps      :: !(Maybe AllowNewerDeps)
    -- ^ See 'configMonoidAllowNewerDeps'

  , ConfigMonoid -> First TemplateName
configMonoidDefaultTemplate     :: !(First TemplateName)
   -- ^ The default template to use when none is specified.

   -- (If Nothing, the 'default' default template is used.)

  , ConfigMonoid -> First Bool
configMonoidAllowDifferentUser :: !(First Bool)
   -- ^ Allow users other than the Stack root owner to use the Stack

   -- installation.

  , ConfigMonoid -> First DumpLogs
configMonoidDumpLogs           :: !(First DumpLogs)
    -- ^ See 'configDumpLogs'

  , ConfigMonoid -> First Bool
configMonoidSaveHackageCreds   :: !(First Bool)
    -- ^ See 'configSaveHackageCreds'

  , ConfigMonoid -> First Text
configMonoidHackageBaseUrl     :: !(First Text)
    -- ^ See 'configHackageBaseUrl'

  , ConfigMonoid -> First ColorWhen
configMonoidColorWhen          :: !(First ColorWhen)
    -- ^ When to use 'ANSI' colors

  , ConfigMonoid -> StylesUpdate
configMonoidStyles             :: !StylesUpdate
  , ConfigMonoid -> FirstTrue
configMonoidHideSourcePaths    :: !FirstTrue
    -- ^ See 'configHideSourcePaths'

  , ConfigMonoid -> FirstTrue
configMonoidRecommendUpgrade   :: !FirstTrue
    -- ^ See 'configRecommendUpgrade'

  , ConfigMonoid -> FirstTrue
configMonoidNotifyIfNixOnPath  :: !FirstTrue
    -- ^ See 'configNotifyIfNixOnPath'

  , ConfigMonoid -> CasaOptsMonoid
configMonoidCasaOpts :: !CasaOptsMonoid
    -- ^ Casa configuration options.

  , ConfigMonoid -> First CasaRepoPrefix
configMonoidCasaRepoPrefix     :: !(First CasaRepoPrefix)
    -- ^ Casa repository prefix (deprecated).

  , ConfigMonoid -> First Text
configMonoidSnapshotLocation :: !(First Text)
    -- ^ Custom location of LTS/Nightly snapshots

  , ConfigMonoid -> FirstFalse
configMonoidNoRunCompile  :: !FirstFalse
    -- ^ See: 'configNoRunCompile'

  , ConfigMonoid -> First Bool
configMonoidStackDeveloperMode :: !(First Bool)
    -- ^ See 'configStackDeveloperMode'

  }
  deriving ((forall x. ConfigMonoid -> Rep ConfigMonoid x)
-> (forall x. Rep ConfigMonoid x -> ConfigMonoid)
-> Generic ConfigMonoid
forall x. Rep ConfigMonoid x -> ConfigMonoid
forall x. ConfigMonoid -> Rep ConfigMonoid x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ConfigMonoid -> Rep ConfigMonoid x
from :: forall x. ConfigMonoid -> Rep ConfigMonoid x
$cto :: forall x. Rep ConfigMonoid x -> ConfigMonoid
to :: forall x. Rep ConfigMonoid x -> ConfigMonoid
Generic, Int -> ConfigMonoid -> ShowS
[ConfigMonoid] -> ShowS
ConfigMonoid -> String
(Int -> ConfigMonoid -> ShowS)
-> (ConfigMonoid -> String)
-> ([ConfigMonoid] -> ShowS)
-> Show ConfigMonoid
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConfigMonoid -> ShowS
showsPrec :: Int -> ConfigMonoid -> ShowS
$cshow :: ConfigMonoid -> String
show :: ConfigMonoid -> String
$cshowList :: [ConfigMonoid] -> ShowS
showList :: [ConfigMonoid] -> ShowS
Show)

instance Semigroup ConfigMonoid where
  <> :: ConfigMonoid -> ConfigMonoid -> ConfigMonoid
(<>) = ConfigMonoid -> ConfigMonoid -> ConfigMonoid
forall a. (Generic a, Monoid' (Rep a)) => a -> a -> a
mappenddefault

instance Monoid ConfigMonoid where
  mempty :: ConfigMonoid
mempty = ConfigMonoid
forall a. (Generic a, Monoid' (Rep a)) => a
memptydefault
  mappend :: ConfigMonoid -> ConfigMonoid -> ConfigMonoid
mappend = ConfigMonoid -> ConfigMonoid -> ConfigMonoid
forall a. Semigroup a => a -> a -> a
(<>)

parseConfigMonoid ::
     Path Abs Dir
  -> Value
  -> Yaml.Parser (WithJSONWarnings ConfigMonoid)
parseConfigMonoid :: Path Abs Dir -> Value -> Parser (WithJSONWarnings ConfigMonoid)
parseConfigMonoid = String
-> (Object -> WarningParser ConfigMonoid)
-> Value
-> Parser (WithJSONWarnings ConfigMonoid)
forall a.
String
-> (Object -> WarningParser a)
-> Value
-> Parser (WithJSONWarnings a)
withObjectWarnings String
"ConfigMonoid" ((Object -> WarningParser ConfigMonoid)
 -> Value -> Parser (WithJSONWarnings ConfigMonoid))
-> (Path Abs Dir -> Object -> WarningParser ConfigMonoid)
-> Path Abs Dir
-> Value
-> Parser (WithJSONWarnings ConfigMonoid)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Path Abs Dir -> Object -> WarningParser ConfigMonoid
parseConfigMonoidObject

-- | Parse a partial configuration.  Used both to parse both a standalone config

-- file and a project file, so that a sub-parser is not required, which would

-- interfere with warnings for missing fields.

parseConfigMonoidObject :: Path Abs Dir -> Object -> WarningParser ConfigMonoid
parseConfigMonoidObject :: Path Abs Dir -> Object -> WarningParser ConfigMonoid
parseConfigMonoidObject Path Abs Dir
rootDir Object
obj = do
  -- Parsing 'stackRoot' from 'stackRoot'/config.yaml would be nonsensical

  let configMonoidStackRoot :: First a
configMonoidStackRoot = Maybe a -> First a
forall a. Maybe a -> First a
First Maybe a
forall a. Maybe a
Nothing
  First (Path Rel Dir)
configMonoidWorkDir <- Maybe (Path Rel Dir) -> First (Path Rel Dir)
forall a. Maybe a -> First a
First (Maybe (Path Rel Dir) -> First (Path Rel Dir))
-> WriterT WarningParserMonoid Parser (Maybe (Path Rel Dir))
-> WriterT WarningParserMonoid Parser (First (Path Rel Dir))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe (Path Rel Dir))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidWorkDirName
  BuildOptsMonoid
configMonoidBuildOpts <-
    WarningParser (WithJSONWarnings BuildOptsMonoid)
-> WarningParser BuildOptsMonoid
forall a. WarningParser (WithJSONWarnings a) -> WarningParser a
jsonSubWarnings (Object
obj Object
-> Text -> WarningParser (Maybe (WithJSONWarnings BuildOptsMonoid))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidBuildOptsName WarningParser (Maybe (WithJSONWarnings BuildOptsMonoid))
-> WithJSONWarnings BuildOptsMonoid
-> WarningParser (WithJSONWarnings BuildOptsMonoid)
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= WithJSONWarnings BuildOptsMonoid
forall a. Monoid a => a
mempty)
  DockerOptsMonoid
configMonoidDockerOpts <-
    WarningParser (WithJSONWarnings DockerOptsMonoid)
-> WarningParser DockerOptsMonoid
forall a. WarningParser (WithJSONWarnings a) -> WarningParser a
jsonSubWarnings (Object
obj Object
-> Text
-> WarningParser (Maybe (WithJSONWarnings DockerOptsMonoid))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidDockerOptsName WarningParser (Maybe (WithJSONWarnings DockerOptsMonoid))
-> WithJSONWarnings DockerOptsMonoid
-> WarningParser (WithJSONWarnings DockerOptsMonoid)
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= WithJSONWarnings DockerOptsMonoid
forall a. Monoid a => a
mempty)
  NixOptsMonoid
configMonoidNixOpts <-
    WarningParser (WithJSONWarnings NixOptsMonoid)
-> WarningParser NixOptsMonoid
forall a. WarningParser (WithJSONWarnings a) -> WarningParser a
jsonSubWarnings (Object
obj Object
-> Text -> WarningParser (Maybe (WithJSONWarnings NixOptsMonoid))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidNixOptsName WarningParser (Maybe (WithJSONWarnings NixOptsMonoid))
-> WithJSONWarnings NixOptsMonoid
-> WarningParser (WithJSONWarnings NixOptsMonoid)
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= WithJSONWarnings NixOptsMonoid
forall a. Monoid a => a
mempty)
  First Int
configMonoidConnectionCount <-
    Maybe Int -> First Int
forall a. Maybe a -> First a
First (Maybe Int -> First Int)
-> WriterT WarningParserMonoid Parser (Maybe Int)
-> WriterT WarningParserMonoid Parser (First Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidConnectionCountName
  FirstTrue
configMonoidHideTHLoading <-
    Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidHideTHLoadingName
  First Bool
configMonoidPrefixTimestamps <-
    Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidPrefixTimestampsName

  Maybe Value
murls :: Maybe Value <- Object
obj Object -> Text -> WarningParser (Maybe Value)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidUrlsName
  First Text
configMonoidLatestSnapshot <-
    case Maybe Value
murls of
      Maybe Value
Nothing -> First Text -> WriterT WarningParserMonoid Parser (First Text)
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (First Text -> WriterT WarningParserMonoid Parser (First Text))
-> First Text -> WriterT WarningParserMonoid Parser (First Text)
forall a b. (a -> b) -> a -> b
$ Maybe Text -> First Text
forall a. Maybe a -> First a
First Maybe Text
forall a. Maybe a
Nothing
      Just Value
urls -> WarningParser (WithJSONWarnings (First Text))
-> WriterT WarningParserMonoid Parser (First Text)
forall a. WarningParser (WithJSONWarnings a) -> WarningParser a
jsonSubWarnings (WarningParser (WithJSONWarnings (First Text))
 -> WriterT WarningParserMonoid Parser (First Text))
-> WarningParser (WithJSONWarnings (First Text))
-> WriterT WarningParserMonoid Parser (First Text)
forall a b. (a -> b) -> a -> b
$ Parser (WithJSONWarnings (First Text))
-> WarningParser (WithJSONWarnings (First Text))
forall (m :: * -> *) a.
Monad m =>
m a -> WriterT WarningParserMonoid m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (Parser (WithJSONWarnings (First Text))
 -> WarningParser (WithJSONWarnings (First Text)))
-> Parser (WithJSONWarnings (First Text))
-> WarningParser (WithJSONWarnings (First Text))
forall a b. (a -> b) -> a -> b
$ String
-> (Object -> WriterT WarningParserMonoid Parser (First Text))
-> Value
-> Parser (WithJSONWarnings (First Text))
forall a.
String
-> (Object -> WarningParser a)
-> Value
-> Parser (WithJSONWarnings a)
withObjectWarnings
        String
"urls"
        (\Object
o -> Maybe Text -> First Text
forall a. Maybe a -> First a
First (Maybe Text -> First Text)
-> WriterT WarningParserMonoid Parser (Maybe Text)
-> WriterT WarningParserMonoid Parser (First Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
"latest-snapshot" :: WarningParser (First Text))
        Value
urls

  First PackageIndexConfig
configMonoidPackageIndex <-
    Maybe PackageIndexConfig -> First PackageIndexConfig
forall a. Maybe a -> First a
First (Maybe PackageIndexConfig -> First PackageIndexConfig)
-> WriterT WarningParserMonoid Parser (Maybe PackageIndexConfig)
-> WriterT WarningParserMonoid Parser (First PackageIndexConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> WarningParser (Maybe (WithJSONWarnings PackageIndexConfig))
-> WriterT WarningParserMonoid Parser (Maybe PackageIndexConfig)
forall (t :: * -> *) a.
Traversable t =>
WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a)
jsonSubWarningsT (Object
obj Object
-> Text
-> WarningParser (Maybe (WithJSONWarnings PackageIndexConfig))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:?  Text
configMonoidPackageIndexName)
  First [PackageIndexConfig]
configMonoidPackageIndices <-
    Maybe [PackageIndexConfig] -> First [PackageIndexConfig]
forall a. Maybe a -> First a
First (Maybe [PackageIndexConfig] -> First [PackageIndexConfig])
-> WriterT WarningParserMonoid Parser (Maybe [PackageIndexConfig])
-> WriterT WarningParserMonoid Parser (First [PackageIndexConfig])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> WarningParser (Maybe [WithJSONWarnings PackageIndexConfig])
-> WriterT WarningParserMonoid Parser (Maybe [PackageIndexConfig])
forall (t :: * -> *) (u :: * -> *) a.
(Traversable t, Traversable u) =>
WarningParser (u (t (WithJSONWarnings a)))
-> WarningParser (u (t a))
jsonSubWarningsTT (Object
obj Object
-> Text
-> WarningParser (Maybe [WithJSONWarnings PackageIndexConfig])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:?  Text
configMonoidPackageIndicesName)
  First Bool
configMonoidSystemGHC <- Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSystemGHCName
  FirstTrue
configMonoidInstallGHC <- Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidInstallGHCName
  FirstFalse
configMonoidSkipGHCCheck <-
    Maybe Bool -> FirstFalse
FirstFalse (Maybe Bool -> FirstFalse)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstFalse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSkipGHCCheckName
  FirstFalse
configMonoidSkipMsys <- Maybe Bool -> FirstFalse
FirstFalse (Maybe Bool -> FirstFalse)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstFalse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSkipMsysName
  IntersectingVersionRange
configMonoidRequireStackVersion <-
    VersionRange -> IntersectingVersionRange
IntersectingVersionRange (VersionRange -> IntersectingVersionRange)
-> (VersionRangeJSON -> VersionRange)
-> VersionRangeJSON
-> IntersectingVersionRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VersionRangeJSON -> VersionRange
unVersionRangeJSON (VersionRangeJSON -> IntersectingVersionRange)
-> WriterT WarningParserMonoid Parser VersionRangeJSON
-> WriterT WarningParserMonoid Parser IntersectingVersionRange
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
      ( Object
obj Object -> Text -> WarningParser (Maybe VersionRangeJSON)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidRequireStackVersionName
          WarningParser (Maybe VersionRangeJSON)
-> VersionRangeJSON
-> WriterT WarningParserMonoid Parser VersionRangeJSON
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= VersionRange -> VersionRangeJSON
VersionRangeJSON VersionRange
anyVersion
      )
  First String
configMonoidArch <- Maybe String -> First String
forall a. Maybe a -> First a
First (Maybe String -> First String)
-> WriterT WarningParserMonoid Parser (Maybe String)
-> WriterT WarningParserMonoid Parser (First String)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe String)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidArchName
  First GHCVariant
configMonoidGHCVariant <- Maybe GHCVariant -> First GHCVariant
forall a. Maybe a -> First a
First (Maybe GHCVariant -> First GHCVariant)
-> WriterT WarningParserMonoid Parser (Maybe GHCVariant)
-> WriterT WarningParserMonoid Parser (First GHCVariant)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe GHCVariant)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidGHCVariantName
  First CompilerBuild
configMonoidGHCBuild <- Maybe CompilerBuild -> First CompilerBuild
forall a. Maybe a -> First a
First (Maybe CompilerBuild -> First CompilerBuild)
-> WriterT WarningParserMonoid Parser (Maybe CompilerBuild)
-> WriterT WarningParserMonoid Parser (First CompilerBuild)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe CompilerBuild)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidGHCBuildName
  First Int
configMonoidJobs <- Maybe Int -> First Int
forall a. Maybe a -> First a
First (Maybe Int -> First Int)
-> WriterT WarningParserMonoid Parser (Maybe Int)
-> WriterT WarningParserMonoid Parser (First Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidJobsName
  [String]
configMonoidExtraIncludeDirs <- ShowS -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (Path Abs Dir -> String
forall b t. Path b t -> String
toFilePath Path Abs Dir
rootDir FilePath.</>) ([String] -> [String])
-> WriterT WarningParserMonoid Parser [String]
-> WriterT WarningParserMonoid Parser [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
    Object
obj Object -> Text -> WarningParser (Maybe [String])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:?  Text
configMonoidExtraIncludeDirsName WarningParser (Maybe [String])
-> [String] -> WriterT WarningParserMonoid Parser [String]
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= []
  [String]
configMonoidExtraLibDirs <- ShowS -> [String] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map (Path Abs Dir -> String
forall b t. Path b t -> String
toFilePath Path Abs Dir
rootDir FilePath.</>) ([String] -> [String])
-> WriterT WarningParserMonoid Parser [String]
-> WriterT WarningParserMonoid Parser [String]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
    Object
obj Object -> Text -> WarningParser (Maybe [String])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:?  Text
configMonoidExtraLibDirsName WarningParser (Maybe [String])
-> [String] -> WriterT WarningParserMonoid Parser [String]
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= []
  [Text]
configMonoidCustomPreprocessorExts <-
    Object
obj Object -> Text -> WarningParser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:?  Text
configMonoidCustomPreprocessorExtsName WarningParser (Maybe [Text]) -> [Text] -> WarningParser [Text]
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= []
  First (Path Abs File)
configMonoidOverrideGccPath <-
    Maybe (Path Abs File) -> First (Path Abs File)
forall a. Maybe a -> First a
First (Maybe (Path Abs File) -> First (Path Abs File))
-> WriterT WarningParserMonoid Parser (Maybe (Path Abs File))
-> WriterT WarningParserMonoid Parser (First (Path Abs File))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe (Path Abs File))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidOverrideGccPathName
  First String
configMonoidOverrideHpack <-
    Maybe String -> First String
forall a. Maybe a -> First a
First (Maybe String -> First String)
-> WriterT WarningParserMonoid Parser (Maybe String)
-> WriterT WarningParserMonoid Parser (First String)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe String)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidOverrideHpackName
  First Bool
configMonoidConcurrentTests <-
    Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidConcurrentTestsName
  First String
configMonoidLocalBinPath <- Maybe String -> First String
forall a. Maybe a -> First a
First (Maybe String -> First String)
-> WriterT WarningParserMonoid Parser (Maybe String)
-> WriterT WarningParserMonoid Parser (First String)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe String)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidLocalBinPathName
  Maybe Object
templates <- Object
obj Object -> Text -> WarningParser (Maybe Object)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
"templates"
  (First SCM
configMonoidScmInit,Map Text Text
configMonoidTemplateParameters) <-
    case Maybe Object
templates of
      Maybe Object
Nothing -> (First SCM, Map Text Text)
-> WriterT WarningParserMonoid Parser (First SCM, Map Text Text)
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe SCM -> First SCM
forall a. Maybe a -> First a
First Maybe SCM
forall a. Maybe a
Nothing,Map Text Text
forall k a. Map k a
M.empty)
      Just Object
tobj -> do
        Maybe SCM
scmInit <- Object
tobj Object -> Text -> WarningParser (Maybe SCM)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidScmInitName
        Maybe (Map Text Text)
params <- Object
tobj Object -> Text -> WarningParser (Maybe (Map Text Text))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidTemplateParametersName
        (First SCM, Map Text Text)
-> WriterT WarningParserMonoid Parser (First SCM, Map Text Text)
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Maybe SCM -> First SCM
forall a. Maybe a -> First a
First Maybe SCM
scmInit,Map Text Text -> Maybe (Map Text Text) -> Map Text Text
forall a. a -> Maybe a -> a
fromMaybe Map Text Text
forall k a. Map k a
M.empty Maybe (Map Text Text)
params)
  First VersionCheck
configMonoidCompilerCheck <-
    Maybe VersionCheck -> First VersionCheck
forall a. Maybe a -> First a
First (Maybe VersionCheck -> First VersionCheck)
-> WriterT WarningParserMonoid Parser (Maybe VersionCheck)
-> WriterT WarningParserMonoid Parser (First VersionCheck)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe VersionCheck)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidCompilerCheckName
  First CompilerRepository
configMonoidCompilerRepository <-
    Maybe CompilerRepository -> First CompilerRepository
forall a. Maybe a -> First a
First (Maybe CompilerRepository -> First CompilerRepository)
-> WriterT WarningParserMonoid Parser (Maybe CompilerRepository)
-> WriterT WarningParserMonoid Parser (First CompilerRepository)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe CompilerRepository)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidCompilerRepositoryName)

  Map GhcOptionKey [Text]
options <-
    (GhcOptions -> [Text])
-> Map GhcOptionKey GhcOptions -> Map GhcOptionKey [Text]
forall a b k. (a -> b) -> Map k a -> Map k b
Map.map GhcOptions -> [Text]
unGhcOptions (Map GhcOptionKey GhcOptions -> Map GhcOptionKey [Text])
-> WriterT WarningParserMonoid Parser (Map GhcOptionKey GhcOptions)
-> WriterT WarningParserMonoid Parser (Map GhcOptionKey [Text])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WarningParser (Maybe (Map GhcOptionKey GhcOptions))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidGhcOptionsName WarningParser (Maybe (Map GhcOptionKey GhcOptions))
-> Map GhcOptionKey GhcOptions
-> WriterT WarningParserMonoid Parser (Map GhcOptionKey GhcOptions)
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= Map GhcOptionKey GhcOptions
forall a. Monoid a => a
mempty

  [Text]
optionsEverything <-
    case (GhcOptionKey -> Map GhcOptionKey [Text] -> Maybe [Text]
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup GhcOptionKey
GOKOldEverything Map GhcOptionKey [Text]
options, GhcOptionKey -> Map GhcOptionKey [Text] -> Maybe [Text]
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup GhcOptionKey
GOKEverything Map GhcOptionKey [Text]
options) of
      (Just [Text]
_, Just [Text]
_) ->
        String -> WarningParser [Text]
forall a. String -> WriterT WarningParserMonoid Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"Cannot specify both `*` and `$everything` GHC options"
      (Maybe [Text]
Nothing, Just [Text]
x) -> [Text] -> WarningParser [Text]
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure [Text]
x
      (Just [Text]
x, Maybe [Text]
Nothing) -> do
        WarningParserMonoid -> WriterT WarningParserMonoid Parser ()
forall w (m :: * -> *). MonadWriter w m => w -> m ()
tell WarningParserMonoid
"The `*` ghc-options key is not recommended. Consider using \
             \$locals, or if really needed, $everything"
        [Text] -> WarningParser [Text]
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure [Text]
x
      (Maybe [Text]
Nothing, Maybe [Text]
Nothing) -> [Text] -> WarningParser [Text]
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure []

  let configMonoidGhcOptionsByCat :: MonoidMap ApplyGhcOptions (Dual [Text])
configMonoidGhcOptionsByCat = Map ApplyGhcOptions [Text]
-> MonoidMap ApplyGhcOptions (Dual [Text])
forall a b. Coercible a b => a -> b
coerce (Map ApplyGhcOptions [Text]
 -> MonoidMap ApplyGhcOptions (Dual [Text]))
-> Map ApplyGhcOptions [Text]
-> MonoidMap ApplyGhcOptions (Dual [Text])
forall a b. (a -> b) -> a -> b
$ [(ApplyGhcOptions, [Text])] -> Map ApplyGhcOptions [Text]
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
        [ (ApplyGhcOptions
AGOEverything, [Text]
optionsEverything)
        , (ApplyGhcOptions
AGOLocals, [Text] -> GhcOptionKey -> Map GhcOptionKey [Text] -> [Text]
forall k a. Ord k => a -> k -> Map k a -> a
Map.findWithDefault [] GhcOptionKey
GOKLocals Map GhcOptionKey [Text]
options)
        , (ApplyGhcOptions
AGOTargets, [Text] -> GhcOptionKey -> Map GhcOptionKey [Text] -> [Text]
forall k a. Ord k => a -> k -> Map k a -> a
Map.findWithDefault [] GhcOptionKey
GOKTargets Map GhcOptionKey [Text]
options)
        ]

      configMonoidGhcOptionsByName :: MonoidMap PackageName (Dual [Text])
configMonoidGhcOptionsByName = Map PackageName [Text] -> MonoidMap PackageName (Dual [Text])
forall a b. Coercible a b => a -> b
coerce (Map PackageName [Text] -> MonoidMap PackageName (Dual [Text]))
-> Map PackageName [Text] -> MonoidMap PackageName (Dual [Text])
forall a b. (a -> b) -> a -> b
$ [(PackageName, [Text])] -> Map PackageName [Text]
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList
          [(PackageName
name, [Text]
opts) | (GOKPackage PackageName
name, [Text]
opts) <- Map GhcOptionKey [Text] -> [(GhcOptionKey, [Text])]
forall k a. Map k a -> [(k, a)]
Map.toList Map GhcOptionKey [Text]
options]

  Map CabalConfigKey [Text]
configMonoidCabalConfigOpts' <-
    Object
obj Object -> Text -> WarningParser (Maybe (Map CabalConfigKey [Text]))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidConfigureOptionsName WarningParser (Maybe (Map CabalConfigKey [Text]))
-> Map CabalConfigKey [Text]
-> WarningParser (Map CabalConfigKey [Text])
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= Map CabalConfigKey [Text]
forall a. Monoid a => a
mempty
  let configMonoidCabalConfigOpts :: MonoidMap CabalConfigKey (Dual [Text])
configMonoidCabalConfigOpts =
        Map CabalConfigKey [Text] -> MonoidMap CabalConfigKey (Dual [Text])
forall a b. Coercible a b => a -> b
coerce (Map CabalConfigKey [Text]
configMonoidCabalConfigOpts' :: Map CabalConfigKey [Text])

  [Path Abs Dir]
configMonoidExtraPath <- Object
obj Object -> Text -> WarningParser (Maybe [Path Abs Dir])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidExtraPathName WarningParser (Maybe [Path Abs Dir])
-> [Path Abs Dir] -> WarningParser [Path Abs Dir]
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= []
  [String]
configMonoidSetupInfoLocations <-
    Object
obj Object -> Text -> WarningParser (Maybe [String])
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSetupInfoLocationsName WarningParser (Maybe [String])
-> [String] -> WriterT WarningParserMonoid Parser [String]
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= []
  SetupInfo
configMonoidSetupInfoInline <-
    WarningParser (Maybe (WithJSONWarnings SetupInfo))
-> WarningParser (Maybe SetupInfo)
forall (t :: * -> *) a.
Traversable t =>
WarningParser (t (WithJSONWarnings a)) -> WarningParser (t a)
jsonSubWarningsT (Object
obj Object
-> Text -> WarningParser (Maybe (WithJSONWarnings SetupInfo))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSetupInfoInlineName) WarningParser (Maybe SetupInfo)
-> SetupInfo -> WarningParser SetupInfo
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= SetupInfo
forall a. Monoid a => a
mempty
  First (Path Abs Dir)
configMonoidLocalProgramsBase <-
    Maybe (Path Abs Dir) -> First (Path Abs Dir)
forall a. Maybe a -> First a
First (Maybe (Path Abs Dir) -> First (Path Abs Dir))
-> WriterT WarningParserMonoid Parser (Maybe (Path Abs Dir))
-> WriterT WarningParserMonoid Parser (First (Path Abs Dir))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe (Path Abs Dir))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidLocalProgramsBaseName
  First PvpBounds
configMonoidPvpBounds <- Maybe PvpBounds -> First PvpBounds
forall a. Maybe a -> First a
First (Maybe PvpBounds -> First PvpBounds)
-> WriterT WarningParserMonoid Parser (Maybe PvpBounds)
-> WriterT WarningParserMonoid Parser (First PvpBounds)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe PvpBounds)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidPvpBoundsName
  FirstTrue
configMonoidModifyCodePage <-
    Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidModifyCodePageName
  FirstFalse
configMonoidRebuildGhcOptions <-
    Maybe Bool -> FirstFalse
FirstFalse (Maybe Bool -> FirstFalse)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstFalse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidRebuildGhcOptionsName
  First ApplyGhcOptions
configMonoidApplyGhcOptions <-
    Maybe ApplyGhcOptions -> First ApplyGhcOptions
forall a. Maybe a -> First a
First (Maybe ApplyGhcOptions -> First ApplyGhcOptions)
-> WriterT WarningParserMonoid Parser (Maybe ApplyGhcOptions)
-> WriterT WarningParserMonoid Parser (First ApplyGhcOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe ApplyGhcOptions)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidApplyGhcOptionsName
  First ApplyProgOptions
configMonoidApplyProgOptions <-
    Maybe ApplyProgOptions -> First ApplyProgOptions
forall a. Maybe a -> First a
First (Maybe ApplyProgOptions -> First ApplyProgOptions)
-> WriterT WarningParserMonoid Parser (Maybe ApplyProgOptions)
-> WriterT WarningParserMonoid Parser (First ApplyProgOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe ApplyProgOptions)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidApplyProgOptionsName
  First Bool
configMonoidAllowNewer <- Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidAllowNewerName
  Maybe AllowNewerDeps
configMonoidAllowNewerDeps <- Object
obj Object -> Text -> WarningParser (Maybe AllowNewerDeps)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidAllowNewerDepsName
  First TemplateName
configMonoidDefaultTemplate <-
    Maybe TemplateName -> First TemplateName
forall a. Maybe a -> First a
First (Maybe TemplateName -> First TemplateName)
-> WriterT WarningParserMonoid Parser (Maybe TemplateName)
-> WriterT WarningParserMonoid Parser (First TemplateName)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe TemplateName)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidDefaultTemplateName
  First Bool
configMonoidAllowDifferentUser <-
    Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidAllowDifferentUserName
  First DumpLogs
configMonoidDumpLogs <- Maybe DumpLogs -> First DumpLogs
forall a. Maybe a -> First a
First (Maybe DumpLogs -> First DumpLogs)
-> WriterT WarningParserMonoid Parser (Maybe DumpLogs)
-> WriterT WarningParserMonoid Parser (First DumpLogs)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text -> WriterT WarningParserMonoid Parser (Maybe DumpLogs)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidDumpLogsName
  First Bool
configMonoidSaveHackageCreds <-
    Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSaveHackageCredsName
  First Text
configMonoidHackageBaseUrl <-
    Maybe Text -> First Text
forall a. Maybe a -> First a
First (Maybe Text -> First Text)
-> WriterT WarningParserMonoid Parser (Maybe Text)
-> WriterT WarningParserMonoid Parser (First Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidHackageBaseUrlName

  Maybe ColorWhen
configMonoidColorWhenUS <- Object
obj Object -> Text -> WarningParser (Maybe ColorWhen)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidColorWhenUSName
  Maybe ColorWhen
configMonoidColorWhenGB <- Object
obj Object -> Text -> WarningParser (Maybe ColorWhen)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidColorWhenGBName
  let configMonoidColorWhen :: First ColorWhen
configMonoidColorWhen =  Maybe ColorWhen -> First ColorWhen
forall a. Maybe a -> First a
First (Maybe ColorWhen -> First ColorWhen)
-> Maybe ColorWhen -> First ColorWhen
forall a b. (a -> b) -> a -> b
$   Maybe ColorWhen
configMonoidColorWhenUS
                                     Maybe ColorWhen -> Maybe ColorWhen -> Maybe ColorWhen
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Maybe ColorWhen
configMonoidColorWhenGB

  Maybe StylesUpdate
configMonoidStylesUS <- Object
obj Object -> Text -> WarningParser (Maybe StylesUpdate)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidStylesUSName
  Maybe StylesUpdate
configMonoidStylesGB <- Object
obj Object -> Text -> WarningParser (Maybe StylesUpdate)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidStylesGBName
  let configMonoidStyles :: StylesUpdate
configMonoidStyles = StylesUpdate -> Maybe StylesUpdate -> StylesUpdate
forall a. a -> Maybe a -> a
fromMaybe StylesUpdate
forall a. Monoid a => a
mempty (Maybe StylesUpdate -> StylesUpdate)
-> Maybe StylesUpdate -> StylesUpdate
forall a b. (a -> b) -> a -> b
$   Maybe StylesUpdate
configMonoidStylesUS
                                            Maybe StylesUpdate -> Maybe StylesUpdate -> Maybe StylesUpdate
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Maybe StylesUpdate
configMonoidStylesGB

  FirstTrue
configMonoidHideSourcePaths <-
    Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidHideSourcePathsName
  FirstTrue
configMonoidRecommendUpgrade <-
    Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidRecommendUpgradeName
  FirstTrue
configMonoidNotifyIfNixOnPath <-
    Maybe Bool -> FirstTrue
FirstTrue (Maybe Bool -> FirstTrue)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstTrue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidNotifyIfNixOnPathName
  CasaOptsMonoid
configMonoidCasaOpts <-
    WarningParser (WithJSONWarnings CasaOptsMonoid)
-> WarningParser CasaOptsMonoid
forall a. WarningParser (WithJSONWarnings a) -> WarningParser a
jsonSubWarnings (Object
obj Object
-> Text -> WarningParser (Maybe (WithJSONWarnings CasaOptsMonoid))
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidCasaOptsName WarningParser (Maybe (WithJSONWarnings CasaOptsMonoid))
-> WithJSONWarnings CasaOptsMonoid
-> WarningParser (WithJSONWarnings CasaOptsMonoid)
forall a. WarningParser (Maybe a) -> a -> WarningParser a
..!= WithJSONWarnings CasaOptsMonoid
forall a. Monoid a => a
mempty)
  First CasaRepoPrefix
configMonoidCasaRepoPrefix <-
    Maybe CasaRepoPrefix -> First CasaRepoPrefix
forall a. Maybe a -> First a
First (Maybe CasaRepoPrefix -> First CasaRepoPrefix)
-> WriterT WarningParserMonoid Parser (Maybe CasaRepoPrefix)
-> WriterT WarningParserMonoid Parser (First CasaRepoPrefix)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object
-> Text
-> WriterT WarningParserMonoid Parser (Maybe CasaRepoPrefix)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidCasaRepoPrefixName
  First Text
configMonoidSnapshotLocation <-
    Maybe Text -> First Text
forall a. Maybe a -> First a
First (Maybe Text -> First Text)
-> WriterT WarningParserMonoid Parser (Maybe Text)
-> WriterT WarningParserMonoid Parser (First Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidSnapshotLocationName
  FirstFalse
configMonoidNoRunCompile <-
    Maybe Bool -> FirstFalse
FirstFalse (Maybe Bool -> FirstFalse)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser FirstFalse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidNoRunCompileName

  First Bool
configMonoidStackDeveloperMode <-
    Maybe Bool -> First Bool
forall a. Maybe a -> First a
First (Maybe Bool -> First Bool)
-> WriterT WarningParserMonoid Parser (Maybe Bool)
-> WriterT WarningParserMonoid Parser (First Bool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Text -> WriterT WarningParserMonoid Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> WarningParser (Maybe a)
..:? Text
configMonoidStackDeveloperModeName

  ConfigMonoid -> WarningParser ConfigMonoid
forall a. a -> WriterT WarningParserMonoid Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ConfigMonoid {[String]
[Text]
[Path Abs Dir]
Maybe AllowNewerDeps
Map Text Text
First Bool
First Int
First String
First [PackageIndexConfig]
First Text
First CasaRepoPrefix
First PackageIndexConfig
First (Path Rel Dir)
First (Path Abs Dir)
First (Path Abs File)
First ApplyGhcOptions
First ApplyProgOptions
First ColorWhen
First CompilerBuild
First DumpLogs
First GHCVariant
First PvpBounds
First SCM
First TemplateName
First VersionCheck
First CompilerRepository
StylesUpdate
FirstFalse
FirstTrue
MonoidMap PackageName (Dual [Text])
MonoidMap ApplyGhcOptions (Dual [Text])
MonoidMap CabalConfigKey (Dual [Text])
BuildOptsMonoid
CasaOptsMonoid
NixOptsMonoid
IntersectingVersionRange
SetupInfo
DockerOptsMonoid
forall {a}. First a
configMonoidStackRoot :: First (Path Abs Dir)
configMonoidWorkDir :: First (Path Rel Dir)
configMonoidBuildOpts :: BuildOptsMonoid
configMonoidDockerOpts :: DockerOptsMonoid
configMonoidNixOpts :: NixOptsMonoid
configMonoidConnectionCount :: First Int
configMonoidHideTHLoading :: FirstTrue
configMonoidPrefixTimestamps :: First Bool
configMonoidLatestSnapshot :: First Text
configMonoidPackageIndex :: First PackageIndexConfig
configMonoidPackageIndices :: First [PackageIndexConfig]
configMonoidSystemGHC :: First Bool
configMonoidInstallGHC :: FirstTrue
configMonoidSkipGHCCheck :: FirstFalse
configMonoidSkipMsys :: FirstFalse
configMonoidCompilerCheck :: First VersionCheck
configMonoidCompilerRepository :: First CompilerRepository
configMonoidRequireStackVersion :: IntersectingVersionRange
configMonoidArch :: First String
configMonoidGHCVariant :: First GHCVariant
configMonoidGHCBuild :: First CompilerBuild
configMonoidJobs :: First Int
configMonoidExtraIncludeDirs :: [String]
configMonoidExtraLibDirs :: [String]
configMonoidCustomPreprocessorExts :: [Text]
configMonoidOverrideGccPath :: First (Path Abs File)
configMonoidOverrideHpack :: First String
configMonoidConcurrentTests :: First Bool
configMonoidLocalBinPath :: First String
configMonoidTemplateParameters :: Map Text Text
configMonoidScmInit :: First SCM
configMonoidGhcOptionsByName :: MonoidMap PackageName (Dual [Text])
configMonoidGhcOptionsByCat :: MonoidMap ApplyGhcOptions (Dual [Text])
configMonoidCabalConfigOpts :: MonoidMap CabalConfigKey (Dual [Text])
configMonoidExtraPath :: [Path Abs Dir]
configMonoidSetupInfoLocations :: [String]
configMonoidSetupInfoInline :: SetupInfo
configMonoidLocalProgramsBase :: First (Path Abs Dir)
configMonoidPvpBounds :: First PvpBounds
configMonoidModifyCodePage :: FirstTrue
configMonoidRebuildGhcOptions :: FirstFalse
configMonoidApplyGhcOptions :: First ApplyGhcOptions
configMonoidApplyProgOptions :: First ApplyProgOptions
configMonoidAllowNewer :: First Bool
configMonoidAllowNewerDeps :: Maybe AllowNewerDeps
configMonoidDefaultTemplate :: First TemplateName
configMonoidAllowDifferentUser :: First Bool
configMonoidDumpLogs :: First DumpLogs
configMonoidSaveHackageCreds :: First Bool
configMonoidHackageBaseUrl :: First Text
configMonoidColorWhen :: First ColorWhen
configMonoidStyles :: StylesUpdate
configMonoidHideSourcePaths :: FirstTrue
configMonoidRecommendUpgrade :: FirstTrue
configMonoidNotifyIfNixOnPath :: FirstTrue
configMonoidCasaOpts :: CasaOptsMonoid
configMonoidCasaRepoPrefix :: First CasaRepoPrefix
configMonoidSnapshotLocation :: First Text
configMonoidNoRunCompile :: FirstFalse
configMonoidStackDeveloperMode :: First Bool
configMonoidStackRoot :: forall {a}. First a
configMonoidWorkDir :: First (Path Rel Dir)
configMonoidBuildOpts :: BuildOptsMonoid
configMonoidDockerOpts :: DockerOptsMonoid
configMonoidNixOpts :: NixOptsMonoid
configMonoidConnectionCount :: First Int
configMonoidHideTHLoading :: FirstTrue
configMonoidPrefixTimestamps :: First Bool
configMonoidLatestSnapshot :: First Text
configMonoidPackageIndex :: First PackageIndexConfig
configMonoidPackageIndices :: First [PackageIndexConfig]
configMonoidSystemGHC :: First Bool
configMonoidInstallGHC :: FirstTrue
configMonoidSkipGHCCheck :: FirstFalse
configMonoidSkipMsys :: FirstFalse
configMonoidRequireStackVersion :: IntersectingVersionRange
configMonoidArch :: First String
configMonoidGHCVariant :: First GHCVariant
configMonoidGHCBuild :: First CompilerBuild
configMonoidJobs :: First Int
configMonoidExtraIncludeDirs :: [String]
configMonoidExtraLibDirs :: [String]
configMonoidCustomPreprocessorExts :: [Text]
configMonoidOverrideGccPath :: First (Path Abs File)
configMonoidOverrideHpack :: First String
configMonoidConcurrentTests :: First Bool
configMonoidLocalBinPath :: First String
configMonoidScmInit :: First SCM
configMonoidTemplateParameters :: Map Text Text
configMonoidCompilerCheck :: First VersionCheck
configMonoidCompilerRepository :: First CompilerRepository
configMonoidGhcOptionsByCat :: MonoidMap ApplyGhcOptions (Dual [Text])
configMonoidGhcOptionsByName :: MonoidMap PackageName (Dual [Text])
configMonoidCabalConfigOpts :: MonoidMap CabalConfigKey (Dual [Text])
configMonoidExtraPath :: [Path Abs Dir]
configMonoidSetupInfoLocations :: [String]
configMonoidSetupInfoInline :: SetupInfo
configMonoidLocalProgramsBase :: First (Path Abs Dir)
configMonoidPvpBounds :: First PvpBounds
configMonoidModifyCodePage :: FirstTrue
configMonoidRebuildGhcOptions :: FirstFalse
configMonoidApplyGhcOptions :: First ApplyGhcOptions
configMonoidApplyProgOptions :: First ApplyProgOptions
configMonoidAllowNewer :: First Bool
configMonoidAllowNewerDeps :: Maybe AllowNewerDeps
configMonoidDefaultTemplate :: First TemplateName
configMonoidAllowDifferentUser :: First Bool
configMonoidDumpLogs :: First DumpLogs
configMonoidSaveHackageCreds :: First Bool
configMonoidHackageBaseUrl :: First Text
configMonoidColorWhen :: First ColorWhen
configMonoidStyles :: StylesUpdate
configMonoidHideSourcePaths :: FirstTrue
configMonoidRecommendUpgrade :: FirstTrue
configMonoidNotifyIfNixOnPath :: FirstTrue
configMonoidCasaOpts :: CasaOptsMonoid
configMonoidCasaRepoPrefix :: First CasaRepoPrefix
configMonoidSnapshotLocation :: First Text
configMonoidNoRunCompile :: FirstFalse
configMonoidStackDeveloperMode :: First Bool
..}

configMonoidWorkDirName :: Text
configMonoidWorkDirName :: Text
configMonoidWorkDirName = Text
"work-dir"

configMonoidBuildOptsName :: Text
configMonoidBuildOptsName :: Text
configMonoidBuildOptsName = Text
"build"

configMonoidDockerOptsName :: Text
configMonoidDockerOptsName :: Text
configMonoidDockerOptsName = Text
"docker"

configMonoidNixOptsName :: Text
configMonoidNixOptsName :: Text
configMonoidNixOptsName = Text
"nix"

configMonoidConfigureOptionsName :: Text
configMonoidConfigureOptionsName :: Text
configMonoidConfigureOptionsName = Text
"configure-options"

configMonoidConnectionCountName :: Text
configMonoidConnectionCountName :: Text
configMonoidConnectionCountName = Text
"connection-count"

configMonoidHideTHLoadingName :: Text
configMonoidHideTHLoadingName :: Text
configMonoidHideTHLoadingName = Text
"hide-th-loading"

configMonoidPrefixTimestampsName :: Text
configMonoidPrefixTimestampsName :: Text
configMonoidPrefixTimestampsName = Text
"build-output-timestamps"

configMonoidUrlsName :: Text
configMonoidUrlsName :: Text
configMonoidUrlsName = Text
"urls"

configMonoidPackageIndexName :: Text
configMonoidPackageIndexName :: Text
configMonoidPackageIndexName = Text
"package-index"

-- Deprecated in favour of package-index

configMonoidPackageIndicesName :: Text
configMonoidPackageIndicesName :: Text
configMonoidPackageIndicesName = Text
"package-indices"

configMonoidSystemGHCName :: Text
configMonoidSystemGHCName :: Text
configMonoidSystemGHCName = Text
"system-ghc"

configMonoidInstallGHCName :: Text
configMonoidInstallGHCName :: Text
configMonoidInstallGHCName = Text
"install-ghc"

configMonoidSkipGHCCheckName :: Text
configMonoidSkipGHCCheckName :: Text
configMonoidSkipGHCCheckName = Text
"skip-ghc-check"

configMonoidSkipMsysName :: Text
configMonoidSkipMsysName :: Text
configMonoidSkipMsysName = Text
"skip-msys"

configMonoidRequireStackVersionName :: Text
configMonoidRequireStackVersionName :: Text
configMonoidRequireStackVersionName = Text
"require-stack-version"

configMonoidArchName :: Text
configMonoidArchName :: Text
configMonoidArchName = Text
"arch"

configMonoidGHCVariantName :: Text
configMonoidGHCVariantName :: Text
configMonoidGHCVariantName = Text
"ghc-variant"

configMonoidGHCBuildName :: Text
configMonoidGHCBuildName :: Text
configMonoidGHCBuildName = Text
"ghc-build"

configMonoidJobsName :: Text
configMonoidJobsName :: Text
configMonoidJobsName = Text
"jobs"

configMonoidExtraIncludeDirsName :: Text
configMonoidExtraIncludeDirsName :: Text
configMonoidExtraIncludeDirsName = Text
"extra-include-dirs"

configMonoidExtraLibDirsName :: Text
configMonoidExtraLibDirsName :: Text
configMonoidExtraLibDirsName = Text
"extra-lib-dirs"

configMonoidCustomPreprocessorExtsName  :: Text
configMonoidCustomPreprocessorExtsName :: Text
configMonoidCustomPreprocessorExtsName  = Text
"custom-preprocessor-extensions"

configMonoidOverrideGccPathName :: Text
configMonoidOverrideGccPathName :: Text
configMonoidOverrideGccPathName = Text
"with-gcc"

configMonoidOverrideHpackName :: Text
configMonoidOverrideHpackName :: Text
configMonoidOverrideHpackName = Text
"with-hpack"

configMonoidConcurrentTestsName :: Text
configMonoidConcurrentTestsName :: Text
configMonoidConcurrentTestsName = Text
"concurrent-tests"

configMonoidLocalBinPathName :: Text
configMonoidLocalBinPathName :: Text
configMonoidLocalBinPathName = Text
"local-bin-path"

configMonoidScmInitName :: Text
configMonoidScmInitName :: Text
configMonoidScmInitName = Text
"scm-init"

configMonoidTemplateParametersName :: Text
configMonoidTemplateParametersName :: Text
configMonoidTemplateParametersName = Text
"params"

configMonoidCompilerCheckName :: Text
configMonoidCompilerCheckName :: Text
configMonoidCompilerCheckName = Text
"compiler-check"

configMonoidCompilerRepositoryName :: Text
configMonoidCompilerRepositoryName :: Text
configMonoidCompilerRepositoryName = Text
"compiler-repository"

configMonoidGhcOptionsName :: Text
configMonoidGhcOptionsName :: Text
configMonoidGhcOptionsName = Text
"ghc-options"

configMonoidExtraPathName :: Text
configMonoidExtraPathName :: Text
configMonoidExtraPathName = Text
"extra-path"

configMonoidSetupInfoLocationsName :: Text
configMonoidSetupInfoLocationsName :: Text
configMonoidSetupInfoLocationsName = Text
"setup-info-locations"

configMonoidSetupInfoInlineName :: Text
configMonoidSetupInfoInlineName :: Text
configMonoidSetupInfoInlineName = Text
"setup-info"

configMonoidLocalProgramsBaseName :: Text
configMonoidLocalProgramsBaseName :: Text
configMonoidLocalProgramsBaseName = Text
"local-programs-path"

configMonoidPvpBoundsName :: Text
configMonoidPvpBoundsName :: Text
configMonoidPvpBoundsName = Text
"pvp-bounds"

configMonoidModifyCodePageName :: Text
configMonoidModifyCodePageName :: Text
configMonoidModifyCodePageName = Text
"modify-code-page"

configMonoidRebuildGhcOptionsName :: Text
configMonoidRebuildGhcOptionsName :: Text
configMonoidRebuildGhcOptionsName = Text
"rebuild-ghc-options"

configMonoidApplyGhcOptionsName :: Text
configMonoidApplyGhcOptionsName :: Text
configMonoidApplyGhcOptionsName = Text
"apply-ghc-options"

configMonoidApplyProgOptionsName :: Text
configMonoidApplyProgOptionsName :: Text
configMonoidApplyProgOptionsName = Text
"apply-prog-options"

configMonoidAllowNewerName :: Text
configMonoidAllowNewerName :: Text
configMonoidAllowNewerName = Text
"allow-newer"

configMonoidAllowNewerDepsName :: Text
configMonoidAllowNewerDepsName :: Text
configMonoidAllowNewerDepsName = Text
"allow-newer-deps"

configMonoidDefaultTemplateName :: Text
configMonoidDefaultTemplateName :: Text
configMonoidDefaultTemplateName = Text
"default-template"

configMonoidAllowDifferentUserName :: Text
configMonoidAllowDifferentUserName :: Text
configMonoidAllowDifferentUserName = Text
"allow-different-user"

configMonoidDumpLogsName :: Text
configMonoidDumpLogsName :: Text
configMonoidDumpLogsName = Text
"dump-logs"

configMonoidSaveHackageCredsName :: Text
configMonoidSaveHackageCredsName :: Text
configMonoidSaveHackageCredsName = Text
"save-hackage-creds"

configMonoidHackageBaseUrlName :: Text
configMonoidHackageBaseUrlName :: Text
configMonoidHackageBaseUrlName = Text
"hackage-base-url"

configMonoidColorWhenUSName :: Text
configMonoidColorWhenUSName :: Text
configMonoidColorWhenUSName = Text
"color"

configMonoidColorWhenGBName :: Text
configMonoidColorWhenGBName :: Text
configMonoidColorWhenGBName = Text
"colour"

configMonoidStylesUSName :: Text
configMonoidStylesUSName :: Text
configMonoidStylesUSName = Text
"stack-colors"

configMonoidStylesGBName :: Text
configMonoidStylesGBName :: Text
configMonoidStylesGBName = Text
"stack-colours"

configMonoidHideSourcePathsName :: Text
configMonoidHideSourcePathsName :: Text
configMonoidHideSourcePathsName = Text
"hide-source-paths"

configMonoidRecommendUpgradeName :: Text
configMonoidRecommendUpgradeName :: Text
configMonoidRecommendUpgradeName = Text
"recommend-stack-upgrade"

configMonoidNotifyIfNixOnPathName :: Text
configMonoidNotifyIfNixOnPathName :: Text
configMonoidNotifyIfNixOnPathName = Text
"notify-if-nix-on-path"

configMonoidCasaOptsName :: Text
configMonoidCasaOptsName :: Text
configMonoidCasaOptsName = Text
"casa"

configMonoidCasaRepoPrefixName :: Text
configMonoidCasaRepoPrefixName :: Text
configMonoidCasaRepoPrefixName = Text
"casa-repo-prefix"

configMonoidSnapshotLocationName :: Text
configMonoidSnapshotLocationName :: Text
configMonoidSnapshotLocationName = Text
"snapshot-location-base"

configMonoidNoRunCompileName :: Text
configMonoidNoRunCompileName :: Text
configMonoidNoRunCompileName = Text
"script-no-run-compile"

configMonoidStackDeveloperModeName :: Text
configMonoidStackDeveloperModeName :: Text
configMonoidStackDeveloperModeName = Text
"stack-developer-mode"