lazify-0.1.0.1: A simple utility for lazy record matching
Safe HaskellNone
LanguageHaskell2010

Data.Lazify.Generic

Description

Record types in Haskell can be made lazy through lazy pattern matching. This module offers functions for making them lazy generically. Whereas Data.Lazify.genericLazify uses Lazifiable to lazify under a newtype, the functions in this module expect the underlying type of a newtype to be Generic as well.

Synopsis

Documentation

class GenericLazifiable a where Source #

This class is intended to be used primarily with the generic instance given in this module. However, users are free to write {-# OVERLAPPING #-} instances whenever necessary.

Methods

lazifyGeneric :: 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.

Instances

Instances details
(Generic a, LazifiableG a (Rep a)) => GenericLazifiable a Source #

The generic instance.

Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: a -> a Source #

Typeable a => GenericLazifiable (TypeRep a) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Coercible a b => GenericLazifiable (Coercion a b) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: Coercion a b -> Coercion a b Source #

a ~ b => GenericLazifiable (a :~: b) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: (a :~: b) -> a :~: b Source #

a ~~ b => GenericLazifiable (a :~~: b) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: (a :~~: b) -> a :~~: b Source #

GenericLazifiable (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

GenericLazifiable (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) Source #

GenericLazifiable (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Defined in Data.Lazify.Generic.Internal

Methods

lazifyGeneric :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) Source #

($~) :: forall rep a (b :: TYPE rep). GenericLazifiable a => (a -> b) -> a -> b Source #

Apply a function to a lazified value.

Note to users of TypeApplications: For GHC >= 9.0.1, the representation is marked as inferred. Before that, doing so is impossible and the representation must be passed as the first type argument. I'm sorry.