deepseq icon indicating copy to clipboard operation
deepseq copied to clipboard

NFData(1) instances of Generically(1).

Open Icelandjack opened this issue 3 years ago • 0 comments

Generic instances of NFData and NFData1, and documentation.

instance (Generic a, GNFData Zero (Rep a)) => NFData (Generically a) where
  rnf :: Generically a -> ()
  rnf (Generically a) = grnf RnfArgs0 (from a)

instance (Generic1 f, GNFData One (Rep1 f)) => NFData1 (Generically1 f) where
  liftRnf :: (a -> ()) -> (Generically1 f a -> ())
  liftRnf r (Generically1 as) = grnf (RnfArgs1 r) (from1 as)

Icelandjack avatar Mar 23 '22 23:03 Icelandjack