Skip to content

Instantly share code, notes, and snippets.

@ramirez7
Last active November 16, 2016 21:36
Show Gist options
  • Select an option

  • Save ramirez7/a963a5745f74d7e76b95ddb19615397d to your computer and use it in GitHub Desktop.

Select an option

Save ramirez7/a963a5745f74d7e76b95ddb19615397d to your computer and use it in GitHub Desktop.

config file:

cfg {
  list_of_lists = [["a", "b"], ["$(THE_X)", "$(THE_Y)"]]
  other_list = ["$(THE_X)", "$(THE_Y)"]
  x = "$(THE_X)"
  y = "$(THE_Y)"
}

ghci exchange (ghci started with THE_X="x" THE_Y="y" stack ghci)

λ: import Data.Configurator
λ: c <- load [Required "/Users/armandoramirez/testenvconfig.conf"]
λ: display c
("",fromList [("cfg.x",String "x"),("cfg.y",String "y"),
("cfg.other_list",List [String "$(THE_X)",String "$(THE_Y)"]),
("cfg.list_of_lists",List [List [String "a",String "b"],List [String "$(THE_X)",String "$(THE_Y)"]])])

Interpolation worked for config values that are Strings, but didn't work when the Strings were used within lists.

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