Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unboxed instances for Storable vectors #518

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ruifengx
Copy link

This is a follow up for the DoNotUnbox* family of newtype DerivingVia wrappers (#508). It allows treating Storable vectors as unboxed vectors. My personal use case is combining parallel arrays received from C FFI into a single Vector. I left a comment about this in #503, and did not get a response, but I still think this is a nice thing to have in vector.

I followed the implementation for UnboxViaPrim and named this new wrapper UnboxViaStorable. While working on this PR, I noticed that the documentation for UnboxViaPrim named the vector for Foo [M]V_Int instead of [M]V_Foo, so I also corrected them.

As a minor detail, the previous PR imports Data.Vector.Strict qualified as S, so I cannot use S for Storable and had to use St. I can change it if there is a preferred naming scheme for qualified imports.

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.

1 participant