lazify-0.1.0.0: 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

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.

($~) :: forall rep a (b :: TYPE rep). (Generic a, LazifiableG (Rep a)) => (a -> b) -> a -> b Source #

Apply a function to a lazified value.