Module

Data.Lazy

Package
lazy
Repository
purerl/purescript-lazy

#Lazy Source

data Lazy :: Type -> Type

Lazy a represents lazily-computed values of type a.

A lazy value is computed at most once - the result is saved after the first computation, and subsequent attempts to read the value simply return the saved value.

Lazy values can be created with defer, or by using the provided type class instances.

Lazy values can be evaluated by using the force function.

purerl note: Due to the nature of the BEAM platform Lazy values are not in fact lazy with the Erlang backend, but simple thunks, i.e. will be recomputed each time they are required.

Instances

#defer Source

defer :: forall a. (Unit -> a) -> Lazy a

Defer a computation, creating a Lazy value.

#force Source

force :: forall a. Lazy a -> a

Force evaluation of a Lazy value.

Modules
Data.Lazy