HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleyesod-1.6.2.3Haskell2010

Yesod.Default.Config2

Some next-gen helper functions for the scaffolding's configuration system.

Contents
  1. Locally defined
  2. Re-exports from Data.Yaml.Config
  3. For backwards compatibility
Synopsis
  • Packageyesod-1.6.2.3
  • Exports18
  • LanguageHaskell2010
  • LicenceMIT
  • SourceConfig2.hs

Locally defined

Re-exports from Data.Yaml.Config

valueapplyEnvValue
  1. :: Bool

    require an environment variable to be present?

  2. -> KeyMap Text
  3. -> Value
  4. -> Value

Override environment variable placeholders in the given Value with values from the environment.

If the first argument is True, then all placeholders _must_ be provided by the actual environment. Otherwise, default values from the Value will be used.

valueloadYamlSettings
  1. :: FromJSON settings
  2. => [FilePath]

    run time config files to use, earlier files have precedence

  3. -> [Value]

    any other values to use, usually from compile time config. overridden by files

  4. -> EnvUsage
  5. -> IO settings

Load the settings from the following three sources:

  • Run time config files

  • Run time environment variables

  • The default compile time config file

For example, to load up settings from config/foo.yaml and allow overriding from the actual environment, you can use:

loadYamlSettings ["config/foo.yaml"] [] useEnv
valueloadYamlSettingsArgs
  1. :: FromJSON settings
  2. => [Value]

    any other values to use, usually from compile time config. overridden by files

  3. -> EnvUsage

    use environment variables

  4. -> IO settings

Same as loadYamlSettings, but get the list of runtime config files from the command line arguments.

datadata EnvUsage

Defines how we want to use the environment variables when loading a config file. Use the smart constructors provided by this module.

Do not use any environment variables, instead relying on defaults values in the config file.

Do not use default values from the config file, but instead take all overrides from the environment. If a value is missing, loading the file will throw an exception.

For backwards compatibility

valueloadAppSettings
  1. :: FromJSON settings
  2. => [FilePath]

    run time config files to use, earlier files have precedence

  3. -> [Value]

    any other values to use, usually from compile time config. overridden by files

  4. -> EnvUsage
  5. -> IO settings

Deprecated. Use loadYamlSettings

Load the settings from the following three sources:

  • Run time config files

  • Run time environment variables

  • The default compile time config file

valueloadAppSettingsArgs
  1. :: FromJSON settings
  2. => [Value]

    any other values to use, usually from compile time config. overridden by files

  3. -> EnvUsage

    use environment variables

  4. -> IO settings

Deprecated. Use loadYamlSettingsArgs

Same as loadAppSettings, but get the list of runtime config files from the command line arguments.