@@ -8,56 +8,55 @@
9## Stream`ing` `Concurrent`ly
9## Stream`ing` `Concurrent`ly
11−Streamly, short for streaming concurrently, is a simple yet powerful streaming
11+Streamly, short for streaming concurrently, provides monadic streams, with a
12−library with concurrent merging and concurrent nested looping support. A stream
12+simple API, almost identical to standard lists, and an in-built support for
13−is just like a list except that it is a list of monadic actions rather than
13+concurrency. By using stream-style combinators on stream composition,
14−pure values. Streamly streams can be generated, consumed, combined, or
14+streams can be generated, merged, chained, mapped, zipped, and consumed
15−transformed serially or concurrently. We can loop over a stream serially or
15+concurrently – providing a generalized high level programming framework
16−concurrently. We can also have serial or concurrent nesting of loops. For
16+unifying streaming and concurrency. Controlled concurrency allows even infinite
17−those familiar with the list transformer concept streamly is a concurrent list
17+streams to be evaluated concurrently. Concurrency is auto scaled based on
18−transformer. Streamly uses standard composition abstractions. Concurrent
19−composition is just the same as serial composition except that we use a simple
20−combinator to request a concurrent composition instead of serial. The
21−programmer does not have to be aware of threads, locking or synchronization to
18+feedback from the stream consumer. The programmer does not have to be aware of
22−write scalable concurrent programs.
19+threads, locking or synchronization to write scalable concurrent programs.
21+The basic streaming functionality of streamly is equivalent to that provided by
24−Streamly provides functionality that is equivalent to streaming libraries
22+streaming libraries like
25−like [pipes](https://hackage.haskell.org/package/pipes) and
23+[vector](https://hackage.haskell.org/package/vector),
26−[conduit](https://hackage.haskell.org/package/conduit) but with a list like
24+[streaming](https://hackage.haskell.org/package/streaming),
27−API. The streaming API of streamly is close to the monadic streams API of the
28−[vector](https://hackage.haskell.org/package/vector) package and similar in
25+[pipes](https://hackage.haskell.org/package/pipes), and
29−concept to the [streaming](https://hackage.haskell.org/package/streaming)
26+[conduit](https://hackage.haskell.org/package/conduit).
30−package. In addition to providing streaming functionality, streamly subsumes
27+In addition to providing streaming functionality, streamly subsumes
31the functionality of list transformer libraries like `pipes` or
28the functionality of list transformer libraries like `pipes` or
32−[list-t](https://hackage.haskell.org/package/list-t) and also the logic
29+[list-t](https://hackage.haskell.org/package/list-t), and also the logic
33programming library [logict](https://hackage.haskell.org/package/logict). On
30programming library [logict](https://hackage.haskell.org/package/logict). On
34the concurrency side, it subsumes the functionality of the
31the concurrency side, it subsumes the functionality of the
35[async](https://hackage.haskell.org/package/async) package. Because it supports
32[async](https://hackage.haskell.org/package/async) package. Because it supports
36streaming with concurrency we can write FRP applications similar in concept to
33streaming with concurrency we can write FRP applications similar in concept to
37[Yampa](https://hackage.haskell.org/package/Yampa) or
34[Yampa](https://hackage.haskell.org/package/Yampa) or
38−[reflex](https://hackage.haskell.org/package/reflex). To understand the
35+[reflex](https://hackage.haskell.org/package/reflex).
39−streaming library ecosystem and where streamly fits in you may want to read
40−[streaming libraries](https://github.com/composewell/streaming-benchmarks#streaming-libraries)
41−as well. Also see the [Comparison with Existing
42−Packages](https://hackage.haskell.org/package/streamly/docs/Streamly-Tutorial.html)
43−section in the streamly tutorial.
45Why use streamly?
37Why use streamly?
47− * Simple list like streaming API, if you know how to use lists then you know
39+ * _Simplicity_: Simple list like streaming API, if you know how to use lists
48− how to use streamly.
40+ then you know how to use streamly. This library is built with simplicity
41+ and ease of use as a design goal.
49− * Powerful yet simple and scalable concurrency. Concurrency is not intrusive,
42+ * _Concurrency_: Simple, powerful, and scalable concurrency. Concurrency is
50− concurrent programs are written exactly the same way as non-concurrent
43+ built-in, and not intrusive, concurrent programs are written exactly the
51− ones. There is no other package that provides such high level, simple and
44+ same way as non-concurrent ones.
52− flexible concurrency support.
53− * It is a general programming framework providing you all the necessary tools
54− to solve a wide range of programming problems, unifying the functionality
55− provided by several disparate packages in a concise and simple API.
45+ * _Generality_: Unifies functionality provided by several disparate packages
56− * Best in class performance. See
46+ (streaming, concurrency, list transformer, logic programming, reactive
47+ programming) in a concise API.
48+ * _Performance_: Streamly is designed for high performance. See
57 [streaming-benchmarks](https://github.com/composewell/streaming-benchmarks)
49 [streaming-benchmarks](https://github.com/composewell/streaming-benchmarks)
58 for a comparison of popular streaming libraries on micro-benchmarks.
50 for a comparison of popular streaming libraries on micro-benchmarks.
52+For more details on streaming library ecosystem and where streamly fits in,
54+[streaming libraries](https://github.com/composewell/streaming-benchmarks#streaming-libraries).
55+Also, see the [Comparison with Existing
56+Packages](https://hackage.haskell.org/package/streamly/docs/Streamly-Tutorial.html)
57+section in the streamly tutorial.
60− For more information, see:
59+For more information on streamly, see:
62 * [Streamly.Tutorial](https://hackage.haskell.org/package/streamly/docs/Streamly-Tutorial.html) module in the haddock documentation for a detailed introduction
61 * [Streamly.Tutorial](https://hackage.haskell.org/package/streamly/docs/Streamly-Tutorial.html) module in the haddock documentation for a detailed introduction
63 * [examples](https://github.com/composewell/streamly/tree/master/examples) directory in the package for some simple practical examples
62 * [examples](https://github.com/composewell/streamly/tree/master/examples) directory in the package for some simple practical examples
@@ -265,7 +264,7 @@ import Path.IO (listDir, getCurrentDir)
265import Streamly
264import Streamly
266import qualified Streamly.Prelude as S
265import qualified Streamly.Prelude as S
268−main = runStream $ asyncly $ getCurrentDir >>= readdir
267+main = runStream $ aheadly $ getCurrentDir >>= readdir
269 where readdir d = do
268 where readdir d = do
270 (dirs, files) <- S.once $ listDir d
269 (dirs, files) <- S.once $ listDir d
271 S.once $ mapM_ putStrLn $ map show files
270 S.once $ mapM_ putStrLn $ map show files
@@ -275,8 +274,8 @@ main = runStream $ asyncly $ getCurrentDir >>= readdir
276In the above examples we do not think in terms of threads, locking or
275In the above examples we do not think in terms of threads, locking or
277synchronization, rather we think in terms of what can run in parallel, the rest
276synchronization, rather we think in terms of what can run in parallel, the rest
278−is taken care of automatically. When using `asyncly` the programmer does
277+is taken care of automatically. When using `aheadly` the programmer does
279−not have to worry about how many threads are to be created they are
278+not have to worry about how many threads are to be created, they are
280automatically adjusted based on the demand of the consumer.
279automatically adjusted based on the demand of the consumer.
282The concurrency facilities provided by streamly can be compared with
281The concurrency facilities provided by streamly can be compared with