The aeson-utils package

[Tags: bsd3, library]

Utilities for working with Aeson.


[Skip to ReadMe]

Properties

Versions0.2.1, 0.2.1.1, 0.2.2.0, 0.2.2.1, 0.3, 0.3.0.1, 0.3.0.2
Change logCHANGELOG.md
Dependenciesaeson (>=0.6 && <0.10), attoparsec (>=0.10 && <0.14), base (==4.*), bytestring (>=0.9 && <0.11), scientific (>=0.3.2 && <0.4), text (>=0.11 && <1.3) [details]
LicenseBSD3
Copyright2014, Silk B.V
AuthorSilk. B.V.
Maintainercode@silk.co
CategoryData
Source repositoryhead: git clone https://github.com/silkapp/aeson-utils.git
UploadedMon May 25 21:23:54 UTC 2015 by AdamBergmark
DistributionsLTSHaskell:0.3.0.2, NixOS:0.3.0.2, Stackage:0.3.0.2
Downloads2503 total (174 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Last success reported on 2015-05-26 [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for aeson-utils-0.3.0.2

aeson-utils

Build Status

A small package containing helpful addititions to aeson.

It provides eitherDecodeV and decodeV functions (analogous to eitherDecode and decode in aeson) that can be used to parse atomic JSON values at the top level. This is not strictly valid JSON, only objects and arrays are allowed at the top level in the specification, but aeson's encode allows this already. This gives us the nice property decodeV . encode = Just.

The package also contains the .=? operator that you can use to optionally construct object pairs:

object (
  [ "a" .= foo
  , "b" .= bar
  ] ++ catMaybes
  [ "c" .=? mBaz
  , "d" .=? mQux
  ])

Finally it has a parseNumber function that converts a scientific into Either Integer Double in case you want to distinguish between integrals and fractionals.

Installation instructions

aeson-utils is available on hackage

cabal install aeson-utils