Add instances for GHC.Generics data types
I'm currently in a situation where I want to rnf a value from an upstream library, but it doesn't define NFData instances.
It does, however, define a Generic instance. If there were NFData instances for the data types defined in GHC.Generics (eg U1 etc), I could write rnf . GHC.Generics.from. Alternatively, if deepseq exported its grnf definition, I could similarly write grnf . GHC.Generics.from.
Either of those would let me avoid something like an orphan instance etc. (Those can be harmless eg in exes or tests, but I try to avoid them in general.)
Are there pitfalls that would make exporting these instances/grnf a footgun for users, or would this merely provide users more options? Thanks.
I think that defining instances for the types in GHC.Generics sounds reasonable. You'd need NFData1 for some of the stuff, but all the instances seem pretty straightforward. Any of the maintainers of this library have any thoughts?
+1 from me, seems perfectly reasonable
We have GNFData for these types. Would giving them plain NFData yield a greater benefit than exporting grnf?