@@ -96,9 +96,9 @@ module Streamly.Internal.Data.Array.Unboxed.Mut.Type
9696 -- * Eliminating and Reading
9797
9898 -- ** To streams
99− , read
100− , readRevWith
101− , readRev
99+ , reader
100+ , readerRevWith
101+ , readerRev
102102
103103 -- ** To containers
104104 , toStreamDWith
@@ -1088,7 +1088,7 @@ getSlice index len (Array contents start e _) =
10881088-- XXX consider the bulk update/accumulation/permutation APIs from vector.
10891089
10901090-- | You may not need to reverse an array because you can consume it in reverse
1091−-- using 'readRev'. To reverse large arrays you can read in reverse and write
1091+-- using 'readerRev'. To reverse large arrays you can read in reverse and write
10921092-- to another array. However, in-place reverse can be useful to take adavantage
10931093-- of cache locality and when you do not want to allocate additional memory.
10941094--
@@ -1350,9 +1350,9 @@ data FlattenState s contents a =
13501350 OuterLoop s
13511351 | InnerLoop s contents !Int !Int
13521352
1353−-- | Use the "read" unfold instead.
1353+-- | Use the "reader" unfold instead.
13541354--
1355−-- @flattenArrays = unfoldMany read@
1355+-- @flattenArrays = unfoldMany reader@
13561356--
13571357-- We can try this if there are any fusion issues in the unfold.
13581358--
@@ -1379,9 +1379,9 @@ flattenArrays (D.Stream step state) = D.Stream step' (OuterLoop state)
13791379 x <- liftIO $ peekWith contents p
13801380 return $ D.Yield x (InnerLoop st contents (INDEX_NEXT(p,a)) end)
13811381
1382−-- | Use the "readRev" unfold instead.
1382+-- | Use the "readerRev" unfold instead.
13831383--
1384−-- @flattenArrays = unfoldMany readRev@
1384+-- @flattenArrays = unfoldMany readerRev@
13851385--
13861386-- We can try this if there are any fusion issues in the unfold.
13871387--
@@ -1459,15 +1459,15 @@ producer = producerWith liftIO
14591459-- | Unfold an array into a stream.
14601460--
14611461-- @since 0.7.0
1462−{-# INLINE_NORMAL read #-}
1463−read :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1464−read = Producer.simplify producer
1462+{-# INLINE_NORMAL reader #-}
1463+reader :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1464+reader = Producer.simplify producer
14651465
1466−{-# INLINE_NORMAL readRevWith #-}
1467−readRevWith ::
1466+{-# INLINE_NORMAL readerRevWith #-}
1467+readerRevWith ::
14681468 forall m a. (Monad m, Unboxed a)
14691469 => (forall b. IO b -> m b) -> Unfold m (Array a) a
1470−readRevWith liftio = Unfold step inject
1470+readerRevWith liftio = Unfold step inject
14711471 where
14721472
14731473 inject (Array contents start end _) =
@@ -1483,9 +1483,9 @@ readRevWith liftio = Unfold step inject
14831483-- | Unfold an array into a stream in reverse order.
14841484--
14851485-- /Pre-release/
1486−{-# INLINE_NORMAL readRev #-}
1487−readRev :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1488−readRev = readRevWith liftIO
1486+{-# INLINE_NORMAL readerRev #-}
1487+readerRev :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1488+readerRev = readerRevWith liftIO
14891489
14901490-------------------------------------------------------------------------------
14911491-- to Lists and streams
@@ -1543,9 +1543,9 @@ toStreamDWith liftio Array{..} = D.Stream step arrStart
15431543 r <- peekWith arrContents p
15441544 return $ D.Yield r (INDEX_NEXT(p,a))
15451545
1546−-- | Use the 'read' unfold instead.
1546+-- | Use the 'reader' unfold instead.
15471547--
1548−-- @toStreamD = D.unfold read@
1548+-- @toStreamD = D.unfold reader@
15491549--
15501550-- We can try this if the unfold has any performance issues.
15511551{-# INLINE_NORMAL toStreamD #-}
@@ -1585,9 +1585,9 @@ toStreamDRevWith liftio Array{..} =
15851585 r <- peekWith arrContents p
15861586 return $ D.Yield r (INDEX_PREV(p,a))
15871587
1588−-- | Use the 'readRev' unfold instead.
1588+-- | Use the 'readerRev' unfold instead.
15891589--
1590−-- @toStreamDRev = D.unfold readRev@
1590+-- @toStreamDRev = D.unfold readerRev@
15911591--
15921592-- We can try this if the unfold has any perf issues.
15931593{-# INLINE_NORMAL toStreamDRev #-}
@@ -1970,7 +1970,7 @@ fromArrayStreamK :: (Unboxed a, MonadIO m) =>
19701970 K.Stream m (Array a) -> m (Array a)
19711971fromArrayStreamK as = do
19721972 len <- arrayStreamKLength as
1973− fromStreamDN len $ D.unfoldMany read $ D.fromStreamK as
1973+ fromStreamDN len $ D.unfoldMany reader $ D.fromStreamK as
19741974
19751975-- CAUTION: a very large number (millions) of arrays can degrade performance
19761976-- due to GC overhead because we need to buffer the arrays before we flatten