Skip to content

Conversation

RyanGlScott
Copy link
Member

Because boilerplate makes me sad.

This adds the capability to automatically derive:

  • ToJSON1, ToJSON2, FromJSON1, and FromJSON2 with Template Haskell
  • ToJSON1 and FromJSON1 via GHC generics (sadly, generics isn't expressive enough to cover ToJSON2 and FromJSON2)

This code is somewhat old and had to rebased several times recently, so @andrewthad, @phadej, please make sure I didn't accidentally trample something you wrote.

@phadej
Copy link
Collaborator

phadej commented Jun 7, 2016

Unfortunately #413 moves everything around, but I can rebase this after moving is merged; could review then on the way too.

@andrewthad
Copy link
Contributor

I'm not really qualified to review it, but this looks good from a cursory glance. I think it may be easier to rebase (or more accurately, redo by means of coping and pasting) #413 on top of this branch than it would be to rebase this branch on top of #413.

, GFromJSON(..)
, GToJSON(..)
, GToEncoding(..)
, Zero
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does one need to export these from Data.Aeson ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Need" is a strong word, but if GFromJSON/GToJSON/GToEncoding are exported from Data.Aeson, then I feel it makes sense to export Zero/One too, since it would now be pretty much impossible to write useful type signatures involving the former without using the latter (since you need things like GToJSON Zero (Rep a)).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@phadej
Copy link
Collaborator

phadej commented Jun 7, 2016

@andrewthad I disagree: #415

@andrewthad
Copy link
Contributor

@phadej Dang. You did that way faster than I thought was possible.

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 this pull request may close these issues.

4 participants