úÎ&S%  (c) 2012, Herbert Valerio Riedel BSD-style (see the LICENSE file)$Herbert Valerio Riedel <hvr@gnu.org>stableGHC Safe-Inferred3JK Variant of  supporting  Hidden internal type-class Note: the   instance is not provided for 0 in order to trigger a compile-time error; see ' which defers this to a runtime error. GHC.Generics-based  implementationThis provides a generic B implementation for one type at a time. If the type of the value X is asked to reduce to NF contains values of other types, those types have to provide H instances. This also means that recursive types can only be used with  if a 9 instance has been defined as well (see examples below).The typical usage for 1 is for reducing boilerplate code when defining ` instances for ordinary algebraic datatypes. See the code below for some simple usage examples: ÿu{-# LANGUAGE DeriveGeneric #-} import Control.DeepSeq import Control.DeepSeq.Generics (genericRnf) import GHC.Generics -- simple record data Foo = Foo AccountId Name Address deriving Generic type Address = [String] type Name = String newtype AccountId = AccountId Int instance NFData AccountId instance NFData Foo where rnf = genericRnf -- recursive list-like type data N = Z | S N deriving Generic instance NFData N where rnf = genericRnf -- parametric & recursive type data Bar a = Bar0 | Bar1 a | Bar2 (Bar a) deriving Generic instance NFData a => NFData (Bar a) where rnf = genericRnf Note: The m type-class showing up in the type-signature is used internally and not exported on purpose currently. Variant of 1 which supports derivation for uninhabited types.For instance, the type data TagFoo deriving Generic&would cause a compile-time error with  , but with # the error is deferred to run-time: ÿÃPrelude> genericRnf (undefined :: TagFoo) <interactive>:1:1: No instance for (GNFData V1) arising from a use of `genericRnf' Possible fix: add an instance declaration for (GNFData V1) In the expression: genericRnf (undefined :: TagFoo) In an equation for `it': it = genericRnf (undefined :: TagFoo) Prelude> genericRnfV1 (undefined :: TagFoo) *** Exception: Control.DeepSeq.Generics.genericRnfV1: NF not defined for uninhabited typesSince: 0.1.1.0          deepseq-generics-0.1.1.1Control.DeepSeq.Genericsdeepseq-1.3.0.2Control.DeepSeqforce$!!deepseqrnfNFData genericRnf genericRnfV1 GNFDataV1GNFDatabase GHC.GenericsV1grnfV1_grnf_$fGNFDataV1:+:$fGNFDataV1:*: $fGNFDataV1M1 $fGNFDataV1K1 $fGNFDataV1U1 $fGNFDataV1V1 $fGNFData:+: $fGNFData:*: $fGNFDataM1 $fGNFDataK1 $fGNFDataU1