packages feed

yaml-pretty-extras 0.0.1.0 → 0.0.1.1

raw patch · 3 files changed

+10/−3 lines, 3 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ Data.Yaml.Pretty.Extras: dropNull :: ToPrettyYaml a => a -> Bool

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for yaml-pretty-extras +## v0.0.1.1++Add dropNull to ToPrettyYaml typeclass+ ## v0.0.1.0  Added ToPrettyYaml typeclass
src/Data/Yaml/Pretty/Extras.hs view
@@ -34,8 +34,11 @@ class ToJSON a => ToPrettyYaml a where   fieldOrder :: a -> [Text] +  dropNull :: a -> Bool+  dropNull = const True+   toPrettyYaml :: a -> BS.ByteString-  toPrettyYaml x = encodePretty (setConfCompare (listElemCmp . fieldOrder $ x) defConfig) x+  toPrettyYaml = encodePretty =<< liftM2 setConfDropNull dropNull (flip setConfCompare defConfig . listElemCmp . fieldOrder)  encodeFilePretty :: ToPrettyYaml a => FilePath -> a -> IO () encodeFilePretty f x = BS.writeFile f (toPrettyYaml x)
yaml-pretty-extras.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 10a917deabaf96f7b00417d2777df1db675e35e4ce413f5519a569d71b864838+-- hash: 35b8f036cce8b58878b94e77d8f07de52ec517ed3437adef721d4d13efa3d8bf  name:           yaml-pretty-extras-version:        0.0.1.0+version:        0.0.1.1 synopsis:       Extra functionality for pretty printing Yaml documents. description:    Extra functionality for pretty printing Yaml documents. Allows precise field ordering. category:       Data