Data.Vector.Fusion.Bundle

vector-0.13.2.0: Efficient Arrays

Copyright | (c) Roman Leshchinskiy 2008-2010 Alexey Kuleshevich 2020-2022 Aleksey Khudyakov 2020-2022 Andrew Lelechenko 2020-2022
License | BSD-style
Maintainer | Haskell Libraries Team <libraries@haskell.org>
Stability | experimental
Portability | non-portable
Safe Haskell | None
Language | Haskell2010

Data.Vector.Fusion.Bundle

Contents

- Types
- In-place markers
- Size hints
- Length information
- Construction
- Accessing individual elements
- Substreams
- Mapping
- Zipping
- Filtering
- Searching
- Folding
- Specialised folds
- Unfolding
- Scans
- Enumerations
- Conversions
- Monadic combinators
- Orphan instances

Description

Bundles for stream fusion

Synopsis

- data Step s a where
  - Yield :: forall a s. a -> s -> Step s a
  - Skip :: forall s a. s -> Step s a
  - Done :: forall s a. Step s a
- data Chunk (v :: Type -> Type) a = Chunk Int (forall (m :: Type -> Type). (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ())
- type Bundle = Bundle Id
- type MBundle = Bundle
- inplace :: forall a b (v :: Type -> Type). (forall (m :: Type -> Type). Monad m => Stream m a -> Stream m b) -> (Size -> Size) -> Bundle v a -> Bundle v b
- size :: forall (v :: Type -> Type) a. Bundle v a -> Size
- sized :: forall (v :: Type -> Type) a. Bundle v a -> Size -> Bundle v a
- length :: forall (v :: Type -> Type) a. Bundle v a -> Int
- null :: forall (v :: Type -> Type) a. Bundle v a -> Bool
- empty :: forall (v :: Type -> Type) a. Bundle v a
- singleton :: forall a (v :: Type -> Type). a -> Bundle v a
- cons :: forall a (v :: Type -> Type). a -> Bundle v a -> Bundle v a
- snoc :: forall (v :: Type -> Type) a. Bundle v a -> a -> Bundle v a
- replicate :: forall a (v :: Type -> Type). Int -> a -> Bundle v a
- generate :: forall a (v :: Type -> Type). Int -> (Int -> a) -> Bundle v a
- (++) :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a -> Bundle v a
- head :: forall (v :: Type -> Type) a. Bundle v a -> a
- last :: forall (v :: Type -> Type) a. Bundle v a -> a
- (!!) :: forall (v :: Type -> Type) a. Bundle v a -> Int -> a
- (!?) :: forall (v :: Type -> Type) a. Bundle v a -> Int -> Maybe a
- slice :: forall (v :: Type -> Type) a. Int -> Int -> Bundle v a -> Bundle v a
- init :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a
- tail :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a
- take :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v a
- drop :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v a
- map :: forall a b (v :: Type -> Type). (a -> b) -> Bundle v a -> Bundle v b
- concatMap :: forall a (v :: Type -> Type) b. (a -> Bundle v b) -> Bundle v a -> Bundle v b
- flatten :: forall a s b (v :: Type -> Type). (a -> s) -> (s -> Step s b) -> Size -> Bundle v a -> Bundle v b
- unbox :: forall (v :: Type -> Type) a. Bundle v (Box a) -> Bundle v a
- indexed :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v (Int, a)
- indexedR :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v (Int, a)
- zipWith :: forall a b c (v :: Type -> Type). (a -> b -> c) -> Bundle v a -> Bundle v b -> Bundle v c
- zipWith3 :: forall a b c d (v :: Type -> Type). (a -> b -> c -> d) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d
- zipWith4 :: forall a b c d e (v :: Type -> Type). (a -> b -> c -> d -> e) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e
- zipWith5 :: forall a b c d e f (v :: Type -> Type). (a -> b -> c -> d -> e -> f) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f
- zipWith6 :: forall a b c d e f g (v :: Type -> Type). (a -> b -> c -> d -> e -> f -> g) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f -> Bundle v g
- zip :: forall (v :: Type -> Type) a b. Bundle v a -> Bundle v b -> Bundle v (a, b)
- zip3 :: forall (v :: Type -> Type) a b c. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v (a, b, c)
- zip4 :: forall (v :: Type -> Type) a b c d. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v (a, b, c, d)
- zip5 :: forall (v :: Type -> Type) a b c d e. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v (a, b, c, d, e)
- zip6 :: forall (v :: Type -> Type) a b c d e f. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f -> Bundle v (a, b, c, d, e, f)
- filter :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a
- takeWhile :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a
- dropWhile :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a
- elem :: forall a (v :: Type -> Type). Eq a => a -> Bundle v a -> Bool
- notElem :: forall a (v :: Type -> Type). Eq a => a -> Bundle v a -> Bool
- find :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Maybe a
- findIndex :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Maybe Int
- foldl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> a
- foldl1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a
- foldl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> a
- foldl1' :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a
- foldr :: forall a b (v :: Type -> Type). (a -> b -> b) -> b -> Bundle v a -> b
- foldr1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a
- and :: forall (v :: Type -> Type). Bundle v Bool -> Bool
- or :: forall (v :: Type -> Type). Bundle v Bool -> Bool
- unfoldr :: forall s a (v :: Type -> Type). (s -> Maybe (a, s)) -> s -> Bundle v a
- unfoldrN :: forall s a (v :: Type -> Type). Int -> (s -> Maybe (a, s)) -> s -> Bundle v a
- unfoldrExactN :: forall s a (v :: Type -> Type). Int -> (s -> (a, s)) -> s -> Bundle v a
- iterateN :: forall a (v :: Type -> Type). Int -> (a -> a) -> a -> Bundle v a
- prescanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- prescanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- postscanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- postscanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- scanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- scanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a
- scanl1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> Bundle v a
- scanl1' :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> Bundle v a
- enumFromStepN :: forall a (v :: Type -> Type). Num a => a -> a -> Int -> Bundle v a
- enumFromTo :: forall a (v :: Type -> Type). Enum a => a -> a -> Bundle v a
- enumFromThenTo :: forall a (v :: Type -> Type). Enum a => a -> a -> a -> Bundle v a
- toList :: forall (v :: Type -> Type) a. Bundle v a -> [a]
- fromList :: forall a (v :: Type -> Type). [a] -> Bundle v a
- fromListN :: forall a (v :: Type -> Type). Int -> [a] -> Bundle v a
- unsafeFromList :: forall a (v :: Type -> Type). Size -> [a] -> Bundle v a
- lift :: forall (m :: Type -> Type) (v :: Type -> Type) a. Monad m => Bundle Id v a -> Bundle m v a
- fromVector :: Vector v a => v a -> Bundle v a
- reVector :: forall (u :: Type -> Type) a (v :: Type -> Type). Bundle u a -> Bundle v a
- fromVectors :: Vector v a => [v a] -> Bundle v a
- concatVectors :: forall v a (u :: Type -> Type). Vector v a => Bundle u (v a) -> Bundle v a
- mapM :: forall m a b (v :: Type -> Type). Monad m => (a -> m b) -> Bundle v a -> Bundle m v b
- mapM_ :: forall m a b (v :: Type -> Type). Monad m => (a -> m b) -> Bundle v a -> m ()
- zipWithM :: forall m a b c (v :: Type -> Type). Monad m => (a -> b -> m c) -> Bundle v a -> Bundle v b -> Bundle m v c
- zipWithM_ :: forall m a b c (v :: Type -> Type). Monad m => (a -> b -> m c) -> Bundle v a -> Bundle v b -> m ()
- filterM :: forall m a (v :: Type -> Type). Monad m => (a -> m Bool) -> Bundle v a -> Bundle m v a
- mapMaybeM :: forall m a b (v :: Type -> Type). Monad m => (a -> m (Maybe b)) -> Bundle v a -> Bundle m v b
- foldM :: forall m a b (v :: Type -> Type). Monad m => (a -> b -> m a) -> a -> Bundle v b -> m a
- fold1M :: forall m a (v :: Type -> Type). Monad m => (a -> a -> m a) -> Bundle v a -> m a
- foldM' :: forall m a b (v :: Type -> Type). Monad m => (a -> b -> m a) -> a -> Bundle v b -> m a
- fold1M' :: forall m a (v :: Type -> Type). Monad m => (a -> a -> m a) -> Bundle v a -> m a
- eq :: forall a (v :: Type -> Type). Eq a => Bundle v a -> Bundle v a -> Bool
- cmp :: forall a (v :: Type -> Type). Ord a => Bundle v a -> Bundle v a -> Ordering
- eqBy :: forall a b (v :: Type -> Type). (a -> b -> Bool) -> Bundle v a -> Bundle v b -> Bool
- cmpBy :: forall a b (v :: Type -> Type). (a -> b -> Ordering) -> Bundle v a -> Bundle v b -> Ordering

# Types

data Step s a where #

Result of taking a single step in a stream

Constructors

Yield :: forall a s. a -> s -> Step s a |
Skip :: forall s a. s -> Step s a |
Done :: forall s a. Step s a |

#### Instances

Instances details

Functor (Step s) |
Instance details Defined in Data.Stream.Monadic Methods fmap :: (a -> b) -> Step s a -> Step s b # (<$) :: a -> Step s b -> Step s a #

data Chunk (v :: Type -> Type) a #

Constructors

Chunk Int (forall (m :: Type -> Type). (PrimMonad m, Vector v a) => Mutable v (PrimState m) a -> m ()) |

type Bundle = Bundle Id #

The type of pure streams

type MBundle = Bundle #

Alternative name for monadic streams

# In-place markers

inplace :: forall a b (v :: Type -> Type). (forall (m :: Type -> Type). Monad m => Stream m a -> Stream m b) -> (Size -> Size) -> Bundle v a -> Bundle v b #

# Size hints

size :: forall (v :: Type -> Type) a. Bundle v a -> Size #

`Size` hint of a `Bundle`

sized :: forall (v :: Type -> Type) a. Bundle v a -> Size -> Bundle v a #

Attach a `Size` hint to a `Bundle`

# Length information

length :: forall (v :: Type -> Type) a. Bundle v a -> Int #

Length of a `Bundle`

null :: forall (v :: Type -> Type) a. Bundle v a -> Bool #

Check if a `Bundle` is empty

# Construction

empty :: forall (v :: Type -> Type) a. Bundle v a #

Empty `Bundle`

singleton :: forall a (v :: Type -> Type). a -> Bundle v a #

Singleton `Bundle`

cons :: forall a (v :: Type -> Type). a -> Bundle v a -> Bundle v a #

Prepend an element

snoc :: forall (v :: Type -> Type) a. Bundle v a -> a -> Bundle v a #

Append an element

replicate :: forall a (v :: Type -> Type). Int -> a -> Bundle v a #

Replicate a value to a given length

generate :: forall a (v :: Type -> Type). Int -> (Int -> a) -> Bundle v a #

Generate a stream from its indices

(++) :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a -> Bundle v a infixr 5 #

Concatenate two `Bundle`s

# Accessing individual elements

head :: forall (v :: Type -> Type) a. Bundle v a -> a #

First element of the `Bundle` or error if empty

last :: forall (v :: Type -> Type) a. Bundle v a -> a #

Last element of the `Bundle` or error if empty

(!!) :: forall (v :: Type -> Type) a. Bundle v a -> Int -> a infixl 9 #

Element at the given position

(!?) :: forall (v :: Type -> Type) a. Bundle v a -> Int -> Maybe a infixl 9 #

Element at the given position or `Nothing` if out of bounds

# Substreams

slice #

Arguments

:: forall (v :: Type -> Type) a. Int | starting index
-> Int | length
-> Bundle v a |
-> Bundle v a |

Extract a substream of the given length starting at the given position.

init :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a #

All but the last element

tail :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v a #

All but the first element

take :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v a #

The first `n` elements

drop :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v a #

All but the first `n` elements

# Mapping

map :: forall a b (v :: Type -> Type). (a -> b) -> Bundle v a -> Bundle v b #

Map a function over a `Bundle`

concatMap :: forall a (v :: Type -> Type) b. (a -> Bundle v b) -> Bundle v a -> Bundle v b #

flatten :: forall a s b (v :: Type -> Type). (a -> s) -> (s -> Step s b) -> Size -> Bundle v a -> Bundle v b #

Create a `Bundle` of values from a `Bundle` of streamable things

unbox :: forall (v :: Type -> Type) a. Bundle v (Box a) -> Bundle v a #

# Zipping

indexed :: forall (v :: Type -> Type) a. Bundle v a -> Bundle v (Int, a) #

Pair each element in a `Bundle` with its index

indexedR :: forall (v :: Type -> Type) a. Int -> Bundle v a -> Bundle v (Int, a) #

Pair each element in a `Bundle` with its index, starting from the right and counting down

zipWith :: forall a b c (v :: Type -> Type). (a -> b -> c) -> Bundle v a -> Bundle v b -> Bundle v c #

Zip two `Bundle`s with the given function

zipWith3 :: forall a b c d (v :: Type -> Type). (a -> b -> c -> d) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d #

Zip three `Bundle`s with the given function

zipWith4 :: forall a b c d e (v :: Type -> Type). (a -> b -> c -> d -> e) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e #

zipWith5 :: forall a b c d e f (v :: Type -> Type). (a -> b -> c -> d -> e -> f) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f #

zipWith6 :: forall a b c d e f g (v :: Type -> Type). (a -> b -> c -> d -> e -> f -> g) -> Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f -> Bundle v g #

zip :: forall (v :: Type -> Type) a b. Bundle v a -> Bundle v b -> Bundle v (a, b) #

zip3 :: forall (v :: Type -> Type) a b c. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v (a, b, c) #

zip4 :: forall (v :: Type -> Type) a b c d. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v (a, b, c, d) #

zip5 :: forall (v :: Type -> Type) a b c d e. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v (a, b, c, d, e) #

zip6 :: forall (v :: Type -> Type) a b c d e f. Bundle v a -> Bundle v b -> Bundle v c -> Bundle v d -> Bundle v e -> Bundle v f -> Bundle v (a, b, c, d, e, f) #

# Filtering

filter :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a #

Drop elements which do not satisfy the predicate

takeWhile :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a #

Longest prefix of elements that satisfy the predicate

dropWhile :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Bundle v a #

Drop the longest prefix of elements that satisfy the predicate

# Searching

elem :: forall a (v :: Type -> Type). Eq a => a -> Bundle v a -> Bool infix 4 #

Check whether the `Bundle` contains an element

notElem :: forall a (v :: Type -> Type). Eq a => a -> Bundle v a -> Bool infix 4 #

Inverse of `elem`

find :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Maybe a #

Yield `Just` the first element matching the predicate or `Nothing` if no such element exists.

findIndex :: forall a (v :: Type -> Type). (a -> Bool) -> Bundle v a -> Maybe Int #

Yield `Just` the index of the first element matching the predicate or `Nothing` if no such element exists.

# Folding

foldl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> a #

Left fold

foldl1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a #

Left fold on non-empty `Bundle`s

foldl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> a #

Left fold with strict accumulator

foldl1' :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a #

Left fold on non-empty `Bundle`s with strict accumulator

foldr :: forall a b (v :: Type -> Type). (a -> b -> b) -> b -> Bundle v a -> b #

Right fold

foldr1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> a #

Right fold on non-empty `Bundle`s

# Specialised folds

and :: forall (v :: Type -> Type). Bundle v Bool -> Bool #

or :: forall (v :: Type -> Type). Bundle v Bool -> Bool #

# Unfolding

unfoldr :: forall s a (v :: Type -> Type). (s -> Maybe (a, s)) -> s -> Bundle v a #

Unfold

unfoldrN :: forall s a (v :: Type -> Type). Int -> (s -> Maybe (a, s)) -> s -> Bundle v a #

Unfold at most `n` elements

unfoldrExactN :: forall s a (v :: Type -> Type). Int -> (s -> (a, s)) -> s -> Bundle v a #

Unfold exactly `n` elements

Since: 0.12.2.0

iterateN :: forall a (v :: Type -> Type). Int -> (a -> a) -> a -> Bundle v a #

O(n) Apply function \(\max(n - 1, 0)\) times to an initial value, producing a pure bundle of exact length \(\max(n, 0)\). Zeroth element will contain the initial value.

# Scans

prescanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Prefix scan

prescanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Prefix scan with strict accumulator

postscanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Suffix scan

postscanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Suffix scan with strict accumulator

scanl :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Haskell-style scan

scanl' :: forall a b (v :: Type -> Type). (a -> b -> a) -> a -> Bundle v b -> Bundle v a #

Haskell-style scan with strict accumulator

scanl1 :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> Bundle v a #

Initial-value free scan over a `Bundle`

scanl1' :: forall a (v :: Type -> Type). (a -> a -> a) -> Bundle v a -> Bundle v a #

Initial-value free scan over a `Bundle` with a strict accumulator

# Enumerations

enumFromStepN :: forall a (v :: Type -> Type). Num a => a -> a -> Int -> Bundle v a #

Yield a `Bundle` of the given length containing the values `x`, `x+y`, `x+y+y` etc.

enumFromTo :: forall a (v :: Type -> Type). Enum a => a -> a -> Bundle v a #

Enumerate values

WARNING: This operations can be very inefficient. If at all possible, use `enumFromStepN` instead.

enumFromThenTo :: forall a (v :: Type -> Type). Enum a => a -> a -> a -> Bundle v a #

Enumerate values with a given step.

WARNING: This operations is very inefficient. If at all possible, use `enumFromStepN` instead.

# Conversions

toList :: forall (v :: Type -> Type) a. Bundle v a -> [a] #

Convert a `Bundle` to a list

fromList :: forall a (v :: Type -> Type). [a] -> Bundle v a #

Create a `Bundle` from a list

fromListN :: forall a (v :: Type -> Type). Int -> [a] -> Bundle v a #

Create a `Bundle` from the first `n` elements of a list

    fromListN n xs = fromList (take n xs)

unsafeFromList :: forall a (v :: Type -> Type). Size -> [a] -> Bundle v a #

lift :: forall (m :: Type -> Type) (v :: Type -> Type) a. Monad m => Bundle Id v a -> Bundle m v a #

Convert a pure stream to a monadic stream

fromVector :: Vector v a => v a -> Bundle v a #

reVector :: forall (u :: Type -> Type) a (v :: Type -> Type). Bundle u a -> Bundle v a #

fromVectors :: Vector v a => [v a] -> Bundle v a #

concatVectors :: forall v a (u :: Type -> Type). Vector v a => Bundle u (v a) -> Bundle v a #

# Monadic combinators

mapM :: forall m a b (v :: Type -> Type). Monad m => (a -> m b) -> Bundle v a -> Bundle m v b #

Apply a monadic action to each element of the stream, producing a monadic stream of results

mapM_ :: forall m a b (v :: Type -> Type). Monad m => (a -> m b) -> Bundle v a -> m () #

Apply a monadic action to each element of the stream

zipWithM :: forall m a b c (v :: Type -> Type). Monad m => (a -> b -> m c) -> Bundle v a -> Bundle v b -> Bundle m v c #

zipWithM_ :: forall m a b c (v :: Type -> Type). Monad m => (a -> b -> m c) -> Bundle v a -> Bundle v b -> m () #

filterM :: forall m a (v :: Type -> Type). Monad m => (a -> m Bool) -> Bundle v a -> Bundle m v a #

Yield a monadic stream of elements that satisfy the monadic predicate

mapMaybeM :: forall m a b (v :: Type -> Type). Monad m => (a -> m (Maybe b)) -> Bundle v a -> Bundle m v b #

O(n) Apply monadic function to each element of a bundle and discard elements returning Nothing.

Since: 0.12.2.0

foldM :: forall m a b (v :: Type -> Type). Monad m => (a -> b -> m a) -> a -> Bundle v b -> m a #

Monadic fold

fold1M :: forall m a (v :: Type -> Type). Monad m => (a -> a -> m a) -> Bundle v a -> m a #

Monadic fold over non-empty stream

foldM' :: forall m a b (v :: Type -> Type). Monad m => (a -> b -> m a) -> a -> Bundle v b -> m a #

Monadic fold with strict accumulator

fold1M' :: forall m a (v :: Type -> Type). Monad m => (a -> a -> m a) -> Bundle v a -> m a #

Monad fold over non-empty stream with strict accumulator

eq :: forall a (v :: Type -> Type). Eq a => Bundle v a -> Bundle v a -> Bool #

Check if two `Bundle`s are equal

cmp :: forall a (v :: Type -> Type). Ord a => Bundle v a -> Bundle v a -> Ordering #

Lexicographically compare two `Bundle`s

eqBy :: forall a b (v :: Type -> Type). (a -> b -> Bool) -> Bundle v a -> Bundle v b -> Bool #

cmpBy :: forall a b (v :: Type -> Type). (a -> b -> Ordering) -> Bundle v a -> Bundle v b -> Ordering #

# Orphan instances

Eq1 (Bundle Id v) # |
Instance details Methods liftEq :: (a -> b -> Bool) -> Bundle Id v a -> Bundle Id v b -> Bool #
Ord1 (Bundle Id v) # |
Instance details Methods liftCompare :: (a -> b -> Ordering) -> Bundle Id v a -> Bundle Id v b -> Ordering #
Eq a => Eq (Bundle Id v a) # |
Instance details Methods (==) :: Bundle Id v a -> Bundle Id v a -> Bool # (/=) :: Bundle Id v a -> Bundle Id v a -> Bool #
Ord a => Ord (Bundle Id v a) # |
Instance details Methods compare :: Bundle Id v a -> Bundle Id v a -> Ordering # (<) :: Bundle Id v a -> Bundle Id v a -> Bool # (<=) :: Bundle Id v a -> Bundle Id v a -> Bool # (>) :: Bundle Id v a -> Bundle Id v a -> Bool # (>=) :: Bundle Id v a -> Bundle Id v a -> Bool # max :: Bundle Id v a -> Bundle Id v a -> Bundle Id v a # min :: Bundle Id v a -> Bundle Id v a -> Bundle Id v a #