HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleyesod-1.6.2.1Haskell2010

Yesod.Default.Config2

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

  • 2 types
  • 16 values
  • Packageyesod-1.6.2.1
  • Exports18
  • LanguageHaskell2010
  • LicenceMIT
  • SourceConfig2.hs

Locally defined

4 declarations

Re-exports from Data.Yaml.Config

11 declarations
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.

valueignoreEnv :: EnvUsage
#

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

valueuseEnv :: EnvUsage
#

Use environment variables when available, otherwise use defaults.

valuerequireEnv :: EnvUsage
#

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

3 declarations
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.