@@ -138,10 +138,10 @@ import qualified GHC.Exts as Exts
138
138
import Data.Primitive.Internal.Operations (mutableByteArrayContentsShim )
139
139
140
140
-- | Arrays of unboxed elements. This accepts types like 'Double', 'Char',
141
- -- 'Int' and 'Word', as well as their fixed-length variants ('Word8',
142
- -- 'Word16', etc.). Since the elements are unboxed, a 'PrimArray' is strict
143
- -- in its elements. This differs from the behavior of 'Data.Primitive.Array.Array',
144
- -- which is lazy in its elements.
141
+ -- 'Int' and 'Word', as well as their fixed-length variants ('Data.Word. Word8',
142
+ -- 'Data.Word. Word16', etc.). Since the elements are unboxed, a 'PrimArray' is
143
+ -- strict in its elements. This differs from the behavior of
144
+ -- 'Data.Primitive.Array.Array', which is lazy in its elements.
145
145
data PrimArray a = PrimArray ByteArray #
146
146
147
147
type role PrimArray nominal
@@ -391,7 +391,7 @@ copyPrimArray (MutablePrimArray dst#) (I# doff#) (PrimArray src#) (I# soff#) (I#
391
391
-- | Copy a slice of an immutable primitive array to a pointer.
392
392
-- The offset and length are given in elements of type @a@.
393
393
-- This function assumes that the 'Prim' instance of @a@
394
- -- agrees with the 'Storable' instance.
394
+ -- agrees with the 'Foreign.Storable. Storable' instance.
395
395
--
396
396
-- /Note:/ this function does not do bounds or overlap checking.
397
397
copyPrimArrayToPtr :: forall m a . (PrimMonad m , Prim a )
@@ -410,7 +410,7 @@ copyPrimArrayToPtr (Ptr addr#) (PrimArray ba#) (I# soff#) (I# n#) =
410
410
-- | Copy a slice of a mutable primitive array to a pointer.
411
411
-- The offset and length are given in elements of type @a@.
412
412
-- This function assumes that the 'Prim' instance of @a@
413
- -- agrees with the 'Storable' instance.
413
+ -- agrees with the 'Foreign.Storable. Storable' instance.
414
414
--
415
415
-- /Note:/ this function does not do bounds or overlap checking.
416
416
copyMutablePrimArrayToPtr :: forall m a . (PrimMonad m , Prim a )
@@ -429,7 +429,7 @@ copyMutablePrimArrayToPtr (Ptr addr#) (MutablePrimArray mba#) (I# soff#) (I# n#)
429
429
-- | Copy from a pointer to a mutable primitive array.
430
430
-- The offset and length are given in elements of type @a@.
431
431
-- This function assumes that the 'Prim' instance of @a@
432
- -- agrees with the 'Storable' instance.
432
+ -- agrees with the 'Foreign.Storable. Storable' instance.
433
433
--
434
434
-- /Note:/ this function does not do bounds or overlap checking.
435
435
copyPtrToMutablePrimArray :: forall m a . (PrimMonad m , Prim a )
@@ -1095,17 +1095,19 @@ newAlignedPinnedPrimArray (I# n#)
1095
1095
(# s'# , arr# # ) -> (# s'# , MutablePrimArray arr# # ))
1096
1096
1097
1097
-- | Yield a pointer to the array's data. This operation is only safe on
1098
- -- /pinned/ prim arrays allocated by 'newPinnedByteArray' or
1099
- -- 'newAlignedPinnedByteArray'.
1098
+ -- /pinned/ prim arrays allocated by
1099
+ -- 'Data.Primitive.ByteArray.newPinnedByteArray' or
1100
+ -- 'Data.Primitive.ByteArray.newAlignedPinnedByteArray'.
1100
1101
--
1101
1102
-- @since 0.7.1.0
1102
1103
primArrayContents :: PrimArray a -> Ptr a
1103
1104
{-# INLINE primArrayContents #-}
1104
1105
primArrayContents (PrimArray arr# ) = Ptr (byteArrayContents# arr# )
1105
1106
1106
1107
-- | Yield a pointer to the array's data. This operation is only safe on
1107
- -- /pinned/ byte arrays allocated by 'newPinnedByteArray' or
1108
- -- 'newAlignedPinnedByteArray'.
1108
+ -- /pinned/ byte arrays allocated by
1109
+ -- 'Data.Primitive.ByteArray.newPinnedByteArray' or
1110
+ -- 'Data.Primitive.ByteArray.newAlignedPinnedByteArray'.
1109
1111
--
1110
1112
-- @since 0.7.1.0
1111
1113
mutablePrimArrayContents :: MutablePrimArray s a -> Ptr a
0 commit comments