@@ -185,7 +185,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
185185-- represents a single IO action whereas the 'Serial' monad represents a series
186186-- of IO actions. The only change you need to make to go from 'IO' to 'Serial'
187187-- is to use 'runStream' to run the monad and to prefix the IO actions with
188−-- either 'once' or 'liftIO'. If you use liftIO you can switch from 'Serial'
188+-- either 'yieldM' or 'liftIO'. If you use liftIO you can switch from 'Serial'
189189-- to IO monad by simply removing the 'runStream' function; no other changes
190190-- are needed unless you have used some stream specific composition or
191191-- combinators.
@@ -347,13 +347,17 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
347347-- ["hello","world"]
348348-- @
349349--
350−-- To create a singleton stream from a pure value use 'pure' and to create a
351−-- singleton stream from a monadic action use 'once'.
350+-- To create a singleton stream from a pure value use 'yield' or 'pure' and to
351+-- create a singleton stream from a monadic action use 'yieldM'. Note that in
352+-- case of Zip applicative streams "pure" repeats the value to generate an
353+-- infinite stream.
352354--
353355-- @
354356-- > S.'toList' $ 'pure' 1
355357-- [1]
356−-- > S.'toList' $ S.'once' 'getLine'
358+-- > S.'toList' $ 'yield' 1
359+-- [1]
360+-- > S.'toList' $ S.'yieldM' 'getLine'
357361-- hello
358362-- ["hello"]
359363-- @
@@ -506,7 +510,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
506510-- seconds. After the delay it prints the number of seconds it slept.
507511--
508512-- @
509−-- delay n = S.'once' $ do
513+-- delay n = S.'yieldM' $ do
510514-- threadDelay (n * 1000000)
511515-- tid \<- myThreadId
512516-- putStrLn (show tid ++ ": Delay " ++ show n)
@@ -737,7 +741,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
737741--
738742-- @
739743-- main = 'runStream' . 'asyncly' $ traced (sqrt 9) '<>' traced (sqrt 16) '<>' traced (sqrt 25)
740−-- where traced m = S.'once' (myThreadId >>= print) >> return m
744+-- where traced m = S.'yieldM' (myThreadId >>= print) >> return m
741745-- @
742746-- @
743747-- ThreadId 40
@@ -859,7 +863,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
859863-- google = get "https://www.google.com/search?q=haskell"
860864-- bing = get "https://www.bing.com/search?q=haskell"
861865-- duckduckgo = get "https://www.duckduckgo.com/?q=haskell"
862−-- get s = S.'once' (httpNoBody (parseRequest_ s) >> putStrLn (show s))
866+-- get s = S.'yieldM' (httpNoBody (parseRequest_ s) >> putStrLn (show s))
863867-- @
864868--
865869-- The polymorphic version of the binary operation '<>' of the 'Parallel' type
@@ -918,7 +922,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
918922-- 'runStream' $ 'foldWith' 'async' (map delay [1..10])
919923-- 'runStream' $ 'foldMapWith' 'async' delay [1..10]
920924-- 'runStream' $ 'forEachWith' 'async' [1..10] delay
921−-- where delay n = S.'once' $ threadDelay (n * 1000000) >> print n
925+-- where delay n = S.'yieldM' $ threadDelay (n * 1000000) >> print n
922926-- @
923927
924928-- $nesting
@@ -988,7 +992,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
988992-- import "Streamly"
989993-- import qualified "Streamly.Prelude" as S
990994--
991−-- main = 'runStream' $ forever $ S.once getLine >>= S.once . putStrLn
995+-- main = 'runStream' $ forever $ S.yieldM getLine >>= S.yieldM . putStrLn
992996-- @
993997--
994998-- When multiple streams are composed using this style they nest in a DFS
@@ -1003,7 +1007,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
10031007-- main = 'runStream' $ do
10041008-- x <- S.'fromFoldable' [1,2]
10051009-- y <- S.'fromFoldable' [3,4]
1006−-- S.'once' $ putStrLn $ show (x, y)
1010+-- S.'yieldM' $ putStrLn $ show (x, y)
10071011-- @
10081012-- @
10091013-- (1,3)
@@ -1100,7 +1104,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
11001104-- main = 'runStream' . 'asyncly' $ do
11011105-- x <- S.'fromFoldable' [1,2]
11021106-- y <- S.'fromFoldable' [3,4]
1103−-- S.'once' $ putStrLn $ show (x, y)
1107+-- S.'yieldM' $ putStrLn $ show (x, y)
11041108-- @
11051109-- @
11061110-- (1,3)
@@ -1125,7 +1129,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
11251129-- main = 'runStream' . 'wSerially' $ do
11261130-- x <- S.'fromFoldable' [1,2]
11271131-- y <- S.'fromFoldable' [3,4]
1128−-- S.once $ putStrLn $ show (x, y)
1132+-- S.yieldM $ putStrLn $ show (x, y)
11291133-- @
11301134-- @
11311135-- (1,3)
@@ -1153,7 +1157,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
11531157-- main = 'runStream' . 'wAsyncly' $ do
11541158-- x <- S.'fromFoldable' [1,2]
11551159-- y <- S.'fromFoldable' [3,4]
1156−-- S.'once' $ putStrLn $ show (x, y)
1160+-- S.'yieldM' $ putStrLn $ show (x, y)
11571161-- @
11581162-- @
11591163-- (1,3)
@@ -1202,7 +1206,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
12021206-- sz <- sizes
12031207-- cl <- colors
12041208-- sh <- shapes
1205−-- S.'once' $ putStrLn $ show (sz, cl, sh)
1209+-- S.'yieldM' $ putStrLn $ show (sz, cl, sh)
12061210--
12071211-- where
12081212--