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

Data.Yaml.Config.Kebab

Description

Provides kebab-case instances for aeson.

Synopsis

Documentation

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

kebab :: String -> String Source #

Convert a camelCase string to kebab-case.

kebabName :: Name -> String Source #

Gets the given identifier name as a String but converts it to kebab-case. Useful for

fooBar = True
kebabName 'fooBar == "foo-bar"

getName :: Name -> String Source #

Gets the given identifier name as a String.

If DuplicateRecordFields is enabled, detects the names in the form of $sel:name:Type and extracts the name.