lazify- A simple utility for lazy record matching

Safe HaskellNone



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.



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.