Closed recursion-ninja closed 1 month ago
I haven't looked at the code yet. CI is broken at the moment fix should be in #507
@recursion-ninja If you're trying to fix doctest it's easier to do so locally. Run in vector subdir.
$ cabal build all --write-ghc-environment-files=always
$ cabal run -- vector-doctest
@recursion-ninja If you're trying to fix doctest it's easier to do so locally. Run in vector subdir.
$ cabal build all --write-ghc-environment-files=always $ cabal run -- vector-doctest
Yes, I was. This is quite helpful.
The test now pass, but I still need to do a pass over the documentation.
The test now pass, but I still need to do a pass over the documentation.
I have updated the documentation.
@Shimuuar I think the PR is ready for review, and and potentially merged if the package maintainers agree.
Other than comment above PR is good to go.
I'm not sure why CI is failing. It seems to have stuck for some reason and then job got cancelled.
Other than comment above PR is good to go.
@Shimuuar I addressed the comment above. Should be good to merge now.
Merged. @recursion-ninja Thank you!
This PR contains a proof of concept for
Unbox
instances of "boxed" data-types by way of the newly addedAsBoxedStrictly
andAsBoxedLazily
newtypes. This PR is intended to address issue #503.The
AsBoxedStrictly
newtype imposes new strictness semantics on the underlying type, ensuring the wrapped value is always reduced to normal form. This invariant requires anNFData
instance for the underlying type. Furthermore, it requires the use of a "smart constructor" which evaluates the wrapped value to normal form, since a new-type cannot have strictness annotations. Hence there aremakeBoxedStrictly
andgrabBoxedStrictly
exposed from theData.Vector.Unboxed
module to construct and deconstructAsBoxedStrictly
values, respectively.The
AsBoxedLazily
new-type is much simpler since it preserves the strictness semantics of the underlying data-type unaltered.Here are two example usages of the newtypes as a proof of concept:
Strict usage
In
GHCi
Lazy usage
In
GHCi
Nota Bene
Since this is a proof of concept, all types and functions names are subject to change after the appropriate level of "bike-shedding" has occurred. Commentary is welcomed and encouraged.