yaml-pretty-extras: Extra functionality for pretty printing Yaml documents.

[ bsd3, data, deprecated, library ] [ Propose Tags ]

Extra functionality for pretty printing Yaml documents. Allows precise field ordering.

[Skip to Readme]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,,,,
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), microlens-platform, rio, yaml [details]
License BSD-3-Clause
Copyright 2018 Daniel Firth
Author Daniel Firth
Maintainer locallycompact@gmail.com
Category Data
Source repo head: git clone https://gitlab.com/locallycompact/yaml-pretty-extras
Uploaded by locallycompact at 2018-06-28T15:14:23Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3422 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-06-28 [all 1 reports]

Readme for yaml-pretty-extras-

[back to package description]


This library adds a toPrettyYaml typeclass and helper functions.

Example Usage

{-# LANGUAGE DeriveAnyClass    #-}
{-# LANGUAGE DeriveGeneric     #-}
{-# LANGUAGE OverloadedStrings #-}

import Data.Yaml.Pretty.Extras
import GHC.Generics

data Foo = Foo {
  bar :: Text,
  quux :: Text
} deriving (Eq, Show, FromJSON, ToJSON)

instance ToPrettyYaml Foo where
  fieldOrder = const ["quux", "bar"]

main = encodeFilePretty "foo.yaml" (Foo "bar" "quux") -- prints out "quux: quux\nbar: bar"