fpclass / perpetual-haskelling-initiative

Main repository for the CS141 Perpetual Haskelling Initiative
MIT License
0 stars 0 forks source link

Add FromJSON/ToJSON instances to basic types #10

Closed oscar-h64 closed 4 years ago

oscar-h64 commented 4 years ago

This PR adds FromJSON/ToJSON instances for the types introduced in the feature/basic-types branch (derived automatically using the DeriveGeneric extension)

oscar-h64 commented 4 years ago

The only issue still left is NoOp is encoded as [] rather than "NoOp". This seems to be a thing when there is only 1 constructor. When additional constructors are added it works as expected. I believe we will be adding more constructors, however should I fix it so it works in the current situation?

mbg commented 4 years ago

No that's fine for now! Thanks!

oscar-h64 commented 4 years ago

I just fixed it anyway, there's a nice option tagSingleConstructors that fixes it