mapM_ package:io-streams

Maps a side effect over an InputStream. mapM_ f s produces a new input stream that passes all output from s through the side-effecting IO action f. Example:
ghci> Streams.fromList [1,2,3] >>=
Streams.mapM_ (putStrLn . show . (*2)) >>=
Streams.toList
2
4
6
[1,2,3]
Equivalent to mapM_ for output. contramapM f s passes all input to s through the side-effecting IO action f.