Closed Shimuuar closed 7 months ago
At this point PR is pretty much ready
@infinity0 could you possibly review?
Basically it's same as version from strict-containers
. Only differences are strict fromArray
& fromMutableArray
, added lazyFromArray
and haddocks.
I also switched examples in D.V.Generic to strict vectors but that's purely documentation change
@Bodigrim switching to a newtype worked out quite well and allowed to drop a lot of duplicated code. It doesn't work all that well for instances since DerivingStrategies are only available since 8.2. So it's not possible to instruct GHC to derive say Ord
.
I also added function for conversion between strict and lazy vectors.
I removed function that don't enforce strictness: lazyFromLazy
, etc.
I'm going to merge this PR on next weekend if there are no objections
Fixes #483 and #380
Implementation follows discussion in issues above and virtually identical to one in
strict-containers
. Only differencefromArray
andunsafeFromArraySlice
now force all elements of returned vector to WHNF. It changes complexity to O(n) so to compensatelazyFromArray
andunsafeLazyFromArraySlice
are added, they retain O(1) complexity but user has to deal with strictness.This is draft since there's still some work to do with documentation.
V.
is used by lazy vector,VS
by storable. One option@since 0.13.2.0
on each function inStrict
modulesAlso