The following function is useful (i have used it a few times):
mapStreamM :: Monad m => (a -> Stream (Of b) m x) -> Stream (Of a) m r -> Stream (Of b) m r
mapStreamM f = S.concats . S.mapsM (\(a :> s) -> return (f a >> return s)
- Do people think this would be a good addition
- Is there a better implementation
- Is there a better name
The following function is useful (i have used it a few times):