[Haskell-cafe] JSON library suggestions?
radical at google.com
Tue Apr 24 23:51:56 CEST 2012
they are nominally related; the key differences are that in JSON, numeric
(a) can have any non-zero number of digits, effectively making JSON numbers
both unbounded and arbitrarily precise (though actual infinities cannot be
(b) cannot represent values that are not composed of digits, like NaN.
For that reason, most standard (fixed size/binary) numeric types like
double are a poor choice to contain numeric values specified in JSON; in
particular, the mismatch means that conversion can be lossy in both
Hope that helps!
On Tue, Apr 24, 2012 at 5:19 PM, Jeremy Shaw <jeremy at n-heptane.com> wrote:
> is 'Number' which is a floating point number? Which is why Aeson and
> others insist on converting everything to a Double or other Rational
> - jeremy
> On Tue, Apr 24, 2012 at 3:46 PM, Jeff Shaw <shawjef3 at msu.edu> wrote:
> > Hello,
> > Up until now I've been using Aeson, but I've found that its number type
> > isn't going to work for me. I need to use decimal numbers while avoiding
> > conversions from and to Double, which Aeson doesn't allow. There are
> quite a
> > few more JSON libraries for Haskell, which all appear to use Rational for
> > numbers, so I'm wondering if anyone can recommend one.
> > Thanks,
> > Jeff
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe