Safe Haskell | None |
---|---|
Language | Haskell2010 |
Record types in Haskell can be made lazy through lazy pattern matching. This module offers functions for making them lazy generically.
- class LazifiableG f where
- class IsNewtypeG f where
- lazifyGeneric :: (Generic a, LazifiableG (Rep a)) => a -> a
- ($~) :: forall rep a (b :: TYPE rep). (Generic a, LazifiableG (Rep a)) => (a -> b) -> a -> b
Documentation
class LazifiableG f where Source #
A Generic
representation that can be lazified.
LazifiableG k (U1 k) Source # | |
(LazifiableG k f, LazifiableG k g) => LazifiableG k ((:*:) k f g) Source # | |
LazifiableG k (K1 k i c) Source # | |
LazifiableG k f => LazifiableG k (S1 k c f) Source # | |
LazifiableG k f => LazifiableG k (C1 k c f) Source # | |
LazifiableG k f => LazifiableG k (D1 k (MetaData x y z False) f) Source # | |
IsNewtypeG k f => LazifiableG k (D1 k (MetaData x y z True) f) Source # | |
class IsNewtypeG f where Source #
A Generic
representation that should be lazified newtype
-style.
That is, its contents should be lazified.
lazifyNewtypeG :: f a -> f a Source #
Dig into a newtype
and lazify its payload generically.
(Generic a, LazifiableG * (Rep a)) => IsNewtypeG k (K1 k i a) Source # | |
IsNewtypeG k f => IsNewtypeG k (M1 k i c f) Source # | |
lazifyGeneric :: (Generic a, LazifiableG (Rep a)) => a -> a Source #
Lazify a record using its generic representation.
Note that newtypes are treated specially: a newtype is lazified by lazifying its underlying type.