Skip to content

Add new and run to Record.ST #68

Closed
@kl0tl

Description

@kl0tl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions