aeson-utils: Utilities for working with Aeson.

[ bsd3, data, library ] [ Propose Tags ]
Versions 0.2.1,,,, 0.3,,
Change log
Dependencies aeson (>=0.6 && <1.3), attoparsec (>=0.10 && <0.14), base (==4.*), bytestring (>=0.9 && <0.11), scientific (>=0.3.2 && <0.4), text (>=0.11 && <1.3) [details]
License BSD-3-Clause
Copyright 2014, Silk B.V
Author Silk. B.V.
Revised Revision 5 made by AdamBergmark at Sun Apr 23 10:56:56 UTC 2017
Category Data
Source repo head: git clone
Uploaded by AdamBergmark at Mon May 25 21:23:54 UTC 2015
Distributions LTSHaskell:, NixOS:, Stackage:, openSUSE:
Downloads 5561 total (27 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-26 [all 1 reports]
Hackage Matrix CI

Utilities for working with Aeson.

[Skip to Readme]




Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for aeson-utils-

[back to package description]


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