on master help sign in
Update docs.
5b1da6bPranay Sashank
README.md+2−2
@@ -95,7 +95,7 @@ performance results and a comparison with the `async` package.
95
95
96## Installing and using
96## Installing and using
97
97
98−Please see [INSTALL.md](INSTALL.md) for instructions on how to use streamly
98+Please see [INSTALL.md](./INSTALL.md) for instructions on how to use streamly
99with your Haskell build tool or package manager. You may want to go through it
99with your Haskell build tool or package manager. You may want to go through it
100before jumping to run the examples below.
100before jumping to run the examples below.
101
101
@@ -508,7 +508,7 @@ In presence of concurrency, synchronous exceptions work just the way they are
508supposed to work in non-concurrent code. When concurrent streams
508supposed to work in non-concurrent code. When concurrent streams
509are combined together, exceptions from the constituent streams are propagated
509are combined together, exceptions from the constituent streams are propagated
510to the consumer stream. When an exception occurs in any of the constituent
510to the consumer stream. When an exception occurs in any of the constituent
511−streams other concurrent streams are promptly terminated.
511+streams other concurrent streams are promptly terminated.
512
512
513There is no notion of explicit threads in streamly, therefore, no
513There is no notion of explicit threads in streamly, therefore, no
514asynchronous exceptions to deal with. You can just ignore the zillions of
514asynchronous exceptions to deal with. You can just ignore the zillions of
src/Streamly/Data/Unfold.hs+8−8
@@ -22,8 +22,8 @@
22-- values from a single starting value often called a seed value. Values can be
22-- values from a single starting value often called a seed value. Values can be
23-- generated and /pulled/ from the 'Unfold' one at a time. It can also be
23-- generated and /pulled/ from the 'Unfold' one at a time. It can also be
24-- called a producer or a source of stream. It is a data representation of the
24-- called a producer or a source of stream. It is a data representation of the
25−-- standard 'S.unfoldr' function. An 'Unfold' can be converted into a stream
25+-- standard 'Streamly.Prelude.unfoldr' function. An 'Unfold' can be converted
26−-- type using 'S.unfold' by supplying the seed.
26+-- into a stream type using 'Streamly.Prelude.unfold' by supplying the seed.
27--
27--
28-- = Performance Notes
28-- = Performance Notes
29--
29--
@@ -34,13 +34,13 @@
34-- @Unfold m a b@ can be considered roughly equivalent to an action @a -> t m
34-- @Unfold m a b@ can be considered roughly equivalent to an action @a -> t m
35-- b@ (where @t@ is a stream type). Instead of using an 'Unfold' one could just
35-- b@ (where @t@ is a stream type). Instead of using an 'Unfold' one could just
36-- use a function of the shape @a -> t m b@. However, working with stream types
36-- use a function of the shape @a -> t m b@. However, working with stream types
37−-- like 'S.SerialT' does not allow the compiler to perform stream fusion
37+-- like t'Streamly.SerialT' does not allow the compiler to perform stream fusion
38-- optimization when merging, appending or concatenating multiple streams.
38-- optimization when merging, appending or concatenating multiple streams.
39-- Even though stream based combinator have excellent performance, they are
39-- Even though stream based combinator have excellent performance, they are
40-- much less efficient when compared to combinators using 'Unfold'. For
40-- much less efficient when compared to combinators using 'Unfold'. For
41−-- example, the 'S.concatMap' combinator which uses @a -> t m b@ (where @t@ is
41+-- example, the 'Streamly.Prelude.concatMap' combinator which uses @a -> t m b@
42−-- a stream type) to generate streams is much less efficient compared to
42+-- (where @t@ is a stream type) to generate streams is much less efficient
43−-- 'S.concatUnfold'.
43+-- compared to 'Streamly.Prelude.concatUnfold'.
44--
44--
45-- On the other hand, transformation operations on stream types are as
45-- On the other hand, transformation operations on stream types are as
46-- efficient as transformations on 'Unfold'.
46-- efficient as transformations on 'Unfold'.
@@ -58,8 +58,8 @@
58-- More, not yet exposed, unfold combinators can be found in
58-- More, not yet exposed, unfold combinators can be found in
59-- "Streamly.Internal.Data.Unfold".
59-- "Streamly.Internal.Data.Unfold".
60
60
61−-- The stream types (e.g. 'S.SerialT') can be considered as a special case of
61+-- The stream types (e.g. t'Streamly.SerialT') can be considered as a special
62−-- 'Unfold' with no starting seed.
62+-- case of 'Unfold' with no starting seed.
63--
63--
64module Streamly.Data.Unfold
64module Streamly.Data.Unfold
65 (
65 (
src/Streamly/Data/Unicode/Stream.hs+3−2
@@ -58,8 +58,9 @@
58--
58--
59-- = Experimental APIs
59-- = Experimental APIs
60--
60--
61−-- Some experimental APIs to conveniently process text using the @Array Char@
61+-- Some experimental APIs to conveniently process text using the
62−-- represenation directly can be found in "Streamly.Internal.Unicode.Array".
62+-- @Array Char@ represenation directly can be found in
63+-- "Streamly.Internal.Memory.Unicode.Array".
63
64
64-- XXX an unpinned array representation can be useful to store short and short
65-- XXX an unpinned array representation can be useful to store short and short
65-- lived strings in memory.
66-- lived strings in memory.
src/Streamly/Internal/Data/Fold.hs+2−2
@@ -623,7 +623,7 @@ foldMapM act = Fold step begin done
623-- | Folds the input stream to a list.
623-- | Folds the input stream to a list.
624--
624--
625-- /Warning!/ working on large lists accumulated as buffers in memory could be
625-- /Warning!/ working on large lists accumulated as buffers in memory could be
626−-- very inefficient, consider using "Streamly.Array" instead.
626+-- very inefficient, consider using "Streamly.Memory.Array" instead.
627--
627--
628-- @since 0.7.0
628-- @since 0.7.0
629
629
@@ -641,7 +641,7 @@ toList = Fold (\f x -> return $ f . (x :))
641-- | A fold that drains the first n elements of its input, running the effects
641-- | A fold that drains the first n elements of its input, running the effects
642-- and discarding the results.
642-- and discarding the results.
643{-# INLINABLE drainN #-}
643{-# INLINABLE drainN #-}
644−drainN :: Monad m => Int -> Fold m a ()
644+drainN :: Monad m => Int -> Fold m a ()
645drainN n = ltake n drain
645drainN n = ltake n drain
646
646
647-- | A fold that drains elements of its input as long as the predicate succeeds,
647-- | A fold that drains elements of its input as long as the predicate succeeds,
src/Streamly/Internal/Data/Sink/Types.hs+3−3
@@ -16,9 +16,9 @@ where
16-- Sink
16-- Sink
17------------------------------------------------------------------------------
17------------------------------------------------------------------------------
18
18
19−-- | A 'Sink' is a special type of 'Foldl' that does not accumulate any value,
19+-- | A 'Sink' is a special type of 'Fold' that does not accumulate any value,
20-- but runs only effects. A 'Sink' has no state to maintain therefore can be a
20-- but runs only effects. A 'Sink' has no state to maintain therefore can be a
21−-- bit more efficient than a 'Foldl' with '()' as the state, especially when
21+-- bit more efficient than a 'Fold' with '()' as the state, especially when
22-- 'Sink's are composed with other operations. A Sink can be upgraded to a
22-- 'Sink's are composed with other operations. A Sink can be upgraded to a
23−-- 'Foldl', but a 'Foldl' cannot be converted into a Sink.
23+-- 'Fold', but a 'Fold' cannot be converted into a Sink.
24data Sink m a = Sink (a -> m ())
24data Sink m a = Sink (a -> m ())
src/Streamly/Internal/Prelude.hs+1−1
@@ -598,7 +598,7 @@ unfoldrMZipSerial = Serial.unfoldrM
598
598
599-- | Convert an 'Unfold' into a stream by supplying it an input seed.
599-- | Convert an 'Unfold' into a stream by supplying it an input seed.
600--
600--
601−-- >>> unfold UF.replicateM 10 (putStrLn "hello")
601+-- >>> unfold (UF.replicateM 10) (putStrLn "hello")
602--
602--
603-- /Since: 0.7.0/
603-- /Since: 0.7.0/
604{-# INLINE unfold #-}
604{-# INLINE unfold #-}
streamly.cabal+1−5
@@ -62,7 +62,7 @@ description:
62 .
62 .
63 Where to find more information:
63 Where to find more information:
64 .
64 .
65− * /Quick Overview/: <src/README.md README file> in the package
65+ * /Quick Overview/: <#readme README file> in the package
66 * /Building/: <src/docs/Build.md Build guide> for optimal performance
66 * /Building/: <src/docs/Build.md Build guide> for optimal performance
67 * /Detailed Tutorial/: "Streamly.Tutorial" module in the haddock documentation
67 * /Detailed Tutorial/: "Streamly.Tutorial" module in the haddock documentation
68 * /Interoperation/: "Streamly.Tutorial" module for interop with other
68 * /Interoperation/: "Streamly.Tutorial" module for interop with other
@@ -75,10 +75,6 @@ description:
75 * <https://github.com/composewell/streaming-benchmarks Streaming Benchmarks>
75 * <https://github.com/composewell/streaming-benchmarks Streaming Benchmarks>
76 * <https://github.com/composewell/concurrency-benchmarks Concurrency Benchmarks>
76 * <https://github.com/composewell/concurrency-benchmarks Concurrency Benchmarks>
77 .
77 .
78− For additional unreleased/experimental APIs, build the haddock docs using:
79− .
80− > $ cabal haddock --haddock-option="--show-all"
81− > $ stack haddock --haddock-arguments "--show-all" --no-haddock-deps
82
78
83
79
84homepage: https://github.com/composewell/streamly
80homepage: https://github.com/composewell/streamly