@hackage embed-config0.0.0.0

Reasonable conventions for embedding YAML configuration with Template Haskell

embed-config embed-config

Reasonable conventions for embedding YAML configuration with Template Haskell

Quick Start

config/settings.yml

foo-bar: 42
baz-quux: hello

src/MyApp/Config.hs

module MyApp.Config where

import Data.Yaml.Config.Embed (AesonKebab(..), embedConfig)

loadConfig :: IO Config
loadConfig = $(embedConfig)

data Config = Config
  { fooBar :: Int
  , bazQuux :: String
  } deriving stock (Show, Eq, Generic)
    deriving (FromJSON) via AesonKebab Config