Represents a stateful transformation over an input stream of values of
type a to outputs of type b in Monad m.
The constructor is Scan consume initial.
Instances4Category, Arrow, Functor, Applicative
Monad m => Category (Scanr m)Defined in streamly-core-0.3.1 · Streamly.Internal.Data.ScanrMonad m => Arrow (Scanr m)Defined in streamly-core-0.3.1 · Streamly.Internal.Data.ScanrFunctor m => Functor (Scanr m a)Defined in streamly-core-0.3.1 · Streamly.Internal.Data.Scanrfmap maps a pure function on a scan output.
Example1 expression Stream.toList $ Stream.scanr (fmap (+1) Scanr.identity) $ Stream.fromList [1..5::Int][2,3,4,5,6]
Monad m => Applicative (Scanr m a)Defined in streamly-core-0.3.1 · Streamly.Internal.Data.ScanrZips the outputs only when both scans produce outputs, discards otherwise.