@@ -77,15 +77,12 @@ module Streamly.Streams
7777 , adapt
7878
7979 -- * Running Streams
80− , runSerialT
8180 , runStreamT -- deprecated
82− , runInterleavedT
83− , runAParallelT
81+ , runInterleavedT -- deprecated
8482 , runAsyncT -- deprecated
85− , runParallelT
86− , runZipSerial
83+ , runParallelT -- deprecated
8784 , runZipStream -- deprecated
88− , runZipAsync
85+ , runZipAsync -- deprecated
8986
9087 -- * Zipping
9188 , zipWith
@@ -274,7 +271,7 @@ async m = do
274271-- element of the stream, serially.
275272--
276273-- @
277−-- main = 'runSerialT' $ do
274+-- main = 'runStream' . 'serially' $ do
278275-- x <- return 1 \<\> return 2
279276-- liftIO $ print x
280277-- @
@@ -286,7 +283,7 @@ async m = do
286283-- 'SerialT' nests streams serially in a depth first manner.
287284--
288285-- @
289−-- main = 'runSerialT' $ do
286+-- main = 'runStream' . 'serially' $ do
290287-- x <- return 1 \<\> return 2
291288-- y <- return 3 \<\> return 4
292289-- liftIO $ print (x, y)
@@ -304,6 +301,8 @@ async m = do
304301-- nested @for@ loops and the monadic continuation is the body of the loop. The
305302-- loop iterates for all elements of the stream.
306303--
304+-- The 'serially' combinator can be omitted as the default stream type is
305+-- 'SerialT'.
307306-- Note that serial composition can be used to combine an infinite number of
308307-- streams as it explores only one stream at a time.
309308--
@@ -334,9 +333,9 @@ type StreamT = SerialT
334333-- Semigroup
335334------------------------------------------------------------------------------
336335
337−-- | Same as the 'Semigroup' instance of 'SerialT'. Appends two streams
338−-- sequentially, yielding all elements from the first stream, and then all
339−-- elements from the second stream.
336+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'SerialT'.
337+-- Appends two streams sequentially, yielding all elements from the first
338+-- stream, and then all elements from the second stream.
340339{-# INLINE append #-}
341340append :: IsStream t => t m a -> t m a -> t m a
342341append m1 m2 = fromStream $ S.append (toStream m1) (toStream m2)
@@ -435,7 +434,7 @@ instance (Monad m, Floating a) => Floating (SerialT m a) where
435434--
436435--
437436-- @
438−-- main = 'runInterleavedT' $ do
437+-- main = 'runStream' . 'interleaving' $ do
439438-- x <- return 1 \<\> return 2
440439-- y <- return 3 \<\> return 4
441440-- liftIO $ print (x, y)
@@ -468,8 +467,8 @@ instance IsStream InterleavedT where
468467-- Semigroup
469468------------------------------------------------------------------------------
470469
471−-- | Same as the 'Semigroup' instance of 'InterleavedT'. Interleaves two
472−-- streams, yielding one element from each stream alternately.
470+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'InterleavedT'.
471+-- Interleaves two streams, yielding one element from each stream alternately.
473472{-# INLINE interleave #-}
474473interleave :: IsStream t => t m a -> t m a -> t m a
475474interleave m1 m2 = fromStream $ S.interleave (toStream m1) (toStream m2)
@@ -586,7 +585,7 @@ instance (Monad m, Floating a) => Floating (InterleavedT m a) where
586585-- import "Streamly"
587586-- import Control.Concurrent
588587--
589−-- main = 'runAParallelT' $ do
588+-- main = 'runStream' . 'aparallely' $ do
590589-- n <- return 3 \<\> return 2 \<\> return 1
591590-- liftIO $ do
592591-- threadDelay (n * 1000000)
@@ -627,9 +626,9 @@ instance IsStream AParallelT where
627626-- Semigroup
628627------------------------------------------------------------------------------
629628
630−-- | Same as the 'Semigroup' operation of 'AParallelT', but polymorphic.
631−-- Merges two streams possibly concurrently, preferring the elements from the
632−-- left one when available.
629+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'AParallelT', but
630+-- polymorphic. Merges two streams possibly concurrently, preferring the
631+-- elements from the left one when available.
633632{-# INLINE aparallel #-}
634633aparallel :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
635634aparallel m1 m2 = fromStream $ S.aparallel (toStream m1) (toStream m2)
@@ -753,7 +752,7 @@ instance (MonadAsync m, Floating a) => Floating (AParallelT m a) where
753752-- import "Streamly"
754753-- import Control.Concurrent
755754--
756−-- main = 'runParallelT' $ do
755+-- main = 'runStream' . 'parallely' $ do
757756-- n <- return 3 \<\> return 2 \<\> return 1
758757-- liftIO $ do
759758-- threadDelay (n * 1000000)
@@ -792,8 +791,8 @@ instance IsStream ParallelT where
792791-- Semigroup
793792------------------------------------------------------------------------------
794793
795−-- | Same as the 'Semigroup' instance of 'ParallelT'. Merges two streams
796−-- concurrently choosing elements from both fairly.
794+-- | Polymorphic version of the 'Semigroup' operation '<>' of 'ParallelT'.
795+-- Merges two streams concurrently choosing elements from both fairly.
797796{-# INLINE parallel #-}
798797parallel :: (IsStream t, MonadAsync m) => t m a -> t m a -> t m a
799798parallel m1 m2 = fromStream $ S.parallel (toStream m1) (toStream m2)
@@ -1066,19 +1065,19 @@ instance (MonadAsync m, Floating a) => Floating (ZipAsync m a) where
10661065-- Type adapting combinators
10671066-------------------------------------------------------------------------------
10681067
1069−-- | Adapt one streaming type to another.
1068+-- | Adapt any specific stream type to any other specific stream type.
10701069adapt :: (IsStream t1, IsStream t2) => t1 m a -> t2 m a
10711070adapt = fromStream . toStream
10721071
1073−-- | Interpret an ambiguously typed stream as 'SerialT'.
1072+-- | Fix the type of a polymorphic stream as 'SerialT'.
10741073serially :: IsStream t => SerialT m a -> t m a
10751074serially = adapt
10761075
1077−-- | Interpret an ambiguously typed stream as 'InterleavedT'.
1076+-- | Fix the type of a polymorphic stream as 'InterleavedT'.
10781077interleaving :: IsStream t => InterleavedT m a -> t m a
10791078interleaving = adapt
10801079
1081−-- | Interpret an ambiguously typed stream as 'AParallelT'.
1080+-- | Fix the type of a polymorphic stream as 'AParallelT'.
10821081aparallely :: IsStream t => AParallelT m a -> t m a
10831082aparallely = adapt
10841083
@@ -1087,15 +1086,15 @@ aparallely = adapt
10871086asyncly :: IsStream t => AParallelT m a -> t m a
10881087asyncly = aparallely
10891088
1090−-- | Interpret an ambiguously typed stream as 'ParallelT'.
1089+-- | Fix the type of a polymorphic stream as 'ParallelT'.
10911090parallely :: IsStream t => ParallelT m a -> t m a
10921091parallely = adapt
10931092
1094−-- | Interpret an ambiguously typed stream as 'ZipSerial'.
1093+-- | Fix the type of a polymorphic stream as 'ZipSerial'.
10951094zipping :: IsStream t => ZipSerial m a -> t m a
10961095zipping = adapt
10971096
1098−-- | Interpret an ambiguously typed stream as 'ZipAsync'.
1097+-- | Fix the type of a polymorphic stream as 'ZipAsync'.
10991098zippingAsync :: IsStream t => ZipAsync m a -> t m a
11001099zippingAsync = adapt
11011100
@@ -1103,42 +1102,33 @@ zippingAsync = adapt
11031102-- Running Streams, convenience functions specialized to types
11041103-------------------------------------------------------------------------------
11051104
1106−-- | Same as @runStream . serially@.
1107−runSerialT :: Monad m => SerialT m a -> m ()
1108−runSerialT = runStream
1109−
1110−-- | Same as @runSerialT@.
1111−{-# Deprecated runStreamT "Please use runSerialT instead." #-}
1105+-- | Same as @runStream@.
1106+{-# DEPRECATED runStreamT "Please use runStream instead." #-}
11121107runStreamT :: Monad m => SerialT m a -> m ()
1113−runStreamT = runSerialT
1108+runStreamT = runStream
11141109
11151110-- | Same as @runStream . interleaving@.
1111+{-# DEPRECATED runInterleavedT "Please use 'runStream . interleaving' instead." #-}
11161112runInterleavedT :: Monad m => InterleavedT m a -> m ()
11171113runInterleavedT = runStream . interleaving
11181114
11191115-- | Same as @runStream . aparallely@.
1120−runAParallelT :: Monad m => AParallelT m a -> m ()
1121−runAParallelT = runStream . aparallely
1122−
1123−-- | Same as @runAParallelT@.
1124−{-# Deprecated runAsyncT "Please use runAParallelT instead." #-}
1116+{-# DEPRECATED runAsyncT "Please use 'runStream . aparallely' instead." #-}
11251117runAsyncT :: Monad m => AParallelT m a -> m ()
1126−runAsyncT = runAParallelT
1118+runAsyncT = runStream . aparallely
11271119
11281120-- | Same as @runStream . parallely@.
1121+{-# DEPRECATED runParallelT "Please use 'runStream . parallely' instead." #-}
11291122runParallelT :: Monad m => ParallelT m a -> m ()
11301123runParallelT = runStream . parallely
11311124
11321125-- | Same as @runStream . zipping@.
1133−runZipSerial :: Monad m => ZipSerial m a -> m ()
1134−runZipSerial = runStream . zipping
1135−
1136−{-# Deprecated runZipStream "Please use runZipSerial instead." #-}
1137−-- | Same as ZipSerial.
1126+{-# DEPRECATED runZipStream "Please use 'runStream . zipping instead." #-}
11381127runZipStream :: Monad m => ZipSerial m a -> m ()
1139−runZipStream = runZipSerial
1128+runZipStream = runStream . zipping
11401129
11411130-- | Same as @runStream . zippingAsync@.
1131+{-# DEPRECATED runZipAsync "Please use 'runStream . zippingAsync instead." #-}
11421132runZipAsync :: Monad m => ZipAsync m a -> m ()
11431133runZipAsync = runStream . zippingAsync
11441134