on master help sign in
Rename to Streamly

Streamly is a more appropriate name and conveys the core idea. Stream concurrently = streamly.

commita74a0c08445e26312c9fdeded12344ffd34e960a authorHarendra Kumar <harendra.kumar@gmail.com> dateMon 20 Nov 2017, 18:03 (9 years ago) parentb1e400b
20 files changed+140−140
README.md+10−10 benchmark/Main.hs+33−33 examples/echo-loop.hs+1−1 examples/loops.hs+1−1 examples/map-reduce.hs+2−2 examples/nested-loops.hs+1−1 examples/parallel-loops.hs+1−1 src/Asyncly.hs → src/Streamly.hs+11−11 src/Asyncly/Core.hs → src/Streamly/Core.hs+2−2 src/Asyncly/Examples/AcidRainGame.hs → src/Streamly/Examples/AcidRainGame.hs+2−2 src/Asyncly/Examples/CirclingSquare.hs → src/Streamly/Examples/CirclingSquare.hs+4−4 src/Asyncly/Examples/ListDirRecursive.hs → src/Streamly/Examples/ListDirRecursive.hs+2−2 src/Asyncly/Examples/MergeSortedStreams.hs → src/Streamly/Examples/MergeSortedStreams.hs+3−3 src/Asyncly/Examples/SearchEngineQuery.hs → src/Streamly/Examples/SearchEngineQuery.hs+2−2 src/Asyncly/Prelude.hs → src/Streamly/Prelude.hs+4−4 src/Asyncly/Streams.hs → src/Streamly/Streams.hs+3−3 src/Asyncly/Time.hs → src/Streamly/Time.hs+2−2 src/Asyncly/Tutorial.hs → src/Streamly/Tutorial.hs+25−25 asyncly.cabal → streamly.cabal+28−28 test/Main.hs+3−3
README.md+10−10
@@ -1,20 +1,20 @@
1−# Asyncly
1+# Streamly
22
3−[![Build Status](https://travis-ci.org/harendra-kumar/asyncly.svg?branch=master)](https://travis-ci.org/harendra-kumar/asyncly)
4−[![Windows Build status](https://ci.appveyor.com/api/projects/status/h2bcgw7xa2jxe222?svg=true)](https://ci.appveyor.com/project/harendra-kumar/asyncly)
5−[![Coverage Status](https://coveralls.io/repos/harendra-kumar/asyncly/badge.svg?branch=master&service=github)](https://coveralls.io/github/harendra-kumar/asyncly?branch=master)
3+[![Build Status](https://travis-ci.org/harendra-kumar/streamly.svg?branch=master)](https://travis-ci.org/harendra-kumar/streamly)
4+[![Windows Build status](https://ci.appveyor.com/api/projects/status/h2bcgw7xa2jxe222?svg=true)](https://ci.appveyor.com/project/harendra-kumar/streamly)
5+[![Coverage Status](https://coveralls.io/repos/harendra-kumar/streamly/badge.svg?branch=master&service=github)](https://coveralls.io/github/harendra-kumar/streamly?branch=master)
66
7−Asyncly is a general streaming and concurrent programming
7+Streamly is a general streaming and concurrent programming
88monad allowing you to write a wide variety of applications ranging from
99simple applications utilizing streaming IO to massively parallel concurrent
1010applications as well as reactive (FRP) applications with the same ease.
11−Asyncly provides high level concurrency primitives and hides the low level
11+Streamly provides high level concurrency primitives and hides the low level
1212concurrency details completely from the programmer. The programmer just
1313expresses whether a task can run in parallel with another. Threads,
1414synchronization and concurrency rate control are handled automatically. The
1515library has been written keeping high performance applications in mind.
1616
17−Asyncly subsumes all the use cases of list transformer (list-t) and logic
17+Streamly subsumes all the use cases of list transformer (list-t) and logic
1818programming (logict) monads and adds concurrency on top. It is a streaming
1919library and therefore can be used for most of the streaming use cases as well
2020(i.e. where you would use conduit or pipes) with concurrency added. It is
@@ -29,16 +29,16 @@ directory tree:
2929
3030``` haskell
3131import Path.IO (listDir, getCurrentDir)
32−import Asyncly
32+import Streamly
3333
34−main = runAsyncly $ getCurrentDir >>= readdir
34+main = runStreaming $ serially $ getCurrentDir >>= readdir
3535 where readdir d = do
3636 (dirs, files) <- lift $ listDir d
3737 liftIO $ mapM_ putStrLn $ map show files
3838 foldMapWith (<|>) readdir dirs
3939```
4040
41−See "Asyncly.Tutorial" and "Asyncly.Examples" for more details.
41+See "Streamly.Tutorial" and "Streamly.Examples" for more details.
4242
4343This library was originally inspired by the `transient`
4444package authored by Alberto G. Corona.
benchmark/Main.hs+33−33
@@ -9,8 +9,8 @@ import Control.Monad (guard)
99import Criterion.Main (defaultMain, bgroup, bench, nfIO)
1010import Data.Function ((&))
1111
12−import qualified Asyncly as A
13−import qualified Asyncly.Prelude as A
12+import qualified Streamly as A
13+import qualified Streamly.Prelude as A
1414
1515#ifdef EXTRA_BENCHMARKS
1616import Control.Monad.IO.Class (MonadIO (liftIO))
@@ -32,13 +32,13 @@ main :: IO ()
3232main = do
3333 -- XXX due to a GHC bug passing bind as an argument causes perf
3434 -- degradation, so we should keep that in account when comparing.
35− let as = asyncly_serial
36− ai = asyncly_interleaved
37− aa = asyncly_async
38− ap = asyncly_parallel
35+ let as = streamly_serial
36+ ai = streamly_interleaved
37+ aa = streamly_async
38+ ap = streamly_parallel
3939 defaultMain [
40− bgroup "asyncly"
41− [ bench "function style all serial" $ nfIO asyncly_function_style
40+ bgroup "streamly"
41+ [ bench "function style all serial" $ nfIO streamly_function_style
4242
4343 , bgroup "serial bind"
4444 [ bench "serial" $ nfIO (as (A.<>))
@@ -70,10 +70,10 @@ main = do
7070
7171 -- Benchmark smallest possible actions composed together
7272 , bgroup "serial bind nil"
73− [ bench "serial" $ nfIO (asyncly_nil (A.<>))
74− , bench "fair serial" $ nfIO (asyncly_nil (A.<=>))
75− , bench "left parallel" $ nfIO (asyncly_nil (A.<|))
76− , bench "fair parallel" $ nfIO (asyncly_nil (A.<|>))
73+ [ bench "serial" $ nfIO (streamly_nil (A.<>))
74+ , bench "fair serial" $ nfIO (streamly_nil (A.<=>))
75+ , bench "left parallel" $ nfIO (streamly_nil (A.<|))
76+ , bench "fair parallel" $ nfIO (streamly_nil (A.<|>))
7777 ]
7878 ]
7979#ifdef EXTRA_BENCHMARKS
@@ -105,13 +105,13 @@ amap = Main.map
105105afilter :: (Alternative (s IO), Monad (s IO)) => (Int -> Bool) -> Int -> s IO Int
106106afilter = Main.filter
107107
108−{-# INLINE asyncly_basic #-}
109−asyncly_basic
108+{-# INLINE streamly_basic #-}
109+streamly_basic
110110 :: (Alternative (t IO), Monad (t IO), A.Streaming t)
111111 => (forall a. t IO a -> IO [a])
112112 -> (t IO Int -> t IO Int -> t IO Int)
113113 -> IO Int
114−asyncly_basic tl g = do
114+streamly_basic tl g = do
115115 xs <- tl $ do
116116 A.drop 100 (A.forEachWith g [1..100000 :: Int] $ \x ->
117117 afilter even x >>= amap (+1))
@@ -120,9 +120,9 @@ asyncly_basic tl g = do
120120 assert (Prelude.length xs == 49900) $
121121 return (Prelude.length xs)
122122
123−{-# INLINE asyncly_function_style #-}
124−asyncly_function_style :: IO Int
125−asyncly_function_style = do
123+{-# INLINE streamly_function_style #-}
124+streamly_function_style :: IO Int
125+streamly_function_style = do
126126 xs <- A.toList $ A.serially $
127127 A.each [1..100000 :: Int]
128128 & A.filter even
@@ -133,34 +133,34 @@ asyncly_function_style = do
133133 assert (Prelude.length xs == 49900) $
134134 return (Prelude.length xs)
135135
136−{-# INLINE asyncly_serial #-}
137−asyncly_serial
136+{-# INLINE streamly_serial #-}
137+streamly_serial
138138 :: (A.StreamT IO Int -> A.StreamT IO Int -> A.StreamT IO Int)
139139 -> IO Int
140−asyncly_serial = asyncly_basic (A.toList . A.serially)
140+streamly_serial = streamly_basic (A.toList . A.serially)
141141
142−{-# INLINE asyncly_interleaved #-}
143−asyncly_interleaved
142+{-# INLINE streamly_interleaved #-}
143+streamly_interleaved
144144 :: (A.InterleavedT IO Int -> A.InterleavedT IO Int -> A.InterleavedT IO Int)
145145 -> IO Int
146−asyncly_interleaved = asyncly_basic (A.toList . A.interleaving)
146+streamly_interleaved = streamly_basic (A.toList . A.interleaving)
147147
148−{-# INLINE asyncly_async #-}
149−asyncly_async
148+{-# INLINE streamly_async #-}
149+streamly_async
150150 :: (A.AsyncT IO Int -> A.AsyncT IO Int -> A.AsyncT IO Int)
151151 -> IO Int
152−asyncly_async = asyncly_basic (A.toList . A.asyncly)
152+streamly_async = streamly_basic (A.toList . A.asyncly)
153153
154−{-# INLINE asyncly_parallel #-}
155−asyncly_parallel
154+{-# INLINE streamly_parallel #-}
155+streamly_parallel
156156 :: (A.ParallelT IO Int -> A.ParallelT IO Int -> A.ParallelT IO Int)
157157 -> IO Int
158−asyncly_parallel = asyncly_basic (A.toList . A.parallely)
158+streamly_parallel = streamly_basic (A.toList . A.parallely)
159159
160−{-# INLINE asyncly_nil #-}
161−asyncly_nil :: (A.StreamT IO Int -> A.StreamT IO Int -> A.StreamT IO Int)
160+{-# INLINE streamly_nil #-}
161+streamly_nil :: (A.StreamT IO Int -> A.StreamT IO Int -> A.StreamT IO Int)
162162 -> IO Int
163−asyncly_nil f = do
163+streamly_nil f = do
164164 xs <- (A.toList . A.serially) $ do
165165 (A.forEachWith f [1..100000:: Int] $
166166 \x -> return x >>= return . id)
examples/echo-loop.hs+1−1
@@ -1,5 +1,5 @@
11import Control.Monad.IO.Class (liftIO)
2−import Asyncly
2+import Streamly
33
44input :: StreamT IO String
55input = do
examples/loops.hs+1−1
@@ -1,4 +1,4 @@
1−import Asyncly
1+import Streamly
22import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
33
44main = do
examples/map-reduce.hs+2−2
@@ -1,5 +1,5 @@
1−import Asyncly
2−import Asyncly.Prelude as A
1+import Streamly
2+import Streamly.Prelude as A
33
44main = do
55 s <- A.sum $ serially $ forEachWith (<|) [1..100] $ \x -> return (x * x)
examples/nested-loops.hs+1−1
@@ -3,7 +3,7 @@ import Control.Concurrent (myThreadId)
33import Control.Monad.IO.Class (liftIO)
44import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
55import System.Random (randomIO)
6−import Asyncly
6+import Streamly
77
88main = runStreamT $ do
99 liftIO $ hSetBuffering stdout LineBuffering
examples/parallel-loops.hs+1−1
@@ -3,7 +3,7 @@ import Control.Concurrent (myThreadId, threadDelay)
33import Control.Monad.IO.Class (liftIO)
44import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
55import System.Random (randomIO)
6−import Asyncly
6+import Streamly
77
88main = runStreamT $ do
99 liftIO $ hSetBuffering stdout LineBuffering
src/Asyncly.hs → src/Streamly.hsrenamed+11−11
@@ -1,5 +1,5 @@
11-- |
2−-- Module : Asyncly
2+-- Module : Streamly
33-- Copyright : (c) 2017 Harendra Kumar
44--
55-- License : BSD3
@@ -37,21 +37,21 @@
3737-- <https://hackage.haskell.org/package/reflex reflex>).
3838--
3939-- When it comes to streaming composition, if @conduit@ or @pipes@ are arrows
40−-- then asyncly is monad. Streaming libraries like conduit or pipes provide
41−-- a categorical composition (sum) of streams whereas asyncly provides a more
42−-- general monadic composition (product) of streams, with concurrency. Asyncly
43−-- interworks with major streaming libraries providing a way to use both types
44−-- of compositions and using the right tool at the right place.
45−-- When it comes to concurrency, asyncly may be comared with
46−-- imperative style concurrency frameworks like
40+-- then streamly is monad. Streaming libraries like conduit or pipes provide
41+-- a categorical composition (sum) of streams whereas streamly provides a more
42+-- general monadic composition (product) of streams, with concurrency.
43+-- Streamly interworks with major streaming libraries providing a way to use
44+-- both types of compositions and using the right tool at the right place.
45+-- When it comes to concurrency, streamly may be comared with imperative style
46+-- concurrency frameworks like
4747-- <https://en.wikipedia.org/wiki/OpenMP OpenMP> or
4848-- <https://en.wikipedia.org/wiki/Cilk Cilk>.
4949--
50−-- For more details please see the 'Asyncly.Tutorial' and 'Asyncly.Examples'.
50+-- For more details please see the 'Streamly.Tutorial' and 'Streamly.Examples'.
5151
5252-- A simple inline example here illustrating applicative, monad and alternative
5353-- compositions.
54−module Asyncly
54+module Streamly
5555 ( MonadAsync
5656 , Streaming
5757
@@ -104,7 +104,7 @@ module Asyncly
104104 )
105105where
106106
107−import Asyncly.Streams
107+import Streamly.Streams
108108import Data.Semigroup (Semigroup(..))
109109import Control.Applicative (Alternative(..))
110110import Control.Monad (MonadPlus(..))
src/Asyncly/Core.hs → src/Streamly/Core.hsrenamed+2−2
@@ -6,7 +6,7 @@
66{-# LANGUAGE UndecidableInstances #-} -- XXX
77
88-- |
9−-- Module : Asyncly.Core
9+-- Module : Streamly.Core
1010-- Copyright : (c) 2017 Harendra Kumar
1111--
1212-- License : BSD3
@@ -15,7 +15,7 @@
1515-- Portability : GHC
1616--
1717--
18−module Asyncly.Core
18+module Streamly.Core
1919 (
2020 MonadAsync
2121
src/Asyncly/Examples/AcidRainGame.hs → src/Streamly/Examples/AcidRainGame.hsrenamed+2−2
@@ -3,9 +3,9 @@
33-- This example is adapted from Gabriel Gonzalez's pipes-concurrency package.
44-- https://hackage.haskell.org/package/pipes-concurrency-2.0.8/docs/Pipes-Concurrent-Tutorial.html
55
6−module Asyncly.Examples.AcidRainGame where
6+module Streamly.Examples.AcidRainGame where
77
8−import Asyncly
8+import Streamly
99import Control.Concurrent (threadDelay)
1010import Control.Monad (when)
1111import Control.Monad.State
src/Asyncly/Examples/CirclingSquare.hs → src/Streamly/Examples/CirclingSquare.hsrenamed+4−4
@@ -1,16 +1,16 @@
11-- Adapted from the Yampa package.
22-- Displays a square moving in a circle. To move the position drag the mouse.
33--
4−-- Requires the SDL package, assuming asyncly has already been built, you can
4+-- Requires the SDL package, assuming streamly has already been built, you can
55-- compile it like this:
66-- stack ghc --package SDL circle-mouse.hs
77
8−module Asyncly.Examples.CirclingSquare where
8+module Streamly.Examples.CirclingSquare where
99
1010import Data.IORef
1111import Graphics.UI.SDL as SDL
12−import Asyncly
13−import Asyncly.Time
12+import Streamly
13+import Streamly.Time
1414
1515------------------------------------------------------------------------------
1616-- SDL Graphics Init
src/Asyncly/Examples/ListDirRecursive.hs → src/Streamly/Examples/ListDirRecursive.hsrenamed+2−2
@@ -1,10 +1,10 @@
11{-# LANGUAGE FlexibleContexts #-}
22
3−module Asyncly.Examples.ListDirRecursive where
3+module Streamly.Examples.ListDirRecursive where
44
55import Path.IO (listDir, getCurrentDir)
66import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
7−import Asyncly
7+import Streamly
88
99listDirRecursive :: IO ()
1010listDirRecursive = do
src/Asyncly/Examples/MergeSortedStreams.hs → src/Streamly/Examples/MergeSortedStreams.hsrenamed+3−3
@@ -1,12 +1,12 @@
11{-# LANGUAGE FlexibleContexts #-}
22
3−module Asyncly.Examples.MergeSortedStreams where
3+module Streamly.Examples.MergeSortedStreams where
44
55import Data.Word
66import System.Random
77import Data.List (sort)
8−import Asyncly
9−import qualified Asyncly.Prelude as A
8+import Streamly
9+import qualified Streamly.Prelude as A
1010
1111getSorted :: MonadIO m => StreamT m Word16
1212getSorted = do
src/Asyncly/Examples/SearchEngineQuery.hs → src/Streamly/Examples/SearchEngineQuery.hsrenamed+2−2
@@ -1,6 +1,6 @@
1−module Asyncly.Examples.SearchEngineQuery where
1+module Streamly.Examples.SearchEngineQuery where
22
3−import Asyncly
3+import Streamly
44import Network.HTTP.Simple
55
66-- Runs three search engine queries in parallel.
src/Asyncly/Prelude.hs → src/Streamly/Prelude.hsrenamed+4−4
@@ -8,7 +8,7 @@
88{-# LANGUAGE UndecidableInstances #-} -- XXX
99
1010-- |
11−-- Module : Asyncly.Prelude
11+-- Module : Streamly.Prelude
1212-- Copyright : (c) 2017 Harendra Kumar
1313--
1414-- License : BSD3
@@ -17,7 +17,7 @@
1717-- Portability : GHC
1818--
1919--
20−module Asyncly.Prelude
20+module Streamly.Prelude
2121 (
2222 -- * Construction
2323 cons
@@ -81,8 +81,8 @@ import Prelude hiding (filter, drop, dropWhile, take,
8181import qualified Prelude as Prelude
8282import qualified System.IO as IO
8383
84−import Asyncly.Core
85−import Asyncly.Streams
84+import Streamly.Core
85+import Streamly.Streams
8686
8787------------------------------------------------------------------------------
8888-- Construction
src/Asyncly/Streams.hs → src/Streamly/Streams.hsrenamed+3−3
@@ -7,7 +7,7 @@
77{-# LANGUAGE UndecidableInstances #-} -- XXX
88
99-- |
10−-- Module : Asyncly.Streams
10+-- Module : Streamly.Streams
1111-- Copyright : (c) 2017 Harendra Kumar
1212--
1313-- License : BSD3
@@ -16,7 +16,7 @@
1616-- Portability : GHC
1717--
1818--
19−module Asyncly.Streams
19+module Streamly.Streams
2020 (
2121 -- * Product Style Composition
2222 -- $product
@@ -97,7 +97,7 @@ import Control.Monad.State.Class (MonadState(..))
9797import Control.Monad.Trans.Class (MonadTrans)
9898import Data.Semigroup (Semigroup(..))
9999import Prelude hiding (drop, take, zipWith)
100−import Asyncly.Core
100+import Streamly.Core
101101
102102-- $product
103103--
src/Asyncly/Time.hs → src/Streamly/Time.hsrenamed+2−2
@@ -1,5 +1,5 @@
11-- |
2−-- Module : Asyncly.Time
2+-- Module : Streamly.Time
33-- Copyright : (c) 2017 Harendra Kumar
44--
55-- License : BSD3
@@ -9,7 +9,7 @@
99--
1010-- Time utilities for reactive programming.
1111
12−module Asyncly.Time
12+module Streamly.Time
1313 ( periodic
1414 , withClock
1515 )
src/Asyncly/Tutorial.hs → src/Streamly/Tutorial.hsrenamed+25−25
@@ -1,12 +1,12 @@
11{-# OPTIONS_GHC -fno-warn-unused-imports #-}
22-- |
3−-- Module : Asyncly.Tutorial
3+-- Module : Streamly.Tutorial
44-- Copyright : (c) 2017 Harendra Kumar
55--
66-- License : BSD3
77-- Maintainer : harendra.kumar@gmail.com
88--
9−-- Asyncly combines streaming, logic programming, concurrency and reactive
9+-- Streamly combines streaming, logic programming, concurrency and reactive
1010-- programming under a single abstraction with a concise API, giving
1111-- programmers a simple yet powerful tool for wide variety of applications.
1212--
@@ -26,18 +26,18 @@
2626-- iterations of a loop, '>>|' runs iterations in parallel and '>|>' runs all
2727-- iterations in fairly parallel manner.
2828--
29−-- With asyncly you can write concurrent and streaming applications without
29+-- With streamly you can write concurrent and streaming applications without
3030-- being aware of threads or synchronization. No explicit thread control is
3131-- needed, where applicable the concurrency rate is automatically controlled
3232-- based on the demand by the consumer. However, combinators are provided to
3333-- 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
3535-- simple SDL based FRP example.
3636--
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
3838-- well.
3939--
40−module Asyncly.Tutorial
40+module Streamly.Tutorial
4141 (
4242 -- * AsyncT Monad Transformer
4343 -- $transformer
@@ -116,9 +116,9 @@ module Asyncly.Tutorial
116116 )
117117where
118118
119−import Asyncly.Core
120−import Asyncly.Prelude
121−-- import Asyncly.Examples
119+import Streamly.Core
120+import Streamly.Prelude
121+-- import Streamly.Examples
122122import Data.Semigroup
123123import Control.Applicative
124124import Control.Monad
@@ -156,7 +156,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
156156-- to deconstruct an 'AsyncT' stream into head and tail.
157157--
158158-- @
159−-- import Asyncly
159+-- import Streamly
160160--
161161-- main = do
162162-- runAsyncly $ liftIO $ putStrLn "Hello world!"
@@ -174,7 +174,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
174174-- specified by the argument in seconds and then prints the argument.
175175--
176176-- @
177−-- import Asyncly
177+-- import Streamly
178178-- import Control.Concurrent
179179--
180180-- traced m = liftIO (myThreadId >>= print) >> m
@@ -289,7 +289,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
289289-- name of the search engine as a response arrives:
290290--
291291-- @
292−-- import Asyncly
292+-- import Streamly
293293-- import Network.HTTP.Simple
294294--
295295-- main = runAsyncly $ google \<|> bing \<|> duckduckgo
@@ -309,7 +309,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
309309-- Take an example of a merge sort of two sorted streams. We need to keep
310310-- consuming items from the stream which has the lowest item in the sort order.
311311-- This can be achieved using async references to streams. See
312−-- 'Asyncly.Examples.MergeSortedStreams'.
312+-- 'Streamly.Examples.MergeSortedStreams'.
313313
314314-- $monoid
315315--
@@ -324,7 +324,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
324324-- the function argument.
325325--
326326-- @
327−-- import Asyncly
327+-- import Streamly
328328--
329329-- main = do
330330-- runAsyncly $ liftIO $ putStrLn "Hello world!"
@@ -352,7 +352,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
352352-- all elements of the stream using 'fmap'.
353353--
354354-- @
355−-- import Asyncly
355+-- import Streamly
356356--
357357-- main = do
358358-- let nums = foldMapWith (<>) return [1..10]
@@ -395,7 +395,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
395395-- loop:
396396--
397397-- @
398−-- import Asyncly
398+-- import Streamly
399399-- import Data.Semigroup (cycle1)
400400--
401401-- main = runAsyncly $ do
@@ -430,7 +430,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
430430-- example:
431431--
432432-- @
433−-- import Asyncly
433+-- import Streamly
434434--
435435-- main = runAsyncly $
436436-- sizes >-> \\sz ->
@@ -449,7 +449,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
449449-- $concurrentNesting
450450--
451451-- @
452−-- import Asyncly
452+-- import Streamly
453453-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
454454-- import Control.Concurrent
455455--
@@ -476,7 +476,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
476476-- $fairlyConcurrentNesting
477477--
478478-- @
479−-- import Asyncly
479+-- import Streamly
480480-- import System.IO (stdout, hSetBuffering, BufferMode(LineBuffering))
481481-- import Control.Concurrent
482482--
@@ -516,7 +516,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
516516-- sum and print them serially:
517517--
518518-- @
519−-- import Asyncly
519+-- import Streamly
520520-- import Data.List (sum)
521521--
522522-- main = do
@@ -529,7 +529,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
529529-- monadic bind.
530530--
531531-- @
532−-- import Asyncly
532+-- import Streamly
533533-- import Data.List (sum)
534534--
535535-- main = do
@@ -544,7 +544,7 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
544544-- Let us see a reactive programming example:
545545--
546546-- @
547−-- import Asyncly
547+-- import Streamly
548548-- import Control.Concurrent (threadDelay)
549549-- import Control.Monad (when)
550550-- import Control.Monad.State
@@ -588,13 +588,13 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
588588
589589-- $comparison
590590--
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
592592-- 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
594594-- 'async' is applicative and monads and applicatives both have their use
595595-- cases. It can completely repalce 'async', the ZipAsync type is equivalent to
596596-- the functionality provided by 'async'.
597597--
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
599599-- would use pipes and conduit when you do not need the product style
600600-- composition and the implicit concurrency.
asyncly.cabal → streamly.cabalrenamed+28−28
@@ -1,17 +1,17 @@
1−name: asyncly
1+name: streamly
22version: 0.1.0
33synopsis: Beautiful Streaming, Concurrent and Reactive Composition
4−description: Asyncly is a general streaming and concurrent programming
4+description: Streamly is a general streaming and concurrent programming
55 monad allowing you to write a wide variety of applications ranging from
66 simple applications utilizing streaming IO to massively parallel concurrent
77 applications as well as reactive (FRP) applications with the same ease.
8− Asyncly provides high level concurrency primitives and hides the low level
8+ Streamly provides high level concurrency primitives and hides the low level
99 concurrency details completely from the programmer. The programmer just
1010 expresses whether a task can run in parallel with another. Threads,
1111 synchronization and concurrency rate control are handled automatically. The
1212 library has been written keeping high performance applications in mind.
1313 .
14− Asyncly subsumes all the use cases of list transformer (list-t) and logic
14+ Streamly subsumes all the use cases of list transformer (list-t) and logic
1515 programming (logict) monads and adds concurrency on top. It is a streaming
1616 library and therefore can be used for most of the streaming use cases as well
1717 (i.e. where you would use conduit or pipes) with concurrency added. It is
@@ -25,20 +25,20 @@ description: Asyncly is a general streaming and concurrent programming
2525 a directory tree:
2626 .
2727 > import Path.IO (listDir, getCurrentDir)
28− > import Asyncly
28+ > import Streamly
2929 >
30− > main = runAsyncly $ getCurrentDir >>= readdir
30+ > main = runStreamly $ getCurrentDir >>= readdir
3131 > where readdir d = do
3232 > (dirs, files) <- lift $ listDir d
3333 > liftIO $ mapM_ putStrLn $ map show files
3434 > foldMapWith (<|>) readdir dirs
3535 .
36− See "Asyncly.Tutorial" and "Asyncly.Examples" for more details.
36+ See "Streamly.Tutorial" and "Streamly.Examples" for more details.
3737 .
3838 This library was originally inspired by the `transient`
3939 package authored by Alberto G. Corona.
40−homepage: http://github.com/harendra-kumar/asyncly
41−bug-reports: https://github.com/harendra-kumar/asyncly/issues
40+homepage: http://github.com/harendra-kumar/streamly
41+bug-reports: https://github.com/harendra-kumar/streamly/issues
4242license: BSD3
4343license-file: LICENSE
4444author: Harendra Kumar
@@ -51,7 +51,7 @@ cabal-version: >= 1.10
5151
5252source-repository head
5353 type: git
54− location: https://github.com/harendra-kumar/asyncly
54+ location: https://github.com/harendra-kumar/streamly
5555
5656flag dev
5757 description: Build development version
@@ -70,18 +70,18 @@ flag examples
7070
7171library
7272 hs-source-dirs: src
73− exposed-modules: Asyncly.Core
74− , Asyncly.Streams
75− , Asyncly.Prelude
76− , Asyncly.Time
77− , Asyncly.Tutorial
78− , Asyncly
73+ exposed-modules: Streamly.Core
74+ , Streamly.Streams
75+ , Streamly.Prelude
76+ , Streamly.Time
77+ , Streamly.Tutorial
78+ , Streamly
7979 if flag(examples)
80− exposed-modules: Asyncly.Examples.SearchEngineQuery
81− , Asyncly.Examples.ListDirRecursive
82− , Asyncly.Examples.MergeSortedStreams
83− , Asyncly.Examples.AcidRainGame
84− , Asyncly.Examples.CirclingSquare
80+ exposed-modules: Streamly.Examples.SearchEngineQuery
81+ , Streamly.Examples.ListDirRecursive
82+ , Streamly.Examples.MergeSortedStreams
83+ , Streamly.Examples.AcidRainGame
84+ , Streamly.Examples.CirclingSquare
8585
8686 default-language: Haskell2010
8787 ghc-options: -Wall
@@ -141,7 +141,7 @@ test-suite test
141141 -Wnoncanonical-monad-instances
142142 -Wnoncanonical-monadfail-instances
143143 build-depends:
144− asyncly
144+ streamly
145145 , base >= 4.8 && < 5
146146 , hspec >= 2.0 && < 3
147147 , containers >= 0.5 && < 0.6
@@ -169,7 +169,7 @@ benchmark bench
169169 -Wnoncanonical-monad-instances
170170 -Wnoncanonical-monadfail-instances
171171 build-depends:
172− asyncly
172+ streamly
173173 , atomic-primops >= 0.8 && < 0.9
174174 , base >= 4.8 && < 5
175175 , criterion >= 1 && < 2
@@ -199,7 +199,7 @@ executable echo-loop
199199 if flag(examples)
200200 buildable: True
201201 build-Depends:
202− asyncly
202+ streamly
203203 , base >= 4.8 && < 5
204204 else
205205 buildable: False
@@ -210,7 +210,7 @@ executable loops
210210 if flag(examples)
211211 buildable: True
212212 build-Depends:
213− asyncly
213+ streamly
214214 , base >= 4.8 && < 5
215215 else
216216 buildable: False
@@ -221,7 +221,7 @@ executable map-reduce
221221 if flag(examples)
222222 buildable: True
223223 build-Depends:
224− asyncly
224+ streamly
225225 , base >= 4.8 && < 5
226226 else
227227 buildable: False
@@ -232,7 +232,7 @@ executable nested-loops
232232 if flag(examples)
233233 buildable: True
234234 build-Depends:
235− asyncly
235+ streamly
236236 , base >= 4.8 && < 5
237237 , random
238238 else
@@ -244,7 +244,7 @@ executable parallel-loops
244244 if flag(examples)
245245 buildable: True
246246 build-Depends:
247− asyncly
247+ streamly
248248 , base >= 4.8 && < 5
249249 , random
250250 else
test/Main.hs+3−3
@@ -8,8 +8,8 @@ import Data.Foldable (forM_)
88import Data.List (sort)
99import Test.Hspec
1010
11−import Asyncly
12−import qualified Asyncly.Prelude as A
11+import Streamly
12+import qualified Streamly.Prelude as A
1313
1414toListSerial :: StreamT IO a -> IO [a]
1515toListSerial = A.toList . serially
@@ -385,7 +385,7 @@ timed x = liftIO (threadDelay (x * 100000)) >> return x
385385
386386thenBind :: Spec
387387thenBind = do
388− it "Simple runAsyncly and 'then' with IO" $
388+ it "Simple runStreaming and 'then' with IO" $
389389 (runStreaming . serially) (liftIO (putStrLn "hello") >> liftIO (putStrLn "world"))
390390 `shouldReturn` ()
391391 it "Then and toList" $