obsidiansystems/aeson-gadt-th

Possible support for multiply-indexed data types?

cgibbard opened this issue · 3 comments

If presented with:

data Query t r where
  Query_Foo :: Query String Int

Should we generate FromJSON (Some (Some Query)) ?

It'd be nice to have the option to generate thatl, although I think the user probably ought to be explicit about how many Some wrappers they want

Yeah it would be possible to infer, but probably confusing for someone who didn't know what to expect.

Yeah, I think of instances similarly to binding variables (just with really structured variable names), and so I think, in the same way, we want to be pretty clear about what the splice is "binding".