I have make some comments on reddit, but still I want to record them here:After reading the new code, I got a feeling that there're some API lacking considerations. Here is some of my personal concerns:CheersWinter------------------ Original ------------------From: Carter Schonwald <carter.schonwald@gmail.com>Date: Thu,May 31,2018 2:55 AMTo: haskell-cafe <haskell-cafe@haskell.org>, Haskell Libraries <libraries@haskell.org>Subject: Re: [Haskell-cafe] ANN: primitive 0.6.4.0This is a pretty exciting (albeit minor version)I'd like to especially thank David Feuer (treeowl ) and Andrew Martin (andrewthad) for their contributionsthe change log has a huge number of bug fixes relative to 0.6.2-3also we added some new modules of featuresPrimArray --- unboxed nonsliceable vectorsMVar -- Mvars that run in any PrimMonadaugmented the Data.Primitive exports for increased consistency(the new .Ptr and .Mvar modules aren't exported in this minor version so users can easily migrate)Changes in version 0.6.4.0
Introduce
Data.Primitive.
, which offers types and function for dealing with aPrimArray ByteArray
tagged with a phantom type variable for tracking the element type.Implement
isByteArrayPinned
and isMutableByteArrayPinned
.Add
Eq1
,Ord1
,Show1
, andRead1
instances forArray
andSmallArray
.Improve the test suite. This includes having property tests for typeclasses from
base
such asEq
,Ord
,Functor
,Applicati
,ve Monad
,IsList
,Monoid
,Fol
, anddable Traversable
.Fix the broken
IsList
instance forByteArray
. The old definition would allocate a byte array of the correct size and then leave the memory unitialized instead of writing the list elements to it.Fix the broken
Functor
instance forArray
. The old definition would allocate an array of the correct size with thunks for erroring installed at every index. It failed to replace these thunks with the result of the function applied to the elements of the argument array.Fix the broken
Applicative
instances ofArray
andSmallArray
. The old implementation of<*>
forArray
failed to initialize some elements but correctly initialized others in the resultingArray
. It is unclear what the old behavior of<*>
was forSmallArray
, but it was incorrect.Fix the broken
Monad
instances forArray
andSmallArray
.Fix the implementation of
foldl1
in theFoldable
instances forArray
andSmallArray
. In both cases, the old implementation simply returned the first element of the array and made no use of the other elements in the array.Fix the implementation of
mconcat
in theMonoid
instance forSmallArray
.Implement
Data.Primitive.Ptr
, implementations ofPtr
functions that require aPrim
constraint instead of aStorable
constraint.Add
PrimUnlifted
instances forTVar
andMVar
.Use
compareByteArrays#
for theEq
andOrd
instances ofByteArray
when building with GHC 8.4 and newer.Add
Prim
instances for lots of types inForeign.C.Types
andSystem.
.Posix.Types Reexport
Data.Primitive.
andSmallArray Data.Primitive.
fromUnliftedArray Data.
.Primitive Add fold functions and map function to
Data.Primitive.
. Add typeclass instances forUnliftedArray IsList
,Ord
, andShow
.Add
defaultSetByteArray#
andd
toefaultSetOffAddr# Data.
.Primitive.Types