embed-config-0.0.0.0: Reasonable conventions for embedding YAML configuration with Template Haskell
Safe HaskellNone
LanguageHaskell2010

Data.Yaml.Config.Embed

Description

Reasonable conventions for embedding YAML configuration with Template Haskell

Synopsis

Documentation

embedConfig :: Q Exp Source #

TH function for loading config/settings.yml relative to the project in which the TH splice is written.

loadConfig :: IO MyConfig
loadConfig = $(embedConfig)

embedConfigRelativeToProject :: FilePath -> Q Exp Source #

TH function for loading the supplied config file path relative to the project in which the TH splice is written.

loadConfig :: IO MyConfig
loadConfig = $(embedConfigRelativeToProject "path/to/settings.yml")

loadFromBytes :: FromJSON a => ByteString -> IO a Source #

Given the file content, read a YAML config file.

loadFromValue :: FromJSON a => Value -> IO a Source #

Given the file content as an Aeson Value, read a YAML config file.

newtype AesonKebab a Source #

A DerivingVia wrapper that only turns all fields into kebab-case. No other field processing occurs, which also means no field prefix stripping.

Constructors

AesonKebab a 

Instances

Instances details
(Generic a, GToJSON Zero (Rep a), GToEncoding Zero (Rep a)) => ToJSON (AesonKebab a) Source # 
Instance details

Defined in Data.Yaml.Config.Kebab

(Generic a, GFromJSON Zero (Rep a)) => FromJSON (AesonKebab a) Source # 
Instance details

Defined in Data.Yaml.Config.Kebab