Releases: haskell/primitive
v0.9.1.0
Changes in version 0.9.1.0
-
Make fromListN functions good consumers for list fusion.
-
Add functions to improve
MutVar's interoperability withIORefandSTRef. -
Add
createPrimArrayandcreateByteArray. -
Add
byteArrayAsForeignPtrandmutableByteArrayAsForeignPtr. -
Use
copyMutableByteArrayNonOverlapping#in the implementation ofcopyMutableByteArray
on sufficiently new GHCs. This does not change the contract forcopyMutableByteArray.
This function has always been documented as having undefined behavior when the slices
overlap. However, overlaps previously were handled gracefully (with the semantics
of C'smemmove). Going forward, users who do not upholdcopyMutableByteArray's
precondition will be met with unpredictable results. -
Drop support for GHC 8.0.
v0.9.0.0
Changes in version 0.9.0.0
-
Add
withByteArrayContents,withMutableByteArrayContents,
withPrimArrayContents,withMutablePrimArrayContents. -
Fix signature of
keepAlive. -
Remove re-export of
fromListandfromListNfromData.Primitive.Array. -
Use
mutableByteArrayContents#in GHC 9.2+ -
Add
Priminstance forComplex. -
Add
getSizeofSmallMutableArraythat wrapsgetSizeofSmallMutableArray#
fromGHC.Exts. -
Add default definitions for the
setByteArray#andsetOffAddr#methods,
so they don't need to be defined explicitly anymore. -
Add standalone
sizeOfType/alignmentOfType(recommended oversizeOf/alignment)
andPrimclass methodssizeOfType#/alignmentOfType#(recommended oversizeOf#/alignment#) -
Change
Showinstances ofPrimArray,Array, andSmallArray. These
previously used thefromListN n [...]form, but they now used the more
terse[...]form. -
Correct the
Readinstances ofArrayandSmallArray. These instances
are supposed to be able to handle all three of these forms:fromList [...],
fromListN n [...], and[...]. They had been rejected the last form, but
this mistake was discovered by the test suite when the Show instances were
changed.
v0.8.0.0
Changes in version 0.8.0.0
-
Add
resizeSmallMutableArraythat wrapsresizeSmallMutableArray#from
GHC.Exts. -
New module
Data.Primitive.PrimVar. This is essentiallyPrimArraywith
element length 1. For types withPriminstances, this is a drop-in
replacement forMutVarwith fewer indirections. -
PrimArray's type argument has been given a nominal role instead of a phantom role.
This is a breaking change. -
Add
readCharArray,writeCharArray,indexCharArrayfor operating on
8-bit characters in a byte array. -
When building with
base-4.17and newer, re-export theByteArrayand
MutableByteArraytypes frombaseinstead of defining them in this
library. This does not change the user-facing interface of
Data.Primitive.ByteArray. -
Add
keepAlivethat wrapskeepAlive#for GHC 9.2 and newer. It
falls back to usingtouchfor older GHCs.