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

[ bsd3, data, deprecated, library ] [ Propose Tags ] [ Report a vulnerability ]
Deprecated

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


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1.0, 0.0.1.1, 0.0.1.2, 0.0.1.3, 0.0.2.0, 0.0.2.1, 0.0.2.2
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
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3500 total (0 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-0.0.2.2

[back to package description]

yaml-pretty-extras

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"