inputFoldM :: (a -> b -> IO a)fold function
-> ainitial seed
-> InputStream binput stream
-> IO (InputStream b, IO a)returns a new stream as well as an IO action to fetch and reset the updated seed value.
A side-effecting fold over an InputStream, as a stream transformer.
The IO action returned by inputFoldM can be used to fetch and reset the updated seed value. Example:
ghci> is <- Streams.fromList [1, 2, 3::Int]
ghci> (is', getSeed) <- Streams.inputFoldM (\x y -> return (x+y)) 0 is
ghci> Streams.toList is'
[1,2,3]
ghci> getSeed
6