@@ -530,12 +530,12 @@ scanr1 f t | null t = empty
530530-- | /O(n)/ Like a combination of 'map' and 'foldl'. Applies a
531531-- function to each element of a 'Text', passing an accumulating
532532-- parameter from left to right, and returns a final 'Text'.
533−--
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
537−mapAccumL f z t = unstream (S.mapAccumL f z (stream t))
538−{-# INLINE mapAccumL #-}
533+mapAccumL :: (a -> Char -> (a,Char)) -> a -> Text -> (a, Text)
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+ (s'',ys) = mapAccumL f s' xs
539539
540540-- -----------------------------------------------------------------------------
541541-- ** Generating and unfolding 'Text's