Module

Data.Record.ST

Package
purescript-record
Repository
purescript/purescript-record

#STRecord Source

data STRecord :: Type -> 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 thawSTRecord.

#freezeSTRecord Source

freezeSTRecord :: forall eff r h. STRecord h r -> Eff (st :: ST h | eff) (Record r)

Freeze a mutable record, creating a copy.

#thawSTRecord Source

thawSTRecord :: forall eff r h. Record r -> Eff (st :: ST h | eff) (STRecord h r)

Thaw an immutable record, creating a copy.

#peekSTRecord Source

peekSTRecord :: forall eff r1 r a h l. RowCons l a r1 r => IsSymbol l => SProxy l -> STRecord h r -> Eff (st :: ST h | eff) 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.

#pokeSTRecord Source

pokeSTRecord :: forall eff r1 r a h l. RowCons l a r1 r => IsSymbol l => SProxy l -> a -> STRecord h r -> Eff (st :: ST h | eff) Unit

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

#runSTRecord Source

runSTRecord :: forall eff r. (forall h. Eff (st :: ST h | eff) (STRecord h r)) -> Eff eff (Record r)

Run an ST computation safely, constructing a record.

#pureSTRecord Source

pureSTRecord :: forall r. (forall eff h. Eff (st :: ST h | eff) (STRecord h r)) -> Record r

Run an ST computation safely, constructing a record, assuming no other types of effects.