Element at the given position
Modulevector-0.13.2.0
Data.Vector.Fusion.Stream.Monadic
- 4 types
- 113 values
- Packagevector-0.13.2.0
- Exports117
- LicenceBSD-3-Clause
- SourceMonadic.hs
Element at the given position or Nothing if out of bounds
Concatenate two Streams
Lexicographically compare two Streams
Prepend an element
All but the first n elements
Drop the longest prefix of elements that satisfy the predicate
Drop the longest prefix of elements that satisfy the monadic predicate
Check whether the Stream contains an element
Empty Stream
Yield a Stream of the given length containing the values x, x+y,
x+y+y etc.
Enumerate values with a given step.
WARNING: This operation is very inefficient. If at all possible, use enumFromStepN instead.
Enumerate values
WARNING: This operation can be very inefficient. If at all possible, use enumFromStepN instead.
Check if two Streams are equal
Drop elements which do not satisfy the predicate
Drop elements which do not satisfy the monadic predicate
Same as foldl1M
Same as foldl1M'
Same as foldlM
Same as foldlM'
Left fold
Left fold with a strict accumulator
Left fold over a non-empty Stream
Left fold over a non-empty Stream with a strict accumulator
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
Left fold with a monadic operator
Left fold with a strict accumulator and a monadic operator
Right fold
Right fold over a non-empty stream
Right fold over a non-empty stream with a monadic operator
Right fold with a monadic operator
Convert a list to a Stream
Convert the first n elements of a list to a Bundle
Generate a stream from its indices
First element of the Stream or error if empty
Pair each element in a Stream with its index
Pair each element in a Stream with its index, starting from the right and counting down
All but the last element
O(n) Apply function \max(n - 1, 0) times to an initial value,
producing a stream of \max(n, 0) values.
O(n) Apply monadic function \max(n - 1, 0) times to an initial value,
producing a stream of \max(n, 0) values.
Last element of the Stream or error if empty
Length of a Stream
Map a function over a Stream
Map a monadic function over a Stream
Execute a monadic action for each element of the Stream
Apply monadic function to each element and drop all Nothings
Inverse of elem
Check if a Stream is empty
Suffix scan
Suffix scan with strict accumulator
Suffix scan with a monadic operator
Suffix scan with strict acccumulator and a monadic operator
Prefix scan
Prefix scan with strict accumulator
Prefix scan with a monadic operator
Prefix scan with strict accumulator and a monadic operator
Replicate a value to a given length
Yield a Stream of values obtained by performing the monadic action the given number of times
Haskell-style scan
Haskell-style scan with strict accumulator
Initial-value free scan over a Stream
Initial-value free scan over a Stream with a strict accumulator
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
Haskell-style scan with a monadic operator
Haskell-style scan with strict accumulator and a monadic operator
Singleton Stream
Extract a substream of the given length starting at the given position.
Append an element
All but the first element
The first n elements
Longest prefix of elements that satisfy the predicate
Longest prefix of elements that satisfy the monadic predicate
Convert a Stream to a list
Transform a Stream to use a different monad
Unfold
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.
Zip two Streams with the given monadic function
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.
Result of taking a single step in a stream