Haskell Platform Proposal: add the 'aeson' library

Hello, I would like to propose adding the 'aeson' library to the next Haskell Platform which is scheduled for November. The detailed proposal is kept at: http://trac.haskell.org/haskell-platform/wiki/Proposals/aeson Discussion deadline: October 7th, 2013 Regards, Bas

+1 from me.
It is pretty much the defacto standard way to work with json these days.
-Edward
On Tue, Sep 17, 2013 at 11:48 AM, Bas van Dijk
Hello,
I would like to propose adding the 'aeson' library to the next Haskell Platform which is scheduled for November.
The detailed proposal is kept at:
http://trac.haskell.org/haskell-platform/wiki/Proposals/aeson
Discussion deadline: October 7th, 2013
Regards,
Bas _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1
I agree with Edward. Everybody already uses, trusts, and loves aeson.
-- Dan Burton
On Tue, Sep 17, 2013 at 11:53 AM, Edward Kmett
+1 from me.
It is pretty much the defacto standard way to work with json these days.
-Edward
On Tue, Sep 17, 2013 at 11:48 AM, Bas van Dijk
wrote: Hello,
I would like to propose adding the 'aeson' library to the next Haskell Platform which is scheduled for November.
The detailed proposal is kept at:
http://trac.haskell.org/haskell-platform/wiki/Proposals/aeson
Discussion deadline: October 7th, 2013
Regards,
Bas _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1 here. Standard JSON library.
On 17 September 2013 21:02, Dan Burton
+1
I agree with Edward. Everybody already uses, trusts, and loves aeson.
-- Dan Burton
On Tue, Sep 17, 2013 at 11:53 AM, Edward Kmett
wrote: +1 from me.
It is pretty much the defacto standard way to work with json these days.
-Edward
On Tue, Sep 17, 2013 at 11:48 AM, Bas van Dijk
wrote: Hello,
I would like to propose adding the 'aeson' library to the next Haskell Platform which is scheduled for November.
The detailed proposal is kept at:
http://trac.haskell.org/haskell-platform/wiki/Proposals/aeson
Discussion deadline: October 7th, 2013
Regards,
Bas _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1
On Tue, Sep 17, 2013 at 12:38 PM, David Luposchainsky
+1 _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1, same reasons
Tom
El Sep 17, 2013, a las 15:59, Johan Tibell
+1
On Tue, Sep 17, 2013 at 12:38 PM, David Luposchainsky
wrote: +1 _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1
2013/9/17
+1, same reasons
Tom
El Sep 17, 2013, a las 15:59, Johan Tibell
escribió: +1
On Tue, Sep 17, 2013 at 12:38 PM, David Luposchainsky
wrote: +1 _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust: "Partial instances" that will call error in pure code and crash my program. ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it. https://github.com/bos/aeson/issues/126

On 18 September 2013 06:30, Niklas Hambüchen
On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my program.
ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
What about settling that issue by adding documentation to the ToJSON ByteString instance and the 'encode' function warning users about this? Bas

On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote:
On 18 September 2013 06:30, Niklas Hambüchen
wrote: On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my program.
ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
What about settling that issue by adding documentation to the ToJSON ByteString instance and the 'encode' function warning users about this?
That looks scary. I'd either make it total or remove the instance all together. I think by now almost everybody in the Haskell community agrees that we do not want pure partial functions. Cheers, Simon

On Wed, Sep 18, 2013 at 10:09 AM, Simon Hengel
On 18 September 2013 06:30, Niklas Hambüchen
wrote: On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my
On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote: program.
ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
What about settling that issue by adding documentation to the ToJSON ByteString instance and the 'encode' function warning users about this?
That looks scary. I'd either make it total or remove the instance all together.
I think by now almost everybody in the Haskell community agrees that we do not want pure partial functions.
I don't want this issue to block inclusion of aeson. And IMO, the HP review process shouldn't be a time to try and twist a maintainer's arm into making a change he/she isn't interested in. That happened quite a bit on the text package, and I don't want to see it happen on aeson as well (especially given that Bryan would be the victim in both cases). That said, I personally would prefer removing the ToJSON/FromJSON instances for ByteString. We've been bitten by this in our codebases, and have resorted to using a ByteString64 newtype wrapper, which uses base64 encoding to ensure safe roundtripping. So: +1 from me on including aeson as-is, and if Bryan's interested in making this change to aeson, I'd consider it a perk. Michael

On 2013-09-18 at 09:22:07 +0200, Michael Snoyman wrote: [...]
So: +1 from me on including aeson as-is, and if Bryan's interested in making this change to aeson, I'd consider it a perk.
+1 like Micheal (i.e. I support `aeson` in HP unconditionally; but I'd be delighted if the `ByteString` instances not pure issue would be fixed somehow)

I'm also +1, though I'd strongly prefer that the instance for
ByteString gets dropped before inclusion.
The "don't do that" approach is not very Haskelly. A Char8 ByteString
is the same type as a Word8 ByteString, so while you could argue that
Char8 is implicitly ASCII, the instance couldn't distinguish it from
Word8 ByteStrings where this doesn't make sense. Since JSON doesn't
have a standard way of encoding binary data
(utf8/base64/base64url/...), external JSON API often may use their own
convention, so it's best to require users to be explicit about
semantics.
On 18 September 2013 11:24, Herbert Valerio Riedel
On 2013-09-18 at 09:22:07 +0200, Michael Snoyman wrote:
[...]
So: +1 from me on including aeson as-is, and if Bryan's interested in making this change to aeson, I'd consider it a perk.
+1 like Micheal
(i.e. I support `aeson` in HP unconditionally; but I'd be delighted if the `ByteString` instances not pure issue would be fixed somehow) _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On 2013-09-18 13:26, Thomas Schilling wrote:
I'm also +1, though I'd strongly prefer that the instance for ByteString gets dropped before inclusion.
The "don't do that" approach is not very Haskelly. A Char8 ByteString is the same type as a Word8 ByteString, so while you could argue that Char8 is implicitly ASCII, the instance couldn't distinguish it from Word8 ByteStrings where this doesn't make sense. Since JSON doesn't have a standard way of encoding binary data (utf8/base64/base64url/...), external JSON API often may use their own convention, so it's best to require users to be explicit about semantics.
+1 with removal of BS instance, -0 otherwise. (For all the reasons stated in this sub-thread.)

On 2013-09-18 13:39, Bardur Arantsson wrote:
On 2013-09-18 13:26, Thomas Schilling wrote:
I'm also +1, though I'd strongly prefer that the instance for ByteString gets dropped before inclusion.
The "don't do that" approach is not very Haskelly. A Char8 ByteString is the same type as a Word8 ByteString, so while you could argue that Char8 is implicitly ASCII, the instance couldn't distinguish it from Word8 ByteStrings where this doesn't make sense. Since JSON doesn't have a standard way of encoding binary data (utf8/base64/base64url/...), external JSON API often may use their own convention, so it's best to require users to be explicit about semantics.
+1 with removal of BS instance, -0 otherwise.
Sigh... pressed "Send" too fast. Should have said: +1 with removal of BS instance or explicit opt-in with appropriate documentation warnings (etc.). -0 otherwise

I agree with Michael and Thomas,
+1 to including aeson as-is; if the ByteString instance is removed so much
the better.
On Wed, Sep 18, 2013 at 6:26 AM, Thomas Schilling
I'm also +1, though I'd strongly prefer that the instance for ByteString gets dropped before inclusion.
The "don't do that" approach is not very Haskelly. A Char8 ByteString is the same type as a Word8 ByteString, so while you could argue that Char8 is implicitly ASCII, the instance couldn't distinguish it from Word8 ByteStrings where this doesn't make sense. Since JSON doesn't have a standard way of encoding binary data (utf8/base64/base64url/...), external JSON API often may use their own convention, so it's best to require users to be explicit about semantics.
On 18 September 2013 11:24, Herbert Valerio Riedel
wrote: On 2013-09-18 at 09:22:07 +0200, Michael Snoyman wrote:
[...]
So: +1 from me on including aeson as-is, and if Bryan's interested in making this change to aeson, I'd consider it a perk.
+1 like Micheal
(i.e. I support `aeson` in HP unconditionally; but I'd be delighted if the `ByteString` instances not pure issue would be fixed somehow) _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

I'm with Michael on +1 as-is.
I'm rather neutral on removing the instance as it is a matter of taste and
I tend to prefer these sorts of things to be simple up-down votes of
confidence rather than have them devolve into long unproductive
bikeshedding discussions.
-Edward
On Wed, Sep 18, 2013 at 3:22 AM, Michael Snoyman
On Wed, Sep 18, 2013 at 10:09 AM, Simon Hengel
wrote: On 18 September 2013 06:30, Niklas Hambüchen
wrote: On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my
On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote: program.
ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
What about settling that issue by adding documentation to the ToJSON ByteString instance and the 'encode' function warning users about this?
That looks scary. I'd either make it total or remove the instance all together.
I think by now almost everybody in the Haskell community agrees that we do not want pure partial functions.
I don't want this issue to block inclusion of aeson. And IMO, the HP review process shouldn't be a time to try and twist a maintainer's arm into making a change he/she isn't interested in. That happened quite a bit on the text package, and I don't want to see it happen on aeson as well (especially given that Bryan would be the victim in both cases).
That said, I personally would prefer removing the ToJSON/FromJSON instances for ByteString. We've been bitten by this in our codebases, and have resorted to using a ByteString64 newtype wrapper, which uses base64 encoding to ensure safe roundtripping.
So: +1 from me on including aeson as-is, and if Bryan's interested in making this change to aeson, I'd consider it a perk.
Michael
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On 18 September 2013 06:30, Niklas Hambüchen
On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my program.
ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
https://github.com/bos/aeson/issues/126 _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Note that Bryan pushed a patch which removes the ByteString instances: https://github.com/bos/aeson/commit/9ee73f303cacb8ae73b2325f2f47288522607420 I think this is a good change. Now users have to be explicit how they want to encode binary data as JSON. Bas

On 23 September 2013 22:56, Bas van Dijk
On 18/09/13 04:02, Dan Burton wrote:
Everybody already uses, trusts, and loves aeson.
There's only one thing about it that I don't trust:
"Partial instances" that will call error in pure code and crash my
On 18 September 2013 06:30, Niklas Hambüchen
wrote: program. ByteString has such an instance that simply assumes that ByteString is the same as Text, so it calls Data.Text.Encoding.decodeUtf8 on it.
https://github.com/bos/aeson/issues/126 _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Note that Bryan pushed a patch which removes the ByteString instances:
https://github.com/bos/aeson/commit/9ee73f303cacb8ae73b2325f2f47288522607420
I think this is a good change. Now users have to be explicit how they want to encode binary data as JSON.
great, +1 to including the next (major-bumped) version. Conrad.
participants (17)
-
Alejandro Serrano Mena
-
amindfv@gmail.com
-
Bardur Arantsson
-
Bas van Dijk
-
Christopher Done
-
Conrad Parker
-
Dan Burton
-
David Luposchainsky
-
Edward Kmett
-
Herbert Valerio Riedel
-
Johan Tibell
-
John Lato
-
Michael Snoyman
-
Niklas Hambüchen
-
Simon Hengel
-
Thomas Schilling
-
Yitzchak Gale