headroom-0.3.2.0: License Header Manager
Copyright(c) 2019-2020 Vaclav Svejcar
LicenseBSD-3-Clause
Maintainervaclav.svejcar@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Headroom.Serialization

Description

Module providing support for data (de)serialization, mainly fromto JSON/ and YAML.

Synopsis

JSON/YAML Serialization

aesonOptions :: Options Source #

Custom Aeson encoding options used for generic mapping between data records and JSON or YAML values. Expects the fields in input to be without the prefix and with words formated in symbol case (example: record field uUserName, JSON field user-name).

dropFieldPrefix :: String -> String Source #

Drops prefix from camel-case text.

>>> dropFieldPrefix "xxHelloWorld"
"helloWorld"

symbolCase Source #

Arguments

:: Char

word separator symbol

-> String

input text

-> String

processed text

Transforms camel-case text into text cased with given symbol.

>>> symbolCase '-' "fooBar"
"foo-bar"

Pretty Printing

prettyPrintYAML Source #

Arguments

:: ToJSON a 
=> a

data to pretty print

-> Text

pretty printed YAML output

Pretty prints given data as YAML.