@@ -82,8 +82,8 @@ module Streamly.Internal.Data.Array.Foreign.Mut.Type
8282 , toList
8383
8484 -- * Combining
85− , spliceWith
86− , spliceWithDoubling
85+ , splice
86+ , spliceExp
8787 , spliceTwo
8888
8989 -- * Splitting
@@ -1103,14 +1103,14 @@ spliceTwo arr1 arr2 = do
11031103-- | Splice an array into a pre-reserved mutable array. The user must ensure
11041104-- that there is enough space in the mutable array, otherwise the splicing
11051105-- fails.
1106−{-# INLINE spliceWith #-}
1107−spliceWith :: (MonadIO m) => Array a -> Array a -> m (Array a)
1108−spliceWith dst@(Array _ end bound) src =
1106+{-# INLINE splice #-}
1107+splice :: (MonadIO m) => Array a -> Array a -> m (Array a)
1108+splice dst@(Array _ end bound) src =
11091109 liftIO $ do
11101110 let srcLen = byteLength src
11111111 if end `plusPtr` srcLen > bound
11121112 then error
1113− "Bug: spliceWith: Not enough space in the target array"
1113+ "Bug: splice: Not enough space in the target array"
11141114 else unsafeWithForeignPtr (aStart dst) $ \_ ->
11151115 unsafeWithForeignPtr (aStart src) $ \psrc -> do
11161116 let pdst = aEnd dst
@@ -1119,10 +1119,10 @@ spliceWith dst@(Array _ end bound) src =
11191119
11201120-- | Splice a new array into a preallocated mutable array, doubling the space
11211121-- if there is no space in the target array.
1122−{-# INLINE spliceWithDoubling #-}
1123−spliceWithDoubling :: (MonadIO m, Storable a)
1122+{-# INLINE spliceExp #-}
1123+spliceExp :: (MonadIO m, Storable a)
11241124 => Array a -> Array a -> m (Array a)
1125−spliceWithDoubling dst@(Array start end bound) src = do
1125+spliceExp dst@(Array start end bound) src = do
11261126 assert (end <= bound) (return ())
11271127 let srcLen = aEnd src `minusPtr` unsafeForeignPtrToPtr (aStart src)
11281128
@@ -1134,12 +1134,12 @@ spliceWithDoubling dst@(Array start end bound) src = do
11341134 newSize = max (oldSize * 2) (oldSize + srcLen)
11351135 when (newSize < oldSize + srcLen)
11361136 $ error
1137− $ "spliceWith: newSize is less than the total size "
1137+ $ "splice: newSize is less than the total size "
11381138 ++ "of arrays being appended. Please check the "
11391139 ++ "newSize function passed."
11401140 liftIO $ realloc newSize dst
11411141 else return dst
1142− spliceWith dst1 src
1142+ splice dst1 src
11431143
11441144-------------------------------------------------------------------------------
11451145-- Splitting