on master help sign in
Some doc rearrangements and edits
69f22f4Harendra Kumar
src/Streamly/Prelude.hs+22−12
@@ -14,35 +14,45 @@
14-- Stability : experimental
14-- Stability : experimental
15-- Portability : GHC
15-- Portability : GHC
16--
16--
17+-- Functions with the suffix @M@ are general functions that work on monadic
18+-- arguments. The corresponding functions without the suffix @M@ work on pure
19+-- arguments and can in general be derived from their monadic versions but are
20+-- provided for convenience and for consistency with other pure APIs in the
21+-- @base@ package.
17--
22--
23+-- Deconstruction and folds accept a 'StreamT' type instead of a polymorphic
24+-- type to ensure that streams always have a concrete monomorphic type by
25+-- default, reducing type errors. In case you want to use any other type of
26+-- stream you can use one of the type combinators provided in the "Streamly"
27+-- module to convert the stream type.
28+
18module Streamly.Prelude
29module Streamly.Prelude
19 (
30 (
20− -- * Construction and Deconstruction
31+ -- * Construction
21 -- | Primitives to construct or inspect a stream.
32 -- | Primitives to construct or inspect a stream.
22 nil
33 nil
23 , consM
34 , consM
24 , (|:)
35 , (|:)
25− , once
26 , cons
36 , cons
27 , (.:)
37 , (.:)
28− , uncons
29
38
30− -- * Generation
39+ -- * General Unfold
31− -- | Generate a monadic stream from an input structure, a seed or a
32− -- generation function.
33 , unfoldr
40 , unfoldr
34 , unfoldrM
41 , unfoldrM
42+
43+ -- * Special Generation
44+ -- | Generate a monadic stream from an input structure, a seed or a
45+ -- generation function.
46+ , once
47+ , replicateM
35 , iterate
48 , iterate
36 , iterateM
49 , iterateM
37− , replicateM
38 , fromFoldable
50 , fromFoldable
39
51
40− -- * Folding
52+ -- * Deconstruction
41− -- | Folds accept a 'StreamT' type instead of a polymorphic type to ensure
53+ , uncons
42− -- that streams have a monomorphic type by default. In case you want to use
43− -- any other type of stream you can use one of the type combinators to
44− -- convert the stream type before passing to a fold function.
45
54
55+ -- * Folding
46 -- ** General Folds
56 -- ** General Folds
47 , foldr
57 , foldr
48 , foldrM
58 , foldrM