Map a monadic function over a Stream
Modulerebase-1.21.2Haskell2010
Rebase.Data.Vector.Fusion.Stream.Monadic
- 4 types
- 113 values
- Packagerebase-1.21.2
- Exports117
- LanguageHaskell2010
- LicenceMIT
- SourceMonadic.hs
Execute a monadic action for each element of the Stream
Convert a Stream to a list
Check whether the Stream contains an element
Left fold
Left fold over a non-empty Stream
Right fold
Right fold over a non-empty stream
Inverse of elem
Left fold with a strict accumulator
Empty Stream
Check if a Stream is empty
Length of a Stream
SPEC is used by GHC in the SpecConstr pass in order to inform
the compiler when to be particularly aggressive. In particular, it
tells GHC to specialize regardless of size or the number of
specializations. However, not all loops fall into this category.
Libraries can specify this by using SPEC data type to inform which loops should be aggressively specialized. For example, instead of
loop x where loop arg = ...write
loop SPEC x where loop !_ arg = ...There is no semantic difference between SPEC and SPEC2,
we just need a type with two constructors lest it is optimised away
before SpecConstr.
This type is reexported from GHC.Exts since GHC 9.0 and base-4.15.
For compatibility with earlier releases import it from GHC.Types
in ghc-prim package.
Concatenate two Streams
Map a function over a Stream
All but the last element
Replicate a value to a given length
The first n elements
Longest prefix of elements that satisfy the predicate
Enumerate values
WARNING: This operation can be very inefficient. If at all possible, use enumFromStepN instead.
Enumerate values with a given step.
WARNING: This operation is very inefficient. If at all possible, use enumFromStepN instead.
Drop elements which do not satisfy the predicate
Left fold with a monadic operator
Right fold with a monadic operator
All but the first n elements
First element of the Stream or error if empty
Drop elements which do not satisfy the monadic predicate
Same as foldlM
Yield a Stream of values obtained by performing the monadic action the given number of times
Zip two Streams with the given monadic function
Prepend an element
Left fold over a non-empty Stream with a strict accumulator
Left fold with a strict accumulator and a monadic operator
Haskell-style scan
Append an element
Unfold
Singleton Stream
Drop the longest prefix of elements that satisfy the predicate
Last element of the Stream or error if empty
Initial-value free scan over a Stream
All but the first element
Result of taking a single step in a stream
Convert the first n elements of a list to a Bundle
Convert a list to a Stream
Element at the given position or Nothing if out of bounds
Element at the given position
Transform a Stream to use a different monad
Haskell-style scan with strict accumulator
O(n) Apply function \max(n - 1, 0) times to an initial value,
producing a stream of \max(n, 0) values.
Same as foldlM'
Generate a stream from its indices
Extract a substream of the given length starting at the given position.
Lexicographically compare two Streams
Yield a Stream of the given length containing the values x, x+y,
x+y+y etc.
Check if two Streams are equal
Same as foldl1M
Same as foldl1M'
O(n) Apply monadic function \max(n - 1, 0) times to an initial value,
producing a stream of \max(n, 0) values.
Apply monadic function to each element and drop all Nothings
Suffix scan
Suffix scan with strict accumulator
Prefix scan
Prefix scan with strict accumulator
Initial-value free scan over a Stream with a strict accumulator
Unfold exactly n elements
Unfold exactly n elements with a monadic function.
Unfold with a monadic function
Unfold at most n elements with a monadic function.
Drop repeated adjacent elements.
Pair each element in a Stream with its index
Left fold over a non-empty Stream with a monadic operator
Left fold over a non-empty Stream with a strict accumulator and a monadic operator
Right fold over a non-empty stream with a monadic operator
Suffix scan with a monadic operator
Suffix scan with strict acccumulator and a monadic operator
Prefix scan with a monadic operator
Prefix scan with strict accumulator and a monadic operator
Initial-value free scan over a Stream with a monadic operator
Initial-value free scan over a Stream with a strict accumulator and a monadic operator
Longest prefix of elements that satisfy the monadic predicate
Pair each element in a Stream with its index, starting from the right and counting down
Drop the longest prefix of elements that satisfy the monadic predicate
Haskell-style scan with a monadic operator
Haskell-style scan with strict accumulator and a monadic operator