deepseq-bounded-0.5.2: Bounded deepseq, including support for generic deriving

Copyright(c) 2014, Andrew G. Seniuk
LicenseBSD-style (see the LICENSE file)
MaintainerAndrew Seniuk <rasfar@gmail.com>
Stabilityprovisional
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

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