@hackage / embed-config

Reasonable conventions for embedding YAML configuration with Template Haskell

Latest0.0.0.0

About

Metadata

  • Last updated , by carymrobbins
  • License BSD-3-Clause
  • Maintained by: carymrobbins@gmail.com

  • Lottery factor: 0

Links

Installation

Readme

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