[Haskell-cafe] Ordered JSON objects?

Wojtek Narczyński wojtek at power.com.pl
Mon Dec 15 22:01:12 UTC 2014


On 15.12.2014 20:32, Tobias Dammers 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), so I lose
> ordering;

JSON does not forbid ordering of maps by key, I believe. But you'd need 
to create an OrderedMap and patch aeson. It would be very useful, the 
mixing of key order is nuisance for human JSON consumers.


More information about the Haskell-Cafe mailing list