@@ -80,6 +80,8 @@ new (I# len#)
80
80
{-# INLINE new #-}
81
81
82
82
-- | Create an uninitialized mutable pinned array.
83
+ --
84
+ -- @since 2.0
83
85
newPinned :: forall s . Int -> ST s (MArray s )
84
86
newPinned (I # len# )
85
87
#if defined(ASSERTS)
@@ -90,13 +92,15 @@ newPinned (I# len#)
90
92
(# s2# , marr# # ) -> (# s2# , MutableByteArray marr# # )
91
93
{-# INLINE newPinned #-}
92
94
95
+ -- | @since 2.0
93
96
newFilled :: Int -> Int -> ST s (MArray s )
94
97
newFilled (I # len# ) (I # c# ) = ST $ \ s1# ->
95
98
case newByteArray# len# s1# of
96
99
(# s2# , marr# # ) -> case setByteArray# marr# 0 # len# c# s2# of
97
100
s3# -> (# s3# , MutableByteArray marr# # )
98
101
{-# INLINE newFilled #-}
99
102
103
+ -- | @since 2.0
100
104
tile :: MArray s -> Int -> ST s ()
101
105
tile marr tileLen = do
102
106
totalLen <- getSizeofMArray marr
@@ -130,8 +134,10 @@ unsafeIndex (ByteArray arr) i@(I# i#) =
130
134
case indexWord8Array# arr i# of r# -> (W8 # r# )
131
135
{-# INLINE unsafeIndex #-}
132
136
133
- -- sizeofMutableByteArray# is deprecated, because it is unsafe in the presence of
134
- -- shrinkMutableByteArray# and resizeMutableByteArray#.
137
+ -- | 'sizeofMutableByteArray#' is deprecated, because it is unsafe in the presence of
138
+ -- 'shrinkMutableByteArray#' and 'resizeMutableByteArray#'.
139
+ --
140
+ -- @since 2.0
135
141
getSizeofMArray :: MArray s -> ST s Int
136
142
getSizeofMArray (MutableByteArray marr) = ST $ \ s0# ->
137
143
case getSizeofMutableByteArray# marr s0# of
@@ -185,12 +191,14 @@ run2 k = runST (do
185
191
return (arr,b))
186
192
{-# INLINE run2 #-}
187
193
194
+ -- | @since 2.0
188
195
resizeM :: MArray s -> Int -> ST s (MArray s )
189
196
resizeM (MutableByteArray ma) i@ (I # i# ) = ST $ \ s1# ->
190
197
case resizeMutableByteArray# ma i# s1# of
191
198
(# s2# , newArr # ) -> (# s2# , MutableByteArray newArr # )
192
199
{-# INLINE resizeM #-}
193
200
201
+ -- | @since 2.0
194
202
shrinkM ::
195
203
#if defined(ASSERTS)
196
204
HasCallStack =>
@@ -253,6 +261,8 @@ copyI count@(I# count#) (MutableByteArray dst#) dstOff@(I# dstOff#) (ByteArray s
253
261
{-# INLINE copyI #-}
254
262
255
263
-- | Copy from pointer.
264
+ --
265
+ -- @since 2.0
256
266
copyFromPointer
257
267
:: MArray s -- ^ Destination
258
268
-> Int -- ^ Destination offset
@@ -270,6 +280,8 @@ copyFromPointer (MutableByteArray dst#) dstOff@(I# dstOff#) (Ptr src#) count@(I#
270
280
{-# INLINE copyFromPointer #-}
271
281
272
282
-- | Copy to pointer.
283
+ --
284
+ -- @since 2.0
273
285
copyToPointer
274
286
:: Array -- ^ Source
275
287
-> Int -- ^ Source offset
@@ -293,6 +305,8 @@ equal src1 off1 src2 off2 count = compareInternal src1 off1 src2 off2 count == 0
293
305
{-# INLINE equal #-}
294
306
295
307
-- | Compare portions of two arrays. No bounds checking is performed.
308
+ --
309
+ -- @since 2.0
296
310
compare :: Array -> Int -> Array -> Int -> Int -> Ordering
297
311
compare src1 off1 src2 off2 count = compareInternal src1 off1 src2 off2 count `Prelude.compare` 0
298
312
{-# INLINE compare #-}
0 commit comments