Add Unboxed instances for Storable vectors #518
+104
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up for the
DoNotUnbox*
family of newtypeDerivingVia
wrappers (#508). It allows treatingStorable
vectors as unboxed vectors. My personal use case is combining parallel arrays received from C FFI into a singleVector
. 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 invector
.I followed the implementation for
UnboxViaPrim
and named this new wrapperUnboxViaStorable
. While working on this PR, I noticed that the documentation forUnboxViaPrim
named the vector forFoo
[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 asS
, so I cannot useS
forStorable
and had to useSt
. I can change it if there is a preferred naming scheme for qualified imports.