@@ -14,35 +14,45 @@
1414-- Stability : experimental
1515-- Portability : GHC
1616--
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.
1722--
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+
1829module Streamly.Prelude
1930 (
20− -- * Construction and Deconstruction
31+ -- * Construction
2132 -- | Primitives to construct or inspect a stream.
2233 nil
2334 , consM
2435 , (|:)
25− , once
2636 , cons
2737 , (.:)
28− , uncons
2938
30− -- * Generation
31− -- | Generate a monadic stream from an input structure, a seed or a
32− -- generation function.
39+ -- * General Unfold
3340 , unfoldr
3441 , 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
3548 , iterate
3649 , iterateM
37− , replicateM
3850 , fromFoldable
3951
40− -- * Folding
41− -- | Folds accept a 'StreamT' type instead of a polymorphic type to ensure
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.
52+ -- * Deconstruction
53+ , uncons
4554
55+ -- * Folding
4656 -- ** General Folds
4757 , foldr
4858 , foldrM