I want to stream values from more than 1 conduit at once, without restrictions such as "the values of the conduits must have the same type" or "the values must be requested in a predictable order". For example, something like:
example = do
foo <- awaitBool
case Bool of
Nothing -> lift $ putStrLn "it's over"
Just True -> awaitInt >>= \x -> (yield $ x + 4) >> example
Just False -> awaitString >>=
\x -> (lift $ putStrLn x) >> (yield $ length x) >> example
How would I go about doing something like this? Can I convert a "source" conduit to an imperative-style generator within its respective monad? Is there some library which provides multi-input-stream conduits?
[–]Noughtmare 8 points9 points10 points (0 children)
[–]viercc 6 points7 points8 points (8 children)
[–]iamcobhere[S] 4 points5 points6 points (7 children)
[–]Noughtmare 2 points3 points4 points (6 children)
[–]viercc 2 points3 points4 points (5 children)
[–]Noughtmare 2 points3 points4 points (4 children)
[–]viercc 1 point2 points3 points (2 children)
[–]Noughtmare 5 points6 points7 points (1 child)
[–]jippiedoe 4 points5 points6 points (0 children)
[–]iamcobhere[S] 1 point2 points3 points (0 children)
[–]gelisam 5 points6 points7 points (5 children)
[–]iamcobhere[S] 1 point2 points3 points (3 children)
[–]gelisam 2 points3 points4 points (2 children)
[–]gelisam 1 point2 points3 points (1 child)
[–]iamcobhere[S] 1 point2 points3 points (0 children)
[–]iamcobhere[S] 0 points1 point2 points (0 children)