Module

Supply

#Supply

data Supply s a

A type that can be used to generate values on demand. s is a phantom type parameter that prevents unsafe usage

Constructors

Instances

#supplyValue

supplyValue :: forall s a. Supply s a -> a

Get the value of a supply. This function, together with

#split2

split2 :: forall s a. Supply s a -> Tuple (Supply s a) (Supply s a)

Split a supply into two different supplies.

#split3

split3 :: forall s a. Supply s a -> Tuple3 (Supply s a) (Supply s a) (Supply s a)

Split a supply into three different supplies.

#split4

split4 :: forall s a. Supply s a -> Tuple4 (Supply s a) (Supply s a) (Supply s a) (Supply s a)

Split a supply into four different supplies.

#unsafeInterleaveEffect

unsafeInterleaveEffect :: forall a. Effect a -> Effect (Lazy a)

unsafeInterleaveEffect allows an Effect to be deferred lazily.

#newSupply

newSupply :: forall s a. a -> (a -> a) -> Effect (Supply s a)

Create a new supply

#withSupply

withSupply :: forall r a. a -> (a -> a) -> (forall s. Supply s a -> r) -> r

Create a new supply and use it without effects

#modifySupply

modifySupply :: forall s a b. Supply s a -> (Supply s a -> b) -> Supply s b

Generate a new supply by systematically applying a function

#newIntSupply

newIntSupply :: forall s. Effect (Supply s Int)

Create a new integer supply

#withIntSupply

withIntSupply :: forall r. (forall s. Supply s Int -> r) -> r

Create a new integer supply and use it without effects

Modules