Module

Record.ST

Package
purescript-record
Repository
purescript/purescript-record

#STRecord Source

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 Source

freeze :: forall h r. STRecord h r -> ST h (Record r)

Freeze a mutable record, creating a copy.

#thaw Source

thaw :: forall h r. Record r -> ST h (STRecord h r)

Thaw an immutable record, creating a copy.

#peek Source

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 Source

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 Source

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.