Skip to content

Consecutive defaults #27

Description

@Slesa

When working with configurations, sometimes they get overwritten depending on the origin. The order of the defaulting is discussable, but I think it is

  • read environment vars
  • read configuration file 1, maybe from server
  • read local configuration file
  • read arguments

and of course starting with settings that the programmer considers perfect as defaults.

type Settings { showAsWindow: bool; windowXsize: int; windowYsize: int }
let DefaultSettings = { true; 1024; 768 }

wouldn't it be nice to have a configuration chain like

let setup = DefaultSettings
|> EnvConfig.Get<Settings>
|> IniConfig.Get<Settings>
|> ArgConfig.Get<Settings>

Is this possible somehow?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions