on master help sign in
Update docs/streamly-vs-async.md.
20b204cPranay Sashank
docs/streamly-vs-async.md+4−4
@@ -36,7 +36,7 @@ generalization of the IO monad with non-deterministic composition of streams
36added on top.
36added on top.
37
37
38However, if you would like to just run only some concurrent portions of your
38However, if you would like to just run only some concurrent portions of your
39−program using streamly, you can do that too. Just use `runStream` if you want
39+program using streamly, you can do that too. Just use `drain` if you want
40to run the stream without collecting the outputs of the concurrent actions or
40to run the stream without collecting the outputs of the concurrent actions or
41use `toList` if you want to convert the output stream into a list. Other
41use `toList` if you want to convert the output stream into a list. Other
42stream folding operations can also be used, see the docs for more details.
42stream folding operations can also be used, see the docs for more details.
@@ -84,10 +84,10 @@ return 2 first and then 1.
84
84
85### concurrently_
85### concurrently_
86
86
87−Use `runStream` instead of `toList` to run the actions but ignore the results:
87+Use `drain` instead of `toList` to run the actions but ignore the results:
88
88
89```haskell
89```haskell
90− runStream $ parallely $ getURL 1 |: getURL 2 |: S.nil
90+ S.drain $ parallely $ getURL 1 |: getURL 2 |: S.nil
91```
91```
92
92
93### Concurrent Applicative
93### Concurrent Applicative
@@ -135,7 +135,7 @@ other actions will be canceled, for example:
135 instance Exception Result
135 instance Exception Result
136
136
137 main = do
137 main = do
138− url <- try $ runStream $ parallely $
138+ url <- try $ S.drain $ parallely $
139 (getURL 2 >>= throwM . Result)
139 (getURL 2 >>= throwM . Result)
140 |: (getURL 1 >>= throwM . Result)
140 |: (getURL 1 >>= throwM . Result)
141 |: S.nil
141 |: S.nil