Foreign.Object.ST and Data.Array.ST export means of creating empty mutable structures without having to thaw an immutable one. Should we also export new :: forall h. ST h (STRecord h ()) from Record.ST for consistency?
There’s also Foreign.Object.runST and Data.Array.ST.run to avoid copying the mutable structure in the end. Any reason not to add a similar run :: forall r. (forall h. ST h (STRecord h r)) -> Record r to Record.ST? This would require an unsafeFreeze :: forall h r. STRecord h r -> ST h (Record r) function that we could export with an unsafeThaw :: forall h r. Record r -> ST h (STRecord h r) function from a new Record.ST.Unsafe module.
Foreign.Object.ST and Data.Array.ST export means of creating empty mutable structures without having to thaw an immutable one. Should we also export
new :: forall h. ST h (STRecord h ())
from Record.ST for consistency?There’s also Foreign.Object.runST and Data.Array.ST.run to avoid copying the mutable structure in the end. Any reason not to add a similar
run :: forall r. (forall h. ST h (STRecord h r)) -> Record r
to Record.ST? This would require anunsafeFreeze :: forall h r. STRecord h r -> ST h (Record r)
function that we could export with anunsafeThaw :: forall h r. Record r -> ST h (STRecord h r)
function from a new Record.ST.Unsafe module.