on master help sign in
Update docs of concatChunksRev
commitfa14d0e98a6df5673d474ada1cfa251cdfb6e125 authorHarendra Kumar <harendra@composewell.com> dateSun 31 Dec 2023, 17:08 (3 years ago) parent5274d3f
1 file changed+5−4
core/src/Streamly/Internal/Data/Array/Type.hs+5−4
core/src/Streamly/Internal/Data/Array/Type.hs+5−4
@@ -463,16 +463,17 @@ flattenArrays :: forall m a. (MonadIO m, Unbox a)
463463 => D.Stream m (Array a) -> D.Stream m a
464464flattenArrays = concatChunks
465465
466−-- | Use the "readerRev" unfold instead.
466+-- | Convert a stream of arrays into a stream of their elements reversing the
467+-- contents of each array before flattening.
467468--
468−-- @concatChunksRev = unfoldMany readerRev@
469−--
470−-- We can try this if there are any fusion issues in the unfold.
469+-- >>> concatChunksRev = Stream.unfoldMany Array.readerRev
471470--
472471{-# INLINE_NORMAL concatChunksRev #-}
473472concatChunksRev :: forall m a. (MonadIO m, Unbox a)
474473 => D.Stream m (Array a) -> D.Stream m a
474+-- XXX this requires MonadIO whereas the unfoldMany version does not
475475concatChunksRev = MA.concatChunksRev . D.map unsafeThaw
476+-- concatChunksRev = D.unfoldMany readerRev
476477
477478{-# DEPRECATED flattenArraysRev "Please use \"unfoldMany readerRev\" instead." #-}
478479flattenArraysRev :: forall m a. (MonadIO m, Unbox a)