@@ -37,10 +37,10 @@ module Streamly.Internal.Data.Array.Foreign.Mut.Type
37 , byteCapacity
37 , byteCapacity
39 -- * Random access
39 -- * Random access
40− , unsafeIndex
40+ , getIndexUnsafe
42 -- * Mutation
42 -- * Mutation
43− , unsafeWriteIndex
43+ , putIndexUnsafe
44 , snocUnsafe
44 , snocUnsafe
@@ -317,10 +317,10 @@ unsafeWithNewArray count f = do
317-- Mutation
317-- Mutation
318-------------------------------------------------------------------------------
318-------------------------------------------------------------------------------
320−{-# INLINE unsafeWriteIndex #-}
320+{-# INLINE putIndexUnsafe #-}
321−unsafeWriteIndex :: forall m a. (MonadIO m, Storable a)
321+putIndexUnsafe :: forall m a. (MonadIO m, Storable a)
322 => Array a -> Int -> a -> m ()
322 => Array a -> Int -> a -> m ()
323−unsafeWriteIndex Array {..} i x =
323+putIndexUnsafe Array {..} i x =
324 unsafeWithForeignPtrM aStart
324 unsafeWithForeignPtrM aStart
325 $ \begin -> do
325 $ \begin -> do
326 liftIO $ poke (begin `plusPtr` (i * sizeOf (undefined :: a))) x
326 liftIO $ poke (begin `plusPtr` (i * sizeOf (undefined :: a))) x
@@ -418,9 +418,9 @@ shrinkToFit arr@Array{..} = do
418-- | Return the element at the specified index without checking the bounds.
418-- | Return the element at the specified index without checking the bounds.
420-- Unsafe because it does not check the bounds of the array.
420-- Unsafe because it does not check the bounds of the array.
421−{-# INLINE_NORMAL unsafeIndex #-}
421+{-# INLINE_NORMAL getIndexUnsafe #-}
422−unsafeIndex :: forall m a. (MonadIO m, Storable a) => Array a -> Int -> m a
422+getIndexUnsafe :: forall m a. (MonadIO m, Storable a) => Array a -> Int -> m a
423−unsafeIndex Array {..} i =
423+getIndexUnsafe Array {..} i =
424 unsafeWithForeignPtrM aStart $ \p -> do
424 unsafeWithForeignPtrM aStart $ \p -> do
425 let elemSize = sizeOf (undefined :: a)
425 let elemSize = sizeOf (undefined :: a)
426 elemOff = p `plusPtr` (elemSize * i)
426 elemOff = p `plusPtr` (elemSize * i)