Open nfrisby opened 3 years ago
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
?
I'm currently in a situation where I want to
rnf
a value from an upstream library, but it doesn't defineNFData
instances.It does, however, define a
Generic
instance. If there wereNFData
instances for the data types defined inGHC.Generics
(egU1
etc), I could writernf . GHC.Generics.from
. Alternatively, ifdeepseq
exported itsgrnf
definition, I could similarly writegrnf . 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.