@@ -789,16 +789,12 @@ mapAccumL f z0 = S.mapAccumL f z0 . stream
789789{-# INLINE mapAccumL #-}
790790
791791-- | The 'mapAccumR' function behaves like a combination of 'map' and
792−-- 'foldr'; it applies a function to each element of a 'Text', passing
793−-- an accumulating parameter from right to left, and returning a final
794−-- value of this accumulator together with the new 'Text'.
792+-- a strict 'foldr'; it applies a function to each element of a
793+-- 'Text', passing an accumulating parameter from right to left, and
794+-- returning a final value of this accumulator together with the new
795+-- 'Text'.
795796mapAccumR :: (a -> Char -> (a,Char)) -> a -> Text -> (a, Text)
796−mapAccumR f = go
797− where go s t = case uncons t of
798− Nothing -> (s, empty)
799− Just (x, xs) -> (s'', cons y ys)
800− where (s'',y ) = f s' x
801− (s', ys) = go s xs
797+mapAccumR f z0 = second reverse . S.mapAccumL f z0 . reverseStream
802798{-# INLINE mapAccumR #-}
803799
804800-- -----------------------------------------------------------------------------