@@ -482,6 +482,15 @@ minimum t = S.minimum (stream t)
482482-- -----------------------------------------------------------------------------
483483-- * Building 'Text's
484484
485+-- | /O(n)/ 'scanl' is similar to 'foldl', but returns a list of
486+-- successive reduced values from the left. This function is subject
487+-- to array fusion.
488+--
489+-- > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
490+--
491+-- Note that
492+--
493+-- > last (scanl f z xs) == foldl f z xs.
485494scanl :: (Char -> Char -> Char) -> Char -> Text -> Text
486495scanl f z t = unstream (S.scanl f z (stream t))
487496{-# INLINE scanl #-}