| Copyright | (c) 2014, Andrew G. Seniuk |
|---|---|
| License | BSD-style (see the LICENSE file) |
| Maintainer | Andrew Seniuk <rasfar@gmail.com> |
| Stability | provisional |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
Control.DeepSeq.Bounded.Generics.GSeqable
Description
Generic function version of Seqable (via Generics.SOP).
Probably, a GHC.Generics variant would also be possible.
This metaboilerplate is standard for using the generic deriving facilities of Generics.SOP. Consider seqaid for a turnkey solution.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveDataTypeable #-}
import Generics.SOP.TH
import Control.DeepSeq.Bounded.Seqable
data TA = A1 TB TA | A2
data TB = B1 Int | B2 TA
deriveGeneric ''TA
deriveGeneric ''TB
main = return $! force_ Propagate (A1 (force_ Propagate (B2 undefined)) A2)Documentation
grnf_ :: Generic a => SeqNodeKind -> a -> () Source
gseq_ :: Generic a => SeqNodeKind -> a -> b -> b Source
gforce_ :: Generic a => SeqNodeKind -> a -> a Source