Module

Record.ST

#STRecord

data STRecord :: Region -> # Type -> Type

A value of type STRecord h r represents a mutable record with fields r, belonging to the state thread h.

Create values of type STRecord using thaw.

#freeze

freeze :: forall h r. STRecord h r -> ST h ({  | r })

Freeze a mutable record, creating a copy.

#thaw

thaw :: forall h r. {  | r } -> ST h (STRecord h r)

Thaw an immutable record, creating a copy.

#peek

peek :: forall l h a r r1. Cons l a r1 r => IsSymbol l => SProxy l -> STRecord h r -> ST h a

Read the current value of a field in a mutable record, by providing a type-level representative for the label which should be read.

#poke

poke :: forall l h a r r1. Cons l a r1 r => IsSymbol l => SProxy l -> a -> STRecord h r -> ST h Unit

Modify a record in place, by providing a type-level representative for the label which should be updated.

#modify

modify :: forall l h a r r1. Cons l a r1 r => IsSymbol l => SProxy l -> (a -> a) -> STRecord h r -> ST h Unit

Modify a record in place, by providing a type-level representative for the label to update and a function to update it.

Modules