@@ -24,7 +24,9 @@
24-- Continuation passing style (CPS) stream implementation. The symbol 'K' below
24-- Continuation passing style (CPS) stream implementation. The symbol 'K' below
25-- denotes a function as well as a Kontinuation.
25-- denotes a function as well as a Kontinuation.
27-- import qualified Streamly.Streams.StreamK as K
28-- import qualified Streamly.Streams.StreamK as K
29module Streamly.Streams.StreamK
31module Streamly.Streams.StreamK
@@ -38,8 +40,6 @@ module Streamly.Streams.StreamK
38 -- * Construction
40 -- * Construction
39 , mkStream
41 , mkStream
@@ -48,27 +48,33 @@ module Streamly.Streams.StreamK
51− -- * Generation
51+ -- * Generation by Unfolding
53 , unfoldrM
53 , unfoldrM
55+ -- * Special Generation
55 , fromFoldable
59 , fromFoldable
57− -- * Elimination
61+ -- * Elimination by Folding
58 , foldStream
63 , foldStream
66 , runStream
72 , runStream
71− -- * Transformation
77+ -- * Mapping
@@ -99,14 +105,16 @@ import Streamly.SVar
99-- The basic stream type
105-- The basic stream type
100------------------------------------------------------------------------------
106------------------------------------------------------------------------------
102−-- | The type 'Stream m a' represents a monadic stream of values of type 'a'
108+-- | The type @Stream m a@ represents a monadic stream of values of type 'a'
103-- constructed using actions in monad 'm'. It uses stop, singleton and yield
109-- constructed using actions in monad 'm'. It uses stop, singleton and yield
104-- continuations equivalent to the following direct style type:
110-- continuations equivalent to the following direct style type:
106-- data Stream m a = Stop | Singleton a | Yield a (Stream m a)
113-- data Stream m a = Stop | Singleton a | Yield a (Stream m a)
108−-- To facilitate parallel composition we maintain a local state in an SVar that
116+-- To facilitate parallel composition we maintain a local state in an 'SVar'
109−-- is shared across and is used for synchronization of the streams being
117+-- that is shared across and is used for synchronization of the streams being
110-- composed.
118-- composed.
112-- The singleton case can be expressed in terms of stop and yield but we have
120-- The singleton case can be expressed in terms of stop and yield but we have