@@ -96,9 +96,9 @@ module Streamly.Internal.Data.Array.Unboxed.Mut.Type
96 -- * Eliminating and Reading
96 -- * Eliminating and Reading
98 -- ** To streams
98 -- ** To streams
100− , readRevWith
100+ , readerRevWith
101− , readRev
101+ , readerRev
103 -- ** To containers
103 -- ** To containers
104 , toStreamDWith
104 , toStreamDWith
@@ -1088,7 +1088,7 @@ getSlice index len (Array contents start e _) =
1088-- XXX consider the bulk update/accumulation/permutation APIs from vector.
1088-- XXX consider the bulk update/accumulation/permutation APIs from vector.
1090-- | You may not need to reverse an array because you can consume it in reverse
1090-- | 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
1092-- to another array. However, in-place reverse can be useful to take adavantage
1092-- to another array. However, in-place reverse can be useful to take adavantage
1093-- of cache locality and when you do not want to allocate additional memory.
1093-- of cache locality and when you do not want to allocate additional memory.
@@ -1350,9 +1350,9 @@ data FlattenState s contents a =
1350 OuterLoop s
1350 OuterLoop s
1351 | InnerLoop s contents !Int !Int
1351 | InnerLoop s contents !Int !Int
1353−-- | Use the "read" unfold instead.
1353+-- | Use the "reader" unfold instead.
1355−-- @flattenArrays = unfoldMany read@
1355+-- @flattenArrays = unfoldMany reader@
1357-- We can try this if there are any fusion issues in the unfold.
1357-- We can try this if there are any fusion issues in the unfold.
@@ -1379,9 +1379,9 @@ flattenArrays (D.Stream step state) = D.Stream step' (OuterLoop state)
1379 x <- liftIO $ peekWith contents p
1379 x <- liftIO $ peekWith contents p
1380 return $ D.Yield x (InnerLoop st contents (INDEX_NEXT(p,a)) end)
1380 return $ D.Yield x (InnerLoop st contents (INDEX_NEXT(p,a)) end)
1382−-- | Use the "readRev" unfold instead.
1382+-- | Use the "readerRev" unfold instead.
1384−-- @flattenArrays = unfoldMany readRev@
1384+-- @flattenArrays = unfoldMany readerRev@
1386-- We can try this if there are any fusion issues in the unfold.
1386-- We can try this if there are any fusion issues in the unfold.
@@ -1459,15 +1459,15 @@ producer = producerWith liftIO
1459-- | Unfold an array into a stream.
1459-- | Unfold an array into a stream.
1461-- @since 0.7.0
1461-- @since 0.7.0
1462−{-# INLINE_NORMAL read #-}
1462+{-# INLINE_NORMAL reader #-}
1463−read :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1463+reader :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1464−read = Producer.simplify producer
1464+reader = Producer.simplify producer
1466−{-# INLINE_NORMAL readRevWith #-}
1466+{-# INLINE_NORMAL readerRevWith #-}
1467−readRevWith ::
1467+readerRevWith ::
1468 forall m a. (Monad m, Unboxed a)
1468 forall m a. (Monad m, Unboxed a)
1469 => (forall b. IO b -> m b) -> Unfold m (Array a) a
1469 => (forall b. IO b -> m b) -> Unfold m (Array a) a
1470−readRevWith liftio = Unfold step inject
1470+readerRevWith liftio = Unfold step inject
1473 inject (Array contents start end _) =
1473 inject (Array contents start end _) =
@@ -1483,9 +1483,9 @@ readRevWith liftio = Unfold step inject
1483-- | Unfold an array into a stream in reverse order.
1483-- | Unfold an array into a stream in reverse order.
1485-- /Pre-release/
1485-- /Pre-release/
1486−{-# INLINE_NORMAL readRev #-}
1486+{-# INLINE_NORMAL readerRev #-}
1487−readRev :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1487+readerRev :: forall m a. (MonadIO m, Unboxed a) => Unfold m (Array a) a
1488−readRev = readRevWith liftIO
1488+readerRev = readerRevWith liftIO
1490-------------------------------------------------------------------------------
1490-------------------------------------------------------------------------------
1491-- to Lists and streams
1491-- to Lists and streams
@@ -1543,9 +1543,9 @@ toStreamDWith liftio Array{..} = D.Stream step arrStart
1543 r <- peekWith arrContents p
1543 r <- peekWith arrContents p
1544 return $ D.Yield r (INDEX_NEXT(p,a))
1544 return $ D.Yield r (INDEX_NEXT(p,a))
1546−-- | Use the 'read' unfold instead.
1546+-- | Use the 'reader' unfold instead.
1548−-- @toStreamD = D.unfold read@
1548+-- @toStreamD = D.unfold reader@
1550-- We can try this if the unfold has any performance issues.
1550-- We can try this if the unfold has any performance issues.
1551{-# INLINE_NORMAL toStreamD #-}
1551{-# INLINE_NORMAL toStreamD #-}
@@ -1585,9 +1585,9 @@ toStreamDRevWith liftio Array{..} =
1585 r <- peekWith arrContents p
1585 r <- peekWith arrContents p
1586 return $ D.Yield r (INDEX_PREV(p,a))
1586 return $ D.Yield r (INDEX_PREV(p,a))
1588−-- | Use the 'readRev' unfold instead.
1588+-- | Use the 'readerRev' unfold instead.
1590−-- @toStreamDRev = D.unfold readRev@
1590+-- @toStreamDRev = D.unfold readerRev@
1592-- We can try this if the unfold has any perf issues.
1592-- We can try this if the unfold has any perf issues.
1593{-# INLINE_NORMAL toStreamDRev #-}
1593{-# INLINE_NORMAL toStreamDRev #-}
@@ -1970,7 +1970,7 @@ fromArrayStreamK :: (Unboxed a, MonadIO m) =>
1970 K.Stream m (Array a) -> m (Array a)
1970 K.Stream m (Array a) -> m (Array a)
1971fromArrayStreamK as = do
1971fromArrayStreamK as = do
1972 len <- arrayStreamKLength as
1972 len <- arrayStreamKLength as
1973− fromStreamDN len $ D.unfoldMany read $ D.fromStreamK as
1973+ fromStreamDN len $ D.unfoldMany reader $ D.fromStreamK as
1975-- CAUTION: a very large number (millions) of arrays can degrade performance
1975-- CAUTION: a very large number (millions) of arrays can degrade performance
1976-- due to GC overhead because we need to buffer the arrays before we flatten
1976-- due to GC overhead because we need to buffer the arrays before we flatten