Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide instances for tuples up to size 7 #144

Closed
hvr opened this issue Sep 20, 2013 · 0 comments · Fixed by #145
Closed

Provide instances for tuples up to size 7 #144

hvr opened this issue Sep 20, 2013 · 0 comments · Fixed by #145

Comments

@hvr
Copy link
Member

hvr commented Sep 20, 2013

According to the Haskell Report,

There is no upper bound on the size of a tuple, but some Haskell implementations may restrict the size of tuples, and limit the instances associated with larger tuples. However, every Haskell implementation must support tuples up to size 15, together with the instances for Eq, Ord, Bounded, Read, and Show. The Prelude and libraries define tuple functions such as zip for tuples up to a size of 7.

However, currently aeson only provides instances for tuple instances up to 4-tuples; therefore I suggest to add at least instances for 5-, 6-, and 7-tuples to satisfy the principle of least surprise (and avoid requiring orphan instances).

I'll gladly provide a pull request if needed.

@bos bos closed this as completed in 0fb0273 Sep 23, 2013
tolysz pushed a commit to tolysz/aeson that referenced this issue May 18, 2015
Providing this instances is motived by the Haskell Report suggesting
that libraries ought to support tuples up to a size of 7
(see http://www.haskell.org/onlinereport/basic.html#basic-tuples):

> The Prelude and libraries define tuple functions such as zip for
> tuples up to a size of 7.

This fixes haskell#144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant