Bas van Dijk | 17 Sep 17:48 2013
Picon

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
Edward Kmett | 17 Sep 20:53 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+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 <v.dijk.bas <at> gmail.com> 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 <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Dan Burton | 17 Sep 21:02 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+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 <ekmett <at> gmail.com> 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 <v.dijk.bas <at> gmail.com> 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 <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Christopher Done | 17 Sep 21:24 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+1 here. Standard JSON library.

On 17 September 2013 21:02, Dan Burton <danburton.email <at> gmail.com> wrote:
> +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 <ekmett <at> gmail.com> 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 <v.dijk.bas <at> gmail.com>
>> 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 <at> haskell.org
>>> http://www.haskell.org/mailman/listinfo/libraries
>>
>>
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
>
>
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
David Luposchainsky | 17 Sep 21:38 2013

Re: Haskell Platform Proposal: add the 'aeson' library

+1
Johan Tibell | 17 Sep 21:59 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+1

On Tue, Sep 17, 2013 at 12:38 PM, David Luposchainsky
<dluposchainsky <at> googlemail.com> wrote:
> +1
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
amindfv | 17 Sep 23:38 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+1, same reasons

Tom

El Sep 17, 2013, a las 15:59, Johan Tibell <johan.tibell <at> gmail.com> escribió:

> +1
> 
> On Tue, Sep 17, 2013 at 12:38 PM, David Luposchainsky
> <dluposchainsky <at> googlemail.com> wrote:
>> +1
>> _______________________________________________
>> Libraries mailing list
>> Libraries <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Alejandro Serrano Mena | 17 Sep 23:45 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

+1


2013/9/17 <amindfv <at> gmail.com>
+1, same reasons

Tom


El Sep 17, 2013, a las 15:59, Johan Tibell <johan.tibell <at> gmail.com> escribió:

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

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Niklas Hambüchen | 18 Sep 06:30 2013

Re: Haskell Platform Proposal: add the 'aeson' library

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
Bas van Dijk | 18 Sep 09:02 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
>
> https://github.com/bos/aeson/issues/126

What about settling that issue by adding documentation to the ToJSON
ByteString instance and the 'encode' function warning users about
this?

Bas
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Simon Hengel | 18 Sep 09:09 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote:
> On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
> >
> > https://github.com/bos/aeson/issues/126
> 
> 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
Michael Snoyman | 18 Sep 09:22 2013

Re: Haskell Platform Proposal: add the 'aeson' library




On Wed, Sep 18, 2013 at 10:09 AM, Simon Hengel <sol <at> typeful.net> wrote:
On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote:
> On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
> >
> > https://github.com/bos/aeson/issues/126
>
> 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 <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Herbert Valerio Riedel | 18 Sep 11:24 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

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)
Thomas Schilling | 18 Sep 13:26 2013

Re: Haskell Platform Proposal: add the 'aeson' library

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 <hvr <at> gnu.org> 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 <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
Bardur Arantsson | 18 Sep 13:39 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

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.)
Bardur Arantsson | 18 Sep 13:41 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

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
John Lato | 18 Sep 16:59 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

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 <nominolo <at> googlemail.com> 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.

On 18 September 2013 11:24, Herbert Valerio Riedel <hvr <at> gnu.org> 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 <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Edward Kmett | 18 Sep 17:17 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

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 <michael <at> snoyman.com> wrote:



On Wed, Sep 18, 2013 at 10:09 AM, Simon Hengel <sol <at> typeful.net> wrote:
On Wed, Sep 18, 2013 at 09:02:16AM +0200, Bas van Dijk wrote:
> On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
> >
> > https://github.com/bos/aeson/issues/126
>
> 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 <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries


_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Bas van Dijk | 23 Sep 14:56 2013
Picon

Re: Haskell Platform Proposal: add the 'aeson' library

On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
>
> https://github.com/bos/aeson/issues/126
> _______________________________________________
> Libraries mailing list
> Libraries <at> 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
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Conrad Parker | 24 Sep 02:06 2013

Re: Haskell Platform Proposal: add the 'aeson' library


On 23 September 2013 22:56, Bas van Dijk <v.dijk.bas <at> gmail.com> wrote:
On 18 September 2013 06:30, Niklas Hambüchen <mail <at> nh2.me> 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.
>
> https://github.com/bos/aeson/issues/126
> _______________________________________________
> Libraries mailing list
> Libraries <at> 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. 
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Yitzchak Gale | 2 Oct 11:52 2013

Re: Haskell Platform Proposal: add the 'aeson' library

> Note that Bryan pushed a patch which removes the ByteString instances

Following Michael:

+1 for including aeson in the next HP,
even if due to dependency constraints that
patch does not make it in this time.
(But let's give it our best try.)

-Yitz

Gmane