basic-sop-0.2.0.3: Basic examples and functions for generics-sop
Generics.SOP.NFData
Description
Generic reduction to normal form.
This module contains a generic function that reduces a value to normal form, defined using generics-sop.
generics-sop
grnf :: (Generic a, All2 NFData (Code a)) => a -> () Source #
This function is a generic implementation of the rnf function that can be used to instantiate the NFData class in deepseq.
rnf
NFData
deepseq
Assuming you have a Generic instance for your datatype T, you can use grnf as follows:
Generic
T
grnf
instance NFData T where rnf = grnf