Add Unboxed instances for Storable vectors#518
Conversation
|
I see some doctests errors and tried to fix them. Unfortunately, I cannot run doctests locally because it reports a lot of "Could not find module" errors, so I did it based on the logs from GitHub CI. After fixing the obvious typos, I am somewhat stuck right now because I do not quite understand how the module grouping in |
|
I think PR is fine in general. We have support for deriving unboxed instances using primitive vectors, variants of boxed vector. No reason to not to add storable into the mix. I'll try to look why doctests fail on GHC 9.0,8.10 |
- Fix typos in documentation for UnboxViaStorable - Add implementation of unboxing newtypes for Storable data
Doctests do awful job checking it. Constructor may be in scope for doctest and not in scope for client code
|
As it turns out failure was genuine. |
|
Thanks, I see the problem now. |
This is a follow up for the
DoNotUnbox*family of newtypeDerivingViawrappers (#508). It allows treatingStorablevectors 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
UnboxViaPrimand named this new wrapperUnboxViaStorable. While working on this PR, I noticed that the documentation forUnboxViaPrimnamed the vector forFoo[M]V_Intinstead of[M]V_Foo, so I also corrected them.As a minor detail, the previous PR imports
Data.Vector.Strictqualified asS, so I cannot useSforStorableand had to useSt. I can change it if there is a preferred naming scheme for qualified imports.