purescript-hareactive
purescript-hareactive copied to clipboard
Add a way to flatten a stream of arrays of events into a stream of events
Hello!
Currently, I have this thing in my code:
flattenArrayStream :: forall a. Stream (Array a) -> Now (Stream a)
flattenArrayStream input = do
ss <- liftEffect sinkStream'
liftEffect $ subscribe (foldMap (\x -> pushSink x ss.sink)) input
pure ss.stream
Perhaps a new combinator that does something like this the "proper" way (perhaps without using Effect?) would be useful?