1## Changes in version 0.7.1.0 2 3 * Introduce convenience class `MonadPrim` and `MonadPrimBase`. 4 5 * Add `PrimMonad` and `PrimBase` instances for `Lazy.ST` (GHC >= 8.2). 6 thanks to Avi Dessauer (@Avi-D-coder) for this first contribution 7 8 * Add `freezeByteArray` and `freezePrimArray`. 9 10 * Add `compareByteArrays`. 11 12 * Add `shrinkMutableByteArray`. 13 14 * Add `Eq` instances for `MutableByteArray` and `MutablePrimArray`. 15 by Andrew Martin 16 17 * Add functions for manipulating pinned Prim Arrays 18 by Andrew Martin 19 20 * Add `copyPtrToMutableByteArray`. 21 22 * Add `NFData` instances for `ByteArray`, `MutableByteArray`, 23 `PrimArray` and `MutablePrimArray`. 24 by Callan McGill 25 26 * Add `shrinkSmallMutableArray`. 27 28 * Add `clonePrimArray` and `cloneMutablePrimArray`. 29 30 * Add `cloneMutableByteArray` and `cloneByteArray`. 31 32 * Add `Prim` instances for `WordPtr` and `IntPtr`. 33 34 * Add `NFData` instances for `Array` and `SmallArray`. 35 by Callan McGill 36 37 * Add `copyByteArrayToPtr` and `copyMutableByteArrayToPtr`. 38 39 * Export `arrayFromList` and `arrayFromListN`. 40 41## Changes in version 0.7.0.1 42 43 * Allow building with GHC 8.12. 44 Thanks Ryan GL Scott for this and every compat patch over time. 45 46## Changes in version 0.7.0.0 47 48 * Remove `Addr` data type, lifted code should use `Ptr a` now 49 50 * Define `MonadFail` instances for `Array` and `SmallArray`. 51 52 * Define `unsafeInterleave`. 53 54 * Add a `Prim` instance for `StablePtr` 55 56 * Remove `UnliftedArray` and related type classes 57 58 * Add a lot more tests for `PrimArray`. 59 60 * Added PrimMonad instance for CPS Writer and RWS monads from Transformers 61 62 * Remove useless accidental laziness in `atomicModifyMutVar`, making it match 63 `atomicModifyIORef`. The semantics should be the same. 64 65 * lots of little documentation twiddles. 66 67## Changes in version 0.6.4.1 68 69 * Add instances for the following newtypes from `base`: 70 `Const`, `Identity`, `Down`, `Dual`, `Sum`, `Product`, 71 `First`, `Last`, `Min`, `Max` 72 73 * Add `base-orphans` dependency to test suite to accomodate 74 older versions of GHC not having instances of `Show` and `Eq` 75 for some of the above newtypes. 76 77## Changes in version 0.6.4.0 78 79 * Introduce `Data.Primitive.PrimArray`, which offers types and function 80 for dealing with a `ByteArray` tagged with a phantom type variable for 81 tracking the element type. 82 83 * Implement `isByteArrayPinned` and `isMutableByteArrayPinned`. 84 85 * Add `Eq1`, `Ord1`, `Show1`, and `Read1` instances for `Array` and 86 `SmallArray`. 87 88 * Improve the test suite. This includes having property tests for 89 typeclasses from `base` such as `Eq`, `Ord`, `Functor`, `Applicative`, 90 `Monad`, `IsList`, `Monoid`, `Foldable`, and `Traversable`. 91 92 * Fix the broken `IsList` instance for `ByteArray`. The old definition 93 would allocate a byte array of the correct size and then leave the 94 memory unitialized instead of writing the list elements to it. 95 96 * Fix the broken `Functor` instance for `Array`. The old definition 97 would allocate an array of the correct size with thunks for erroring 98 installed at every index. It failed to replace these thunks with 99 the result of the function applied to the elements of the argument array. 100 101 * Fix the broken `Applicative` instances of `Array` and `SmallArray`. 102 The old implementation of `<*>` for `Array` failed to initialize 103 some elements but correctly initialized others in the resulting 104 `Array`. It is unclear what the old behavior of `<*>` was for 105 `SmallArray`, but it was incorrect. 106 107 * Fix the broken `Monad` instances for `Array` and `SmallArray`. 108 109 * Fix the implementation of `foldl1` in the `Foldable` instances for 110 `Array` and `SmallArray`. In both cases, the old implementation 111 simply returned the first element of the array and made no use of 112 the other elements in the array. 113 114 * Fix the implementation of `mconcat` in the `Monoid` instance for 115 `SmallArray`. 116 117 * Implement `Data.Primitive.Ptr`, implementations of `Ptr` functions 118 that require a `Prim` constraint instead of a `Storable` constraint. 119 120 121 * Add `PrimUnlifted` instances for `TVar` and `MVar`. 122 123 * Use `compareByteArrays#` for the `Eq` and `Ord` instances of 124 `ByteArray` when building with GHC 8.4 and newer. 125 126 * Add `Prim` instances for lots of types in `Foreign.C.Types` and 127 `System.Posix.Types`. 128 129 * Reexport `Data.Primitive.SmallArray` and `Data.Primitive.UnliftedArray` 130 from `Data.Primitive`. 131 132 * Add fold functions and map function to `Data.Primitive.UnliftedArray`. 133 Add typeclass instances for `IsList`, `Ord`, and `Show`. 134 135 * Add `defaultSetByteArray#` and `defaultSetOffAddr#` to 136 `Data.Primitive.Types`. 137 138 * Add `Data.Primitive.MVar`, a replacement for `Control.Concurrent.MVar` 139 that can run in any `PrimMonad` instead of just `IO`. It is not a full 140 replacement. Notably, it's missing masking functions and support for 141 adding finalizers. 142 143## Changes in version 0.6.3.0 144 145 * Add `PrimMonad` instances for `ContT`, `AccumT`, and `SelectT` from 146 `transformers` 147 148 * Add `Eq`, `Ord`, `Show`, and `IsList` instances for `ByteArray` 149 150 * Add `Semigroup` instances for `Array` and `SmallArray`. This allows 151 `primitive` to build on GHC 8.4 and later. 152 153## Changes in version 0.6.2.0 154 155 * Drop support for GHCs before 7.4 156 157 * `SmallArray` support 158 159 * `ArrayArray#` based support for more efficient arrays of unlifted pointer types 160 161 * Make `Array` and the like instances of various classes for convenient use 162 163 * Add `Prim` instances for Ptr and FunPtr 164 165 * Add `ioToPrim`, `stToPrim` and unsafe counterparts for situations that would 166 otherwise require type ascriptions on `primToPrim` 167 168 * Add `evalPrim` 169 170 * Add `PrimBase` instance for `IdentityT` 171 172## Changes in version 0.6.1.0 173 174 * Use more appropriate types in internal memset functions, which prevents 175 overflows/segfaults on 64-bit systems. 176 177 * Fixed a warning on GHC 7.10 178 179 * Worked around a -dcore-lint bug in GHC 7.6/7.7 180 181## Changes in version 0.6 182 183 * Split PrimMonad into two classes to allow automatic lifting of primitive 184 operations into monad transformers. The `internal` operation has moved to the 185 `PrimBase` class. 186 187 * Fixed the test suite on older GHCs 188 189## Changes in version 0.5.4.0 190 191 * Changed primitive_ to work around an oddity with GHC's code generation 192 on certain versions that led to side effects not happening when used 193 in conjunction with certain very unsafe IO performers. 194 195 * Allow primitive to build on GHC 7.9 196 197## Changes in version 0.5.3.0 198 199 * Implement `cloneArray` and `cloneMutableArray` primitives 200 (with fall-back implementations for GHCs prior to version 7.2.1) 201 202## Changes in version 0.5.2.1 203 204 * Add strict variants of `MutVar` modification functions 205 `atomicModifyMutVar'` and `modifyMutVar'` 206 207 * Fix compilation on Solaris 10 with GNU C 3.4.3 208 209## Changes in version 0.5.1.0 210 211 * Add support for GHC 7.7's new primitive `Bool` representation 212 213## Changes in version 0.5.0.1 214 215 * Disable array copying primitives for GHC 7.6.* and earlier 216 217## Changes in version 0.5 218 219 * New in `Data.Primitive.MutVar`: `atomicModifyMutVar` 220 221 * Efficient block fill operations: `setByteArray`, `setAddr` 222 223## Changes in version 0.4.1 224 225 * New module `Data.Primitive.MutVar` 226 227## Changes in version 0.4.0.1 228 229 * Critical bug fix in `fillByteArray` 230 231## Changes in version 0.4 232 233 * Support for GHC 7.2 array copying primitives 234 235 * New in `Data.Primitive.ByteArray`: `copyByteArray`, 236 `copyMutableByteArray`, `moveByteArray`, `fillByteArray` 237 238 * Deprecated in `Data.Primitive.ByteArray`: `memcpyByteArray`, 239 `memcpyByteArray'`, `memmoveByteArray`, `memsetByteArray` 240 241 * New in `Data.Primitive.Array`: `copyArray`, `copyMutableByteArray` 242 243 * New in `Data.Primitive.Addr`: `copyAddr`, `moveAddr` 244 245 * Deprecated in `Data.Primitive.Addr`: `memcpyAddr` 246