on master help sign in
improve docs, add operator mnemonics
082a4fcHarendra Kumar
src/Streamly.hs+6−5
@@ -180,11 +180,12 @@ import Data.Semigroup (Semigroup(..))
180
180
181-- $application
181-- $application
182--
182--
183−-- Several stream processing functions can be called in a chain using regular
183+-- Stream processing functions can be composed in a chain using function
184−-- function application, using the '$' operator or reverse function application
184+-- application with or without the '$' operator, or with reverse function
185−-- operator '&'. This section provides corresponding operators that can apply
185+-- application operator '&'. Streamly provides concurrent versions of these
186−-- stream processing functions such that ach stage of the stream can run in
186+-- operators applying stream processing functions such that each stage of the
187−-- parallel.
187+-- stream can run in parallel. The operators start with a @|@; we can read '|$'
188+-- as "@parallel dollar@" to remember that @|@ comes before '$'.
188--
189--
189-- Imports for the code snippets below:
190-- Imports for the code snippets below:
190--
191--
src/Streamly/Streams.hs+4−3
@@ -134,8 +134,8 @@ infixr 5 |:
134class IsStream t where
134class IsStream t where
135 toStream :: t m a -> S.Stream m a
135 toStream :: t m a -> S.Stream m a
136 fromStream :: S.Stream m a -> t m a
136 fromStream :: S.Stream m a -> t m a
137− -- | Constructs a stream by adding a monadic action at the head of an existing
137+ -- | Constructs a stream by adding a monadic action at the head of an
138− -- stream. For example:
138+ -- existing stream. For example:
139 --
139 --
140 -- @
140 -- @
141 -- > toList $ getLine \`consM` getLine \`consM` nil
141 -- > toList $ getLine \`consM` getLine \`consM` nil
@@ -148,7 +148,8 @@ class IsStream t where
148 --
148 --
149 -- @since 0.2.0
149 -- @since 0.2.0
150 consM :: MonadAsync m => m a -> t m a -> t m a
150 consM :: MonadAsync m => m a -> t m a -> t m a
151− -- | Operator equivalent of 'consM'.
151+ -- | Operator equivalent of 'consM'. We can read it as "@parallel colon@"
152+ -- to remember that @|@ comes before ':'.
152 --
153 --
153 -- @
154 -- @
154 -- > toList $ getLine |: getLine |: nil
155 -- > toList $ getLine |: getLine |: nil