Skip to content

Use safer Vector.fromArray#327

Merged
aspiwack merged 2 commits intomasterfrom
ud/vector.fromarray
May 17, 2021
Merged

Use safer Vector.fromArray#327
aspiwack merged 2 commits intomasterfrom
ud/vector.fromarray

Conversation

@utdemir
Copy link
Copy Markdown
Contributor

@utdemir utdemir commented May 13, 2021

Closes #214.

Turns out there is a recent addition to vector library since version 0.12.2.0:

fromArray :: Data.Primitive.Array a -> Vector a

This is very close to what we were looking for, so this PR uses that to simplify our Data.Array.Mutable.Linear.freeze function.

I also added a lower bound to vector package to ensure that we don't get an old one.

@utdemir utdemir requested a review from aspiwack May 13, 2021 07:57
Copy link
Copy Markdown
Member

@aspiwack aspiwack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this is much better.

@aspiwack aspiwack merged commit a12190d into master May 17, 2021
@aspiwack aspiwack deleted the ud/vector.fromarray branch May 17, 2021 08:35
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.

Find a safe way to convert an GHC.Exts.Array# to a Data.Vector.Vector

2 participants