on master help sign in
Add some TODO comments
39fcfd9Harendra Kumar
src/Streamly/Streams/Parallel.hs+7
@@ -147,6 +147,13 @@ joinStreamVarPar style ss m1 m2 = mkStream $ \st yld sng stp ->
147consMParallel :: MonadAsync m => m a -> ParallelT m a -> ParallelT m a
147consMParallel :: MonadAsync m => m a -> ParallelT m a -> ParallelT m a
148consMParallel m r = fromStream $ K.yieldM m `parallel` (toStream r)
148consMParallel m r = fromStream $ K.yieldM m `parallel` (toStream r)
149
149
150+-- TODO
151+-- Different variants of parallel differ in how the combined stream ends:
152+--
153+-- - - parallel - ends when all stream end
154+-- parallelEndByFirst - parallel1 - ends when the first stream ends
155+-- parallelEndByAny - parallel_ - ends when any stream ends
156+--
150-- | Polymorphic version of the 'Semigroup' operation '<>' of 'ParallelT'
157-- | Polymorphic version of the 'Semigroup' operation '<>' of 'ParallelT'
151-- Merges two streams concurrently.
158-- Merges two streams concurrently.
152--
159--
src/Streamly/Streams/Serial.hs+16
@@ -299,6 +299,22 @@ instance IsStream WSerialT where
299-- Semigroup
299-- Semigroup
300------------------------------------------------------------------------------
300------------------------------------------------------------------------------
301
301
302+-- TODO
303+-- We always starts with the first stream yielding but there can be many ways
304+-- to end it. In general we can have the following variants of interleaving
305+-- streams:
306+-- wSerial - interleave - end when both streams end
307+-- wSerialEndByAny - interleave_ - end as soon as any stream ends
308+-- wSerialEndByFirst - interleave1 - make sure we end with first
309+-- - - interleave2 - make sure we end with second
310+--
311+-- Additionally we can have m elements yield from the first stream and n
312+-- elements yeilding from the second stream. We can also have time slicing
313+-- variants of positional interleaving, e.g. run first stream for m seconds and
314+-- run the second stream for n seconds.
315+--
316+-- Similar combinators can be implemented using WAhead style.
317+
302-- | Polymorphic version of the 'Semigroup' operation '<>' of 'WSerialT'.
318-- | Polymorphic version of the 'Semigroup' operation '<>' of 'WSerialT'.
303-- Interleaves two streams, yielding one element from each stream alternately.
319-- Interleaves two streams, yielding one element from each stream alternately.
304-- When one stream stops the rest of the other stream is used in the output
320-- When one stream stops the rest of the other stream is used in the output