|
| Data.Vector.Fusion.Stream.Monadic | | Portability | non-portable | | Stability | experimental | | Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au> |
|
|
|
|
|
| Description |
| Monadic streams
|
|
| Synopsis |
|
|
|
| Documentation |
|
|
| Monadic streams
| | Constructors | | forall s . Stream (s -> m (Step s a)) s Size | |
| Instances | |
|
|
|
| Result of taking a single step in a stream
| | Constructors | | Yield a s | a new element and a new seed
| | Skip s | just a new seed
| | Done | end of stream
|
|
|
|
| Size hints
|
|
|
| Size hint of a Stream
|
|
|
| Attach a Size hint to a Stream
|
|
| Length
|
|
|
| Length of a Stream
|
|
|
| Check if a Stream is empty
|
|
| Construction
|
|
|
| Empty Stream
|
|
|
| Singleton Stream
|
|
|
| Prepend an element
|
|
|
| Append an element
|
|
|
| Replicate a value to a given length
|
|
|
| Concatenate two Streams
|
|
| Accessing elements
|
|
|
| First element of the Stream or error if empty
|
|
|
| Last element of the Stream or error if empty
|
|
|
| Element at the given position
|
|
| Substreams
|
|
|
| :: Monad m | | | => Stream m a | | | -> Int | starting index
| | -> Int | length
| | -> Stream m a | | | Extract a substream of the given length starting at the given position.
|
|
|
|
| All but the last element
|
|
|
| All but the first element
|
|
|
| The first n elements
|
|
|
| All but the first n elements
|
|
| Mapping
|
|
|
| Map a function over a Stream
|
|
|
| Map a monadic function over a Stream
|
|
|
| Execute a monadic action for each element of the Stream
|
|
|
| Transform a Stream to use a different monad
|
|
|
|
| Zipping
|
|
|
| Zip two Streams with the given function
|
|
|
| Zip two Streams with the given monadic function
|
|
|
| Zip three Streams with the given function
|
|
|
| Zip three Streams with the given monadic function
|
|
| Filtering
|
|
|
| Drop elements which do not satisfy the predicate
|
|
|
| Drop elements which do not satisfy the monadic predicate
|
|
|
| Longest prefix of elements that satisfy the predicate
|
|
|
| Longest prefix of elements that satisfy the monadic predicate
|
|
|
| Drop the longest prefix of elements that satisfy the predicate
|
|
|
| Drop the longest prefix of elements that satisfy the monadic predicate
|
|
| Searching
|
|
|
| Check whether the Stream contains an element
|
|
|
| Inverse of elem
|
|
|
| Yield Just the first element that satisfies the predicate or Nothing
if no such element exists.
|
|
|
| Yield Just the first element that satisfies the monadic predicate or
Nothing if no such element exists.
|
|
|
| Yield Just the index of the first element that satisfies the predicate
or Nothing if no such element exists.
|
|
|
| Yield Just the index of the first element that satisfies the monadic
predicate or Nothing if no such element exists.
|
|
| Folding
|
|
|
| Left fold
|
|
|
| Left fold with a monadic operator
|
|
|
| Left fold over a non-empty Stream
|
|
|
| Left fold over a non-empty Stream with a monadic operator
|
|
|
| Same as foldlM
|
|
|
| Same as foldl1M
|
|
|
| Left fold with a strict accumulator
|
|
|
| Left fold with a strict accumulator and a monadic operator
|
|
|
| Left fold over a non-empty Stream with a strict accumulator
|
|
|
| Left fold over a non-empty Stream with a strict accumulator and a
monadic operator
|
|
|
| Same as foldlM'
|
|
|
| Same as foldl1M'
|
|
|
| Right fold
|
|
|
| Right fold with a monadic operator
|
|
|
| Right fold over a non-empty stream
|
|
|
| Right fold over a non-empty stream with a monadic operator
|
|
| Specialised folds
|
|
|
|
|
|
|
|
| Unfolding
|
|
|
| Unfold
|
|
|
| Unfold with a monadic function
|
|
| Scans
|
|
|
| Prefix scan
|
|
|
| Prefix scan with a monadic operator
|
|
|
| Prefix scan with strict accumulator
|
|
|
| Prefix scan with strict accumulator and a monadic operator
|
|
|
| Suffix scan
|
|
|
| Suffix scan with a monadic operator
|
|
|
| Suffix scan with strict accumulator
|
|
|
| Suffix scan with strict acccumulator and a monadic operator
|
|
|
| Haskell-style scan
|
|
|
| Haskell-style scan with a monadic operator
|
|
|
| Haskell-style scan with strict accumulator
|
|
|
| Haskell-style scan with strict accumulator and a monadic operator
|
|
|
| Scan over a non-empty Stream
|
|
|
| Scan over a non-empty Stream with a monadic operator
|
|
|
| Scan over a non-empty Stream with a strict accumulator
|
|
|
| Scan over a non-empty Stream with a strict accumulator and a monadic
operator
|
|
| Conversions
|
|
|
| Convert a Stream to a list
|
|
|
| Convert a list to a Stream
|
|
| Produced by Haddock version 2.4.2 |