
Ryan Scott has argued that abstract types should not have Generic instances
at all. I'll let him make those arguments himself, but I think I should
mention that it's really hard to write instances that set up all the
appropriate type-level meta-data. Some of it (like the extra-full package
name) may only be doable with Template Haskell. Furthermore, some of the
metadata types change from GHC version to version.
As for laws, I think you *probably* meant
to . from = id
That is, that you can convert a value to its generic representation and
back and get the "same" value back.
I think that's likely sufficient for most purposes, but probably not all.
At the very least, it's something people using your instance would need to
be aware of. If either function is partial, you will be in a world of pain
if you try to use something like generic serialization.
On Mar 20, 2017 4:53 PM, "Gershom B"