@@ -71,9 +71,6 @@ module Data.Text.Internal.Fusion.Common
71 -- ** Scans
71 -- ** Scans
74− -- ** Accumulating maps
77 -- ** Generation and unfolding
74 -- ** Generation and unfolding
78 , replicateCharI
75 , replicateCharI
79 , replicateI
76 , replicateI
@@ -668,29 +665,6 @@ scanl f z0 (Stream next0 s0 len) = Stream next (Scan1 z0 s0) (len+1) -- HINT may
668 Done -> Done
665 Done -> Done
669{-# INLINE [0] scanl #-}
666{-# INLINE [0] scanl #-}
671−-- -----------------------------------------------------------------------------
672−-- ** Accumulating maps
675−-- | /O(n)/ Like a combination of 'map' and 'foldl'. Applies a
676−-- function to each element of a stream, passing an accumulating
677−-- parameter from left to right, and returns a final stream.
679−-- /Note/: Unlike the version over lists, this function does not
680−-- return a final value for the accumulator, because the nature of
681−-- streams precludes it.
682−mapAccumL :: (a -> b -> (a,b)) -> a -> Stream b -> Stream b
683−mapAccumL f z0 (Stream next0 s0 len) = Stream next (s0 :*: z0) len -- HINT depends on f
686− next (s :*: z) = case next0 s of
687− Yield x s' -> let (z',y) = f z x
688− in Yield y (s' :*: z')
689− Skip s' -> Skip (s' :*: z)
691−{-# INLINE [0] mapAccumL #-}
694-- -----------------------------------------------------------------------------
668-- -----------------------------------------------------------------------------
695-- ** Generating and unfolding streams
669-- ** Generating and unfolding streams