on master help sign in
update doc to mention the ordering guarantees
commitd54845bb40a31fd8bd0b62328159fdca715469aa authorHarendra Kumar <harendra.kumar@gmail.com> dateMon 7 May 2018, 05:49 (8 years ago) parentcf1388b
1 file changed+15−1
src/Streamly/Streams.hs+15−1
src/Streamly/Streams.hs+15−1
@@ -537,7 +537,7 @@ MONAD_COMMON_INSTANCES(CostreamT,)
537537
538538-- | Adaptive parallel, in a left to right 'Semigroup' composition it tries to
539539-- yield elements from the left stream as long as it can, but it can run the
540−-- right stream in parallel if it needs to based on demand. The right stream
540+-- right stream in parallel if it needs to, based on demand. The right stream
541541-- can be run if the left stream blocks on IO or cannot produce elements fast
542542-- enough for the consumer.
543543--
@@ -548,6 +548,13 @@ MONAD_COMMON_INSTANCES(CostreamT,)
548548-- [1,2,3,4]
549549-- @
550550--
551+-- Any exceptions generated by a constituent stream are propagated to the
552+-- output stream. The output and exceptions from a single stream are guaranteed
553+-- to arrive in the same order in the resulting stream as they were generated
554+-- in the input stream. However, the relative ordering of elements from
555+-- different streams in the resulting stream can vary depending on scheduling
556+-- and generation delays.
557+--
551558-- Similarly, the monad instance of 'ParallelT' /may/ run each iteration
552559-- concurrently based on demand. More concurrent iterations are started only
553560-- if the previous iterations are not able to produce enough output for the
@@ -666,6 +673,13 @@ MONAD_COMMON_INSTANCES(CoparallelT, MONADPARALLEL)
666673-- [1,3,2,4]
667674-- @
668675--
676+-- Any exceptions generated by a constituent stream are propagated to the
677+-- output stream. The output and exceptions from a single stream are guaranteed
678+-- to arrive in the same order in the resulting stream as they were generated
679+-- in the input stream. However, the relative ordering of elements from
680+-- different streams in the resulting stream can vary depending on scheduling
681+-- and generation delays.
682+--
669683-- Similarly, the 'Monad' instance of 'ParallelT' runs /all/ iterations fairly
670684-- concurrently using a round robin scheduling.
671685--