embed-config: Reasonable conventions for embedding YAML configuration with Template Haskell

[ bsd3, configuration, library ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.0
Change log CHANGELOG.md
Dependencies aeson (>=1.5.6.0 && <2), base (>=4.7 && <5), bytestring (>=0.10.12.0 && <1), file-embed (>=0.0.15.0 && <1), template-haskell (>=2.16.0.0 && <3), yaml (>=0.11.8.0 && <1) [details]
License BSD-3-Clause
Copyright 2022 SimSpace
Author Cary Robbins
Maintainer carymrobbins@gmail.com
Category Configuration
Home page https://github.com/simspace/embed-config#readme
Bug tracker https://github.com/simspace/embed-config/issues
Source repo head: git clone https://github.com/simspace/embed-config
Uploaded by carymrobbins at 2022-07-25T21:54:10Z
Distributions
Downloads 95 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for embed-config-0.0.0.0

[back to package description]

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