streamly icon indicating copy to clipboard operation
streamly copied to clipboard

Use monomorphic stream type with concurrency strategies

Open harendra-kumar opened this issue 6 years ago • 0 comments

See #156 as well for the problem to be solved.

We use multiple stream types for different styles of serial and concurrent merging of streams. We use type adapting combinators to adapt from one style to another. One disadvantage of this strategy is that when we adapt the stream using e.g. parallely the whole block of code infers a parallel stream type and we have to then again use a serially combinator to change the types where we do not want the combinators to compose in parallel style. Instead what we want is to selectively make particular combinators concurrent rather than doing it en-masse in a block.

For this we can adopt something like the strategies in the parallel package. We can perhaps write something like repeatM ``using`` parallel to make repeatM parallel.

The details of this need to be fleshed out and we need to come up with combinators/strategies that will make concurrency easier/safer/intuitive to use and with less type ambiguities.

harendra-kumar avatar Aug 06 '19 16:08 harendra-kumar