@@ -530,12 +530,12 @@ scanr1 f t | null t = empty
530-- | /O(n)/ Like a combination of 'map' and 'foldl'. Applies a
530-- | /O(n)/ Like a combination of 'map' and 'foldl'. Applies a
531-- function to each element of a 'Text', passing an accumulating
531-- function to each element of a 'Text', passing an accumulating
532-- parameter from left to right, and returns a final 'Text'.
532-- parameter from left to right, and returns a final 'Text'.
534−-- /Note/: Unlike the version over lists, this function does not return a
535−-- final value for the accumulator.
536−mapAccumL :: (a -> Char -> (a,Char)) -> a -> Text -> Text
533+mapAccumL :: (a -> Char -> (a,Char)) -> a -> Text -> (a, Text)
537−mapAccumL f z t = unstream (S.mapAccumL f z (stream t))
534+mapAccumL f s t = case uncons t of
535+ Nothing -> (s, empty)
536+ Just (x, xs) -> (s'', cons y ys)
537+ where (s', y ) = f s x
538−{-# INLINE mapAccumL #-}
538+ (s'',ys) = mapAccumL f s' xs
540-- -----------------------------------------------------------------------------
540-- -----------------------------------------------------------------------------
541-- ** Generating and unfolding 'Text's
541-- ** Generating and unfolding 'Text's