Module

Record.ST

Package
purescript-record
Repository
purescript/purescript-record

#STRecord Source

data STRecord :: Region -> Row 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 r h. STRecord h r -> ST h (Record r)

Freeze a mutable record, creating a copy.

#thaw Source

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

Thaw an immutable record, creating a copy.

#peek Source

peek :: forall r1 r a h l. 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 r1 r a h l. 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 r1 r a h l. 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.