Skip to content

Return more than one STArray from an ST computation? #78

Closed
@hdgarrood

Description

@hdgarrood

Given the type of runSTArray:

runSTArray ::
  forall a r.
    (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r (Array a)

it seems to me that it's a nice alternative to freeze + runST, which would involve an unnecessary copy, but I can't see a way to take advantage of this if I want to return more than one STArray from the computation. This would be helpful, for example, for efficiently implementing functions like unzip. Can anyone think of a good way of addressing this?

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