[Haskell-cafe] Ordered JSON objects?

Manuel Gómez targen at gmail.com
Mon Dec 15 21:45:55 UTC 2014


On Mon, Dec 15, 2014 at 3:02 PM, Tobias Dammers <tdammers at gmail.com> wrote:
> Anyway, one thing I'm running up against is that I am going to need
> ordered key/value collections, which I believe is something JSON does
> not support out-of-the-box: "objects" ({"foo":15, "bar":23}) are
> conceptually unordered key/value collections (and Aeson treats them as
> such, using hash maps as the intermediate storage format)

This only works for pretty-printing unordered key/value collections
with a consistent, value-independent ordering, so it doesn’t sound
like it solves your problem, but it may be worth mentioning anyway:
http://hackage.haskell.org/package/aeson-pretty-0.7.2/docs/Data-Aeson-Encode-Pretty.html#g:3


More information about the Haskell-Cafe mailing list