Skip to content

Releases: haskell/primitive

v0.9.1.0

26 Feb 14:53
8ef2945

Choose a tag to compare

Changes in version 0.9.1.0

  • Make fromListN functions good consumers for list fusion.

  • Add functions to improve MutVar's interoperability with IORef and STRef.

  • Add createPrimArray and createByteArray.

  • Add byteArrayAsForeignPtr and mutableByteArrayAsForeignPtr.

  • Use copyMutableByteArrayNonOverlapping# in the implementation of copyMutableByteArray
    on sufficiently new GHCs. This does not change the contract for copyMutableByteArray.
    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's memmove). Going forward, users who do not uphold copyMutableByteArray's
    precondition will be met with unpredictable results.

  • Drop support for GHC 8.0.

v0.9.0.0

26 Feb 14:50
0b64fae

Choose a tag to compare

Changes in version 0.9.0.0

  • Add withByteArrayContents, withMutableByteArrayContents,
    withPrimArrayContents, withMutablePrimArrayContents.

  • Fix signature of keepAlive.

  • Remove re-export of fromList and fromListN from Data.Primitive.Array.

  • Use mutableByteArrayContents# in GHC 9.2+

  • Add Prim instance for Complex.

  • Add getSizeofSmallMutableArray that wraps getSizeofSmallMutableArray#
    from GHC.Exts.

  • Add default definitions for the setByteArray# and setOffAddr# methods,
    so they don't need to be defined explicitly anymore.

  • Add standalone sizeOfType/alignmentOfType (recommended over sizeOf/alignment)
    and Prim class methods sizeOfType#/alignmentOfType# (recommended over sizeOf#/alignment#)

  • Change Show instances of PrimArray, Array, and SmallArray. These
    previously used the fromListN n [...] form, but they now used the more
    terse [...] form.

  • Correct the Read instances of Array and SmallArray. 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

20 Feb 16:21

Choose a tag to compare

Changes in version 0.8.0.0

  • Add resizeSmallMutableArray that wraps resizeSmallMutableArray# from
    GHC.Exts.

  • New module Data.Primitive.PrimVar. This is essentially PrimArray with
    element length 1. For types with Prim instances, this is a drop-in
    replacement for MutVar with 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, indexCharArray for operating on
    8-bit characters in a byte array.

  • When building with base-4.17 and newer, re-export the ByteArray and
    MutableByteArray types from base instead of defining them in this
    library. This does not change the user-facing interface of
    Data.Primitive.ByteArray.

  • Add keepAlive that wraps keepAlive# for GHC 9.2 and newer. It
    falls back to using touch for older GHCs.

v0.6.3.0

22 Jan 03:37

Choose a tag to compare

  • Add PrimMonad instances for ContT, AccumT, and SelectT from
    transformers

  • Add Eq, Ord, Show, and IsList instances for ByteArray

  • Add Semigroup instances for Array and SmallArray. This allows
    primitive to build on GHC 8.4 and later.

v0.6.1.0

20 Sep 16:43

Choose a tag to compare

  • Use more appropriate types in internal memset functions, which prevents
    overflows/segfaults on 64-bit systems.
  • Fixed a warning on GHC 7.10
  • Worked around a -dcore-lint bug in GHC 7.6/7.7