@@ -1,12 +1,12 @@
1{-# OPTIONS_GHC -fno-warn-unused-imports #-}
1{-# OPTIONS_GHC -fno-warn-unused-imports #-}
3−-- Module : Asyncly.Tutorial
3+-- Module : Streamly.Tutorial
4-- Copyright : (c) 2017 Harendra Kumar
4-- Copyright : (c) 2017 Harendra Kumar
6-- License : BSD3
6-- License : BSD3
7-- Maintainer : harendra.kumar@gmail.com
7-- Maintainer : harendra.kumar@gmail.com
9−-- Asyncly combines streaming, logic programming, concurrency and reactive
9+-- Streamly combines streaming, logic programming, concurrency and reactive
10-- programming under a single abstraction with a concise API, giving
10-- programming under a single abstraction with a concise API, giving
11-- programmers a simple yet powerful tool for wide variety of applications.
11-- programmers a simple yet powerful tool for wide variety of applications.
@@ -26,18 +26,18 @@
26-- iterations of a loop, '>>|' runs iterations in parallel and '>|>' runs all
26-- iterations of a loop, '>>|' runs iterations in parallel and '>|>' runs all
27-- iterations in fairly parallel manner.
27-- iterations in fairly parallel manner.
29−-- With asyncly you can write concurrent and streaming applications without
29+-- With streamly you can write concurrent and streaming applications without
30-- being aware of threads or synchronization. No explicit thread control is
30-- being aware of threads or synchronization. No explicit thread control is
31-- needed, where applicable the concurrency rate is automatically controlled
31-- needed, where applicable the concurrency rate is automatically controlled
32-- based on the demand by the consumer. However, combinators are provided to
32-- based on the demand by the consumer. However, combinators are provided to
33-- fine tune the concurrency control. Streaming and concurrency allows
33-- fine tune the concurrency control. Streaming and concurrency allows
34−-- expressing reactive applications conveniently. See 'Asyncly.Examples' for a
34+-- expressing reactive applications conveniently. See 'Streamly.Examples' for a
35-- simple SDL based FRP example.
35-- simple SDL based FRP example.
37−-- For examples and other ways to use the library see 'Asyncly.Examples' as
37+-- For examples and other ways to use the library see 'Streamly.Examples' as
40−module Asyncly.Tutorial
40+module Streamly.Tutorial
42 -- * AsyncT Monad Transformer
42 -- * AsyncT Monad Transformer
43 -- $transformer
43 -- $transformer
@@ -116,9 +116,9 @@ module Asyncly.Tutorial
119−import Asyncly.Core
119+import Streamly.Core
120−import Asyncly.Prelude
120+import Streamly.Prelude
121−-- import Asyncly.Examples
121+-- import Streamly.Examples
122import Data.Semigroup
122import Data.Semigroup
123import Control.Applicative
123import Control.Applicative
124import Control.Monad
124import Control.Monad
@@ -156,7 +156,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
156-- to deconstruct an 'AsyncT' stream into head and tail.
156-- to deconstruct an 'AsyncT' stream into head and tail.
159−-- import Asyncly
159+-- import Streamly
161-- main = do
161-- main = do
162-- runAsyncly $ liftIO $ putStrLn "Hello world!"
162-- runAsyncly $ liftIO $ putStrLn "Hello world!"
@@ -174,7 +174,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
174-- specified by the argument in seconds and then prints the argument.
174-- specified by the argument in seconds and then prints the argument.
177−-- import Asyncly
177+-- import Streamly
178-- import Control.Concurrent
178-- import Control.Concurrent
180-- traced m = liftIO (myThreadId >>= print) >> m
180-- traced m = liftIO (myThreadId >>= print) >> m
@@ -289,7 +289,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
289-- name of the search engine as a response arrives:
289-- name of the search engine as a response arrives:
292−-- import Asyncly
292+-- import Streamly
293-- import Network.HTTP.Simple
293-- import Network.HTTP.Simple
295-- main = runAsyncly $ google \<|> bing \<|> duckduckgo
295-- main = runAsyncly $ google \<|> bing \<|> duckduckgo
@@ -309,7 +309,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
309-- Take an example of a merge sort of two sorted streams. We need to keep
309-- Take an example of a merge sort of two sorted streams. We need to keep
310-- consuming items from the stream which has the lowest item in the sort order.
310-- consuming items from the stream which has the lowest item in the sort order.
311-- This can be achieved using async references to streams. See
311-- This can be achieved using async references to streams. See
312−-- 'Asyncly.Examples.MergeSortedStreams'.
312+-- 'Streamly.Examples.MergeSortedStreams'.
314-- $monoid
314-- $monoid
@@ -324,7 +324,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
324-- the function argument.
324-- the function argument.
327−-- import Asyncly
327+-- import Streamly
329-- main = do
329-- main = do
330-- runAsyncly $ liftIO $ putStrLn "Hello world!"
330-- runAsyncly $ liftIO $ putStrLn "Hello world!"
@@ -352,7 +352,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
352-- all elements of the stream using 'fmap'.
352-- all elements of the stream using 'fmap'.
355−-- import Asyncly
355+-- import Streamly
357-- main = do
357-- main = do
358-- let nums = foldMapWith (<>) return [1..10]
358-- let nums = foldMapWith (<>) return [1..10]
@@ -395,7 +395,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
398−-- import Asyncly
398+-- import Streamly
399-- import Data.Semigroup (cycle1)
399-- import Data.Semigroup (cycle1)
401-- main = runAsyncly $ do
401-- main = runAsyncly $ do
@@ -430,7 +430,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
430-- example:
430-- example:
433−-- import Asyncly
433+-- import Streamly
435-- main = runAsyncly $
435-- main = runAsyncly $
436-- sizes >-> \\sz ->
436-- sizes >-> \\sz ->
@@ -449,7 +449,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
449-- $concurrentNesting
449-- $concurrentNesting
452−-- import Asyncly
452+-- import Streamly
453-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
453-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
454-- import Control.Concurrent
454-- import Control.Concurrent
@@ -476,7 +476,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
476-- $fairlyConcurrentNesting
476-- $fairlyConcurrentNesting
479−-- import Asyncly
479+-- import Streamly
480-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
480-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
481-- import Control.Concurrent
481-- import Control.Concurrent
@@ -516,7 +516,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
516-- sum and print them serially:
516-- sum and print them serially:
519−-- import Asyncly
519+-- import Streamly
520-- import Data.List (sum)
520-- import Data.List (sum)
522-- main = do
522-- main = do
@@ -529,7 +529,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
529-- monadic bind.
529-- monadic bind.
532−-- import Asyncly
532+-- import Streamly
533-- import Data.List (sum)
533-- import Data.List (sum)
535-- main = do
535-- main = do
@@ -544,7 +544,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
544-- Let us see a reactive programming example:
544-- Let us see a reactive programming example:
547−-- import Asyncly
547+-- import Streamly
548-- import Control.Concurrent (threadDelay)
548-- import Control.Concurrent (threadDelay)
549-- import Control.Monad (when)
549-- import Control.Monad (when)
550-- import Control.Monad.State
550-- import Control.Monad.State
@@ -588,13 +588,13 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
589-- $comparison
589-- $comparison
591−-- Even though asyncly covers all that is provided by the 'async' package or
591+-- Even though streamly covers all that is provided by the 'async' package or
592-- most of what is provided by the 'streaming', 'pipes' or 'conduit' packages,
592-- most of what is provided by the 'streaming', 'pipes' or 'conduit' packages,
593−-- I would not say that it renders those useless. Asyncly is like monad if
593+-- I would not say that it renders those useless. Streamly is like monad if
594-- 'async' is applicative and monads and applicatives both have their use
594-- 'async' is applicative and monads and applicatives both have their use
595-- cases. It can completely repalce 'async', the ZipAsync type is equivalent to
595-- cases. It can completely repalce 'async', the ZipAsync type is equivalent to
596-- the functionality provided by 'async'.
596-- the functionality provided by 'async'.
598−-- pipes and conduit are like Arrows and asyncly is like monad to them. You
598+-- pipes and conduit are like Arrows and streamly is like monad to them. You
599-- would use pipes and conduit when you do not need the product style
599-- would use pipes and conduit when you do not need the product style
600-- composition and the implicit concurrency.
600-- composition and the implicit concurrency.