Skip to content

Add clone to Data.Array.ST#243

Merged
garyb merged 4 commits into
purescript:masterfrom
gbagan:master
Nov 2, 2023
Merged

Add clone to Data.Array.ST#243
garyb merged 4 commits into
purescript:masterfrom
gbagan:master

Conversation

@gbagan

@gbagan gbagan commented Oct 31, 2023

Copy link
Copy Markdown
Contributor

Description of the change

This PR adds clone :: forall h a. STArray h a -> ST h (STArray h a) to the Data.Array.ST module.
It makes a mutable copy of a mutable array.
This is similar to the clone function in the Haskell module Data.Vector.Mutable.
This is equivalent to unsafeThaw <<< freeze but more readable.
I need it in one of my projects.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

Comment thread test/Test/Data/Array/ST.purs
@garyb

garyb commented Nov 2, 2023

Copy link
Copy Markdown
Member

Could you add a note to the changelog too?

@garyb

garyb commented Nov 2, 2023

Copy link
Copy Markdown
Member

Thanks!

@garyb garyb merged commit d521e17 into purescript:master Nov 2, 2023
@garyb

garyb commented Nov 3, 2023

Copy link
Copy Markdown
Member

Now released as v7.3.0, apologies for the delay 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants