Control.Foldl

foldl-1.4.18: Composable, streaming, and efficient left folds

Safe Haskell | Trustworthy
Language | Haskell2010

Control.Foldl

Contents

- Fold Types
- Folding
- Folds
  - Generic Folds
  - Container Folds
- Utilities
- Re-exports

Description

This module provides efficient and streaming left folds that you can combine using `Applicative` style.

Import this module qualified to avoid clashing with the Prelude:

    >>> import qualified Control.Foldl as Foldl

Use `fold` to apply a `Fold` to a list:

    >>> Foldl.fold Foldl.sum [1..100]
    5050

`Fold`s are `Applicative`s, so you can combine them using `Applicative` combinators:

    >>> import Control.Applicative
    >>> let average = (/) <$> Foldl.sum <*> Foldl.genericLength

… or you can use `do` notation if you enable the `ApplicativeDo` language extension:

    >>> :set -XApplicativeDo
    >>> let average = do total <- Foldl.sum; count <- Foldl.genericLength; return (total / count)

… or you can use the fact that the `Fold` type implements `Num` to do this:

    >>> let average = Foldl.sum / Foldl.genericLength

These combined folds will still traverse the list only once, streaming efficiently over the list in constant space without space leaks:

    >>> Foldl.fold average [1..10000000]
    5000000.5
    >>> Foldl.fold ((,) <$> Foldl.minimum <*> Foldl.maximum) [1..10000000]
    (Just 1,Just 10000000)

You might want to try enabling the `-flate-dmd-anal` flag when compiling executables that use this library to further improve performance.

Synopsis

- data Fold a b = Fold (x -> a -> x) x (x -> b)
- data FoldM (m :: Type -> Type) a b = FoldM (x -> a -> m x) (m x) (x -> m b)
- fold :: Foldable f => Fold a b -> f a -> b
- foldM :: (Foldable f, Monad m) => FoldM m a b -> f a -> m b
- scan :: Fold a b -> [a] -> [b]
- prescan :: Traversable t => Fold a b -> t a -> t b
- postscan :: Traversable t => Fold a b -> t a -> t b
- mconcat :: Monoid a => Fold a a
- foldMap :: Monoid w => (a -> w) -> (w -> b) -> Fold a b
- head :: Fold a (Maybe a)
- last :: Fold a (Maybe a)
- lastDef :: a -> Fold a a
- lastN :: Int -> Fold a [a]
- null :: Fold a Bool
- length :: Fold a Int
- and :: Fold Bool Bool
- or :: Fold Bool Bool
- all :: (a -> Bool) -> Fold a Bool
- any :: (a -> Bool) -> Fold a Bool
- sum :: Num a => Fold a a
- product :: Num a => Fold a a
- mean :: Fractional a => Fold a a
- variance :: Fractional a => Fold a a
- std :: Floating a => Fold a a
- maximum :: Ord a => Fold a (Maybe a)
- maximumBy :: (a -> a -> Ordering) -> Fold a (Maybe a)
- minimum :: Ord a => Fold a (Maybe a)
- minimumBy :: (a -> a -> Ordering) -> Fold a (Maybe a)
- elem :: Eq a => a -> Fold a Bool
- notElem :: Eq a => a -> Fold a Bool
- find :: (a -> Bool) -> Fold a (Maybe a)
- index :: Int -> Fold a (Maybe a)
- lookup :: Eq a => a -> Fold (a, b) (Maybe b)
- elemIndex :: Eq a => a -> Fold a (Maybe Int)
- findIndex :: (a -> Bool) -> Fold a (Maybe Int)
- random :: FoldM IO a (Maybe a)
- randomN :: Vector v a => Int -> FoldM IO a (Maybe (v a))
- mapM_ :: Monad m => (a -> m ()) -> FoldM m a ()
- sink :: (Monoid w, Monad m) => (a -> m w) -> FoldM m a w
- genericLength :: Num b => Fold a b
- genericIndex :: Integral i => i -> Fold a (Maybe a)
- list :: Fold a [a]
- revList :: Fold a [a]
- nub :: Ord a => Fold a [a]
- eqNub :: Eq a => Fold a [a]
- set :: Ord a => Fold a (Set a)
- hashSet :: (Eq a, Hashable a) => Fold a (HashSet a)
- map :: Ord a => Fold (a, b) (Map a b)
- foldByKeyMap :: Ord k => Fold a b -> Fold (k, a) (Map k b)
- hashMap :: (Eq a, Hashable a) => Fold (a, b) (HashMap a b)
- foldByKeyHashMap :: (Hashable k, Eq k) => Fold a b -> Fold (k, a) (HashMap k b)
- vector :: Vector v a => Fold a (v a)
- vectorM :: forall (m :: Type -> Type) v a. (PrimMonad m, Vector v a) => FoldM m a (v a)
- purely :: (forall x. (x -> a -> x) -> x -> (x -> b) -> r) -> Fold a b -> r
- purely_ :: (forall x. (x -> a -> x) -> x -> x) -> Fold a b -> b
- impurely :: (forall x. (x -> a -> m x) -> m x -> (x -> m b) -> r) -> FoldM m a b -> r
- impurely_ :: Monad m => (forall x. (x -> a -> m x) -> m x -> m x) -> FoldM m a b -> m b
- generalize :: forall (m :: Type -> Type) a b. Monad m => Fold a b -> FoldM m a b
- simplify :: FoldM Identity a b -> Fold a b
- lifts :: Monad m => m b -> FoldM m a b
- hoists :: (forall x. m x -> n x) -> FoldM m a b -> FoldM n a b
- duplicateM :: forall (m :: Type -> Type) a b. Applicative m => FoldM m a b -> FoldM m a (FoldM m a b)
- _Fold1 :: (a -> a -> a) -> Fold a (Maybe a)
- premap :: (a -> b) -> Fold b r -> Fold a r
- premapM :: Monad m => (a -> m b) -> FoldM m b r -> FoldM m a r
- postmapM :: Monad m => (a -> m r) -> FoldM m x a -> FoldM m x r
- prefilter :: (a -> Bool) -> Fold a r -> Fold a r
- prefilterM :: Monad m => (a -> m Bool) -> FoldM m a r -> FoldM m a r
- predropWhile :: (a -> Bool) -> Fold a r -> Fold a r
- drop :: Natural -> Fold a b -> Fold a b
- dropM :: forall (m :: Type -> Type) a b. Monad m => Natural -> FoldM m a b -> FoldM m a b
- type Handler a b = forall x. (b -> Const (Dual (Endo x)) b) -> a -> Const (Dual (Endo x)) a
- handles :: Handler a b -> Fold b r -> Fold a r
- foldOver :: Handler s a -> Fold a b -> s -> b
- newtype EndoM (m :: Type -> Type) a = EndoM {
  - appEndoM :: a -> m a
  }
- type HandlerM (m :: Type -> Type) a b = forall x. (b -> Const (Dual (EndoM m x)) b) -> a -> Const (Dual (EndoM m x)) a
- handlesM :: forall (m :: Type -> Type) a b r. HandlerM m a b -> FoldM m b r -> FoldM m a r
- foldOverM :: Monad m => HandlerM m s a -> FoldM m a b -> s -> m b
- folded :: (Contravariant f, Applicative f, Foldable t) => (a -> f a) -> t a -> f (t a)
- filtered :: Monoid m => (a -> Bool) -> (a -> m) -> a -> m
- groupBy :: Ord k => (a -> k) -> Fold a b -> Fold a (Map k b)
- either :: Fold a1 b1 -> Fold a2 b2 -> Fold (Either a1 a2) (b1, b2)
- eitherM :: forall (m :: Type -> Type) a1 b1 a2 b2. Monad m => FoldM m a1 b1 -> FoldM m a2 b2 -> FoldM m (Either a1 a2) (b1, b2)
- nest :: Applicative f => Fold a b -> Fold (f a) (f b)
- data RealWorld
- class Monad m => PrimMonad (m :: Type -> Type)
- class Foldable (t :: Type -> Type)
- class MVector (Mutable v) a => Vector (v :: Type -> Type) a
- type family Mutable (v :: Type -> Type) = (mv :: Type -> Type -> Type) | mv -> v

# Fold Types

data Fold a b #

Efficient representation of a left fold that preserves the fold's step function, initial accumulator, and extraction function

This allows the `Applicative` instance to assemble derived folds that traverse the container only once

A '`Fold` a b' processes elements of type a and results in a value of type b.

Constructors

Fold (x -> a -> x) x (x -> b) | `Fold` `step` `initial` `extract`

#### Instances

Instances details

Choice Fold # |
Instance details Defined in Control.Foldl Methods left' :: Fold a b -> Fold (Either a c) (Either b c) # right' :: Fold a b -> Fold (Either c a) (Either c b) #
Closed Fold # |
Instance details Defined in Control.Foldl Methods closed :: Fold a b -> Fold (x -> a) (x -> b) #
Costrong Fold # |
Instance details Defined in Control.Foldl Methods unfirst :: Fold (a, d) (b, d) -> Fold a b # unsecond :: Fold (d, a) (d, b) -> Fold a b #
Profunctor Fold # |
Instance details Defined in Control.Foldl Methods dimap :: (a -> b) -> (c -> d) -> Fold b c -> Fold a d # lmap :: (a -> b) -> Fold b c -> Fold a c # rmap :: (b -> c) -> Fold a b -> Fold a c # (#.) :: forall a b c q. Coercible c b => q b c -> Fold a b -> Fold a c # (.#) :: forall a b c q. Coercible b a => Fold b c -> q a b -> Fold a c #
Cosieve Fold [] # |
Instance details Defined in Control.Foldl Methods cosieve :: Fold a b -> [a] -> b #
Semigroupoid Fold # |
Instance details Defined in Control.Foldl Methods o :: Fold j k1 -> Fold i j -> Fold i k1 #
Comonad (Fold a) # |
Instance details Defined in Control.Foldl Methods extract :: Fold a a0 -> a0 # duplicate :: Fold a a0 -> Fold a (Fold a a0) # extend :: (Fold a a0 -> b) -> Fold a a0 -> Fold a b #
Applicative (Fold a) # |
Instance details Defined in Control.Foldl Methods pure :: a0 -> Fold a a0 # (<*>) :: Fold a (a0 -> b) -> Fold a a0 -> Fold a b # liftA2 :: (a0 -> b -> c) -> Fold a a0 -> Fold a b -> Fold a c # (*>) :: Fold a a0 -> Fold a b -> Fold a b # (<*) :: Fold a a0 -> Fold a b -> Fold a a0 #
Functor (Fold a) # |
Instance details Defined in Control.Foldl Methods fmap :: (a0 -> b) -> Fold a a0 -> Fold a b # (<$) :: a0 -> Fold a b -> Fold a a0 #
Extend (Fold a) # |
Instance details Defined in Control.Foldl Methods duplicated :: Fold a a0 -> Fold a (Fold a a0) # extended :: (Fold a a0 -> b) -> Fold a a0 -> Fold a b #
Monoid b => Monoid (Fold a b) # |
Instance details Defined in Control.Foldl Methods mempty :: Fold a b # mappend :: Fold a b -> Fold a b -> Fold a b # mconcat :: [Fold a b] -> Fold a b #
Semigroup b => Semigroup (Fold a b) # |
Instance details Defined in Control.Foldl Methods (<>) :: Fold a b -> Fold a b -> Fold a b # sconcat :: NonEmpty (Fold a b) -> Fold a b # stimes :: Integral b0 => b0 -> Fold a b -> Fold a b #
Floating b => Floating (Fold a b) # |
Instance details Defined in Control.Foldl Methods pi :: Fold a b # exp :: Fold a b -> Fold a b # log :: Fold a b -> Fold a b # sqrt :: Fold a b -> Fold a b # (**) :: Fold a b -> Fold a b -> Fold a b # logBase :: Fold a b -> Fold a b -> Fold a b # sin :: Fold a b -> Fold a b # cos :: Fold a b -> Fold a b # tan :: Fold a b -> Fold a b # asin :: Fold a b -> Fold a b # acos :: Fold a b -> Fold a b # atan :: Fold a b -> Fold a b # sinh :: Fold a b -> Fold a b # cosh :: Fold a b -> Fold a b # tanh :: Fold a b -> Fold a b # asinh :: Fold a b -> Fold a b # acosh :: Fold a b -> Fold a b # atanh :: Fold a b -> Fold a b # log1p :: Fold a b -> Fold a b # expm1 :: Fold a b -> Fold a b # log1pexp :: Fold a b -> Fold a b # log1mexp :: Fold a b -> Fold a b #
Num b => Num (Fold a b) # |
Instance details Defined in Control.Foldl Methods (+) :: Fold a b -> Fold a b -> Fold a b # (-) :: Fold a b -> Fold a b -> Fold a b # (*) :: Fold a b -> Fold a b -> Fold a b # negate :: Fold a b -> Fold a b # abs :: Fold a b -> Fold a b # signum :: Fold a b -> Fold a b # fromInteger :: Integer -> Fold a b #
Fractional b => Fractional (Fold a b) # |
Instance details Defined in Control.Foldl Methods (/) :: Fold a b -> Fold a b -> Fold a b # recip :: Fold a b -> Fold a b # fromRational :: Rational -> Fold a b #

data FoldM (m :: Type -> Type) a b #

Like `Fold`, but monadic.

A '`FoldM` m a b' processes elements of type a and results in a monadic value of type m b.

Constructors

FoldM (x -> a -> m x) (m x) (x -> m b) | `FoldM` `step` `initial` `extract`

#### Instances

Instances details

Functor m => Profunctor (FoldM m) # |
Instance details Defined in Control.Foldl Methods dimap :: (a -> b) -> (c -> d) -> FoldM m b c -> FoldM m a d # lmap :: (a -> b) -> FoldM m b c -> FoldM m a c # rmap :: (b -> c) -> FoldM m a b -> FoldM m a c # (#.) :: forall a b c q. Coercible c b => q b c -> FoldM m a b -> FoldM m a c # (.#) :: forall a b c q. Coercible b a => FoldM m b c -> q a b -> FoldM m a c #
Applicative m => Applicative (FoldM m a) # |
Instance details Defined in Control.Foldl Methods pure :: a0 -> FoldM m a a0 # (<*>) :: FoldM m a (a0 -> b) -> FoldM m a a0 -> FoldM m a b # liftA2 :: (a0 -> b -> c) -> FoldM m a a0 -> FoldM m a b -> FoldM m a c # (*>) :: FoldM m a a0 -> FoldM m a b -> FoldM m a b # (<*) :: FoldM m a a0 -> FoldM m a b -> FoldM m a a0 #
Functor m => Functor (FoldM m a) # |
Instance details Defined in Control.Foldl Methods fmap :: (a0 -> b) -> FoldM m a a0 -> FoldM m a b # (<$) :: a0 -> FoldM m a b -> FoldM m a a0 #
Monad m => Extend (FoldM m a) # |
Instance details Defined in Control.Foldl Methods duplicated :: FoldM m a a0 -> FoldM m a (FoldM m a a0) # extended :: (FoldM m a a0 -> b) -> FoldM m a a0 -> FoldM m a b #
(Monoid b, Monad m) => Monoid (FoldM m a b) # |
Instance details Defined in Control.Foldl Methods mempty :: FoldM m a b # mappend :: FoldM m a b -> FoldM m a b -> FoldM m a b # mconcat :: [FoldM m a b] -> FoldM m a b #
(Semigroup b, Monad m) => Semigroup (FoldM m a b) # |
Instance details Defined in Control.Foldl Methods (<>) :: FoldM m a b -> FoldM m a b -> FoldM m a b # sconcat :: NonEmpty (FoldM m a b) -> FoldM m a b # stimes :: Integral b0 => b0 -> FoldM m a b -> FoldM m a b #
(Monad m, Floating b) => Floating (FoldM m a b) # |
Instance details Defined in Control.Foldl Methods pi :: FoldM m a b # exp :: FoldM m a b -> FoldM m a b # log :: FoldM m a b -> FoldM m a b # sqrt :: FoldM m a b -> FoldM m a b # (**) :: FoldM m a b -> FoldM m a b -> FoldM m a b # logBase :: FoldM m a b -> FoldM m a b -> FoldM m a b # sin :: FoldM m a b -> FoldM m a b # cos :: FoldM m a b -> FoldM m a b # tan :: FoldM m a b -> FoldM m a b # asin :: FoldM m a b -> FoldM m a b # acos :: FoldM m a b -> FoldM m a b # atan :: FoldM m a b -> FoldM m a b # sinh :: FoldM m a b -> FoldM m a b # cosh :: FoldM m a b -> FoldM m a b # tanh :: FoldM m a b -> FoldM m a b # asinh :: FoldM m a b -> FoldM m a b # acosh :: FoldM m a b -> FoldM m a b # atanh :: FoldM m a b -> FoldM m a b # log1p :: FoldM m a b -> FoldM m a b # expm1 :: FoldM m a b -> FoldM m a b # log1pexp :: FoldM m a b -> FoldM m a b # log1mexp :: FoldM m a b -> FoldM m a b #
(Monad m, Num b) => Num (FoldM m a b) # |
Instance details Defined in Control.Foldl Methods (+) :: FoldM m a b -> FoldM m a b -> FoldM m a b # (-) :: FoldM m a b -> FoldM m a b -> FoldM m a b # (*) :: FoldM m a b -> FoldM m a b -> FoldM m a b # negate :: FoldM m a b -> FoldM m a b # abs :: FoldM m a b -> FoldM m a b # signum :: FoldM m a b -> FoldM m a b # fromInteger :: Integer -> FoldM m a b #
(Monad m, Fractional b) => Fractional (FoldM m a b) # |
Instance details Defined in Control.Foldl Methods (/) :: FoldM m a b -> FoldM m a b -> FoldM m a b # recip :: FoldM m a b -> FoldM m a b # fromRational :: Rational -> FoldM m a b #

# Folding

fold :: Foldable f => Fold a b -> f a -> b #

Apply a strict left `Fold` to a `Foldable` container

foldM :: (Foldable f, Monad m) => FoldM m a b -> f a -> m b #

Like `fold`, but monadic

scan :: Fold a b -> [a] -> [b] #

Convert a strict left `Fold` into a scan

    >>> Foldl.scan Foldl.length [1..5]
    [0,1,2,3,4,5]

prescan :: Traversable t => Fold a b -> t a -> t b #

Convert a `Fold` into a prescan for any `Traversable` type

"Prescan" means that the last element of the scan is not included

    >>> Foldl.prescan Foldl.length [1..5]
    [0,1,2,3,4]

postscan :: Traversable t => Fold a b -> t a -> t b #

Convert a `Fold` into a postscan for any `Traversable` type

"Postscan" means that the first element of the scan is not included

    >>> Foldl.postscan Foldl.length [1..5]
    [1,2,3,4,5]

# Folds

mconcat :: Monoid a => Fold a a #

Fold all values within a container using `mappend` and `mempty`

foldMap :: Monoid w => (a -> w) -> (w -> b) -> Fold a b #

Convert a "`foldMap`" to a `Fold`

head :: Fold a (Maybe a) #

Get the first element of a container or return `Nothing` if the container is empty

last :: Fold a (Maybe a) #

Get the last element of a container or return `Nothing` if the container is empty

lastDef :: a -> Fold a a #

Get the last element of a container or return a default value if the container is empty

lastN :: Int -> Fold a [a] #

Return the last N elements

null :: Fold a Bool #

Returns `True` if the container is empty, `False` otherwise

length :: Fold a Int #

Return the length of the container

and :: Fold Bool Bool #

Returns `True` if all elements are `True`, `False` otherwise

or :: Fold Bool Bool #

Returns `True` if any element is `True`, `False` otherwise

all :: (a -> Bool) -> Fold a Bool #

`(all predicate)` returns `True` if all elements satisfy the predicate, `False` otherwise

any :: (a -> Bool) -> Fold a Bool #

`(any predicate)` returns `True` if any element satisfies the predicate, `False` otherwise

sum :: Num a => Fold a a #

Computes the sum of all elements

product :: Num a => Fold a a #

Computes the product of all elements

mean :: Fractional a => Fold a a #

Compute a numerically stable arithmetic mean of all elements

variance :: Fractional a => Fold a a #

Compute a numerically stable (population) variance over all elements

std :: Floating a => Fold a a #

Compute a numerically stable (population) standard deviation over all elements

maximum :: Ord a => Fold a (Maybe a) #

Computes the maximum element

maximumBy :: (a -> a -> Ordering) -> Fold a (Maybe a) #

Computes the maximum element with respect to the given comparison function

minimum :: Ord a => Fold a (Maybe a) #

Computes the minimum element

minimumBy :: (a -> a -> Ordering) -> Fold a (Maybe a) #

Computes the minimum element with respect to the given comparison function

elem :: Eq a => a -> Fold a Bool #

`(elem a)` returns `True` if the container has an element equal to `a`, `False` otherwise

notElem :: Eq a => a -> Fold a Bool #

`(notElem a)` returns `False` if the container has an element equal to `a`, `True` otherwise

find :: (a -> Bool) -> Fold a (Maybe a) #

`(find predicate)` returns the first element that satisfies the predicate or `Nothing` if no element satisfies the predicate

index :: Int -> Fold a (Maybe a) #

`(index n)` returns the `n`th element of the container, or `Nothing` if the container has an insufficient number of elements

lookup :: Eq a => a -> Fold (a, b) (Maybe b) #

`(lookup a)` returns the element paired with the first matching item, or `Nothing` if none matches

elemIndex :: Eq a => a -> Fold a (Maybe Int) #

`(elemIndex a)` returns the index of the first element that equals `a`, or `Nothing` if no element matches

findIndex :: (a -> Bool) -> Fold a (Maybe Int) #

`(findIndex predicate)` returns the index of the first element that satisfies the predicate, or `Nothing` if no element satisfies the predicate

random :: FoldM IO a (Maybe a) #

Pick a random element, using reservoir sampling

randomN :: Vector v a => Int -> FoldM IO a (Maybe (v a)) #

Pick several random elements, using reservoir sampling

mapM_ :: Monad m => (a -> m ()) -> FoldM m a () #

Converts an effectful function to a fold. Specialized version of `sink`.

sink :: (Monoid w, Monad m) => (a -> m w) -> FoldM m a w #

Converts an effectful function to a fold

    sink (f <> g) = sink f <> sink g -- if `(<>)` is commutative
    sink mempty = mempty

## Generic Folds

genericLength :: Num b => Fold a b #

Like `length`, except with a more general `Num` return value

genericIndex :: Integral i => i -> Fold a (Maybe a) #

Like `index`, except with a more general `Integral` argument

## Container Folds

list :: Fold a [a] #

Fold all values into a list

revList :: Fold a [a] #

Fold all values into a list, in reverse order

nub :: Ord a => Fold a [a] #

O(n log n). Fold values into a list with duplicates removed, while preserving their first occurrences

eqNub :: Eq a => Fold a [a] #

O(n^2). Fold values into a list with duplicates removed, while preserving their first occurrences

set :: Ord a => Fold a (Set a) #

Fold values into a set

hashSet :: (Eq a, Hashable a) => Fold a (HashSet a) #

Fold values into a hash-set

map :: Ord a => Fold (a, b) (Map a b) #

Fold pairs into a map.

foldByKeyMap :: Ord k => Fold a b -> Fold (k, a) (Map k b) #

Given a `Fold`, produces a `Map` which applies that fold to each `a` separated by key `k`.

    >>> fold (foldByKeyMap Control.Foldl.sum) [("a",1), ("b",2), ("b",20), ("a",10)]
    fromList [("a",11),("b",22)]

hashMap :: (Eq a, Hashable a) => Fold (a, b) (HashMap a b) #

Fold pairs into a hash-map.

foldByKeyHashMap :: (Hashable k, Eq k) => Fold a b -> Fold (k, a) (HashMap k b) #

Given a `Fold`, produces a `HashMap` which applies that fold to each `a` separated by key `k`.

    >>> List.sort (HashMap.toList (fold (foldByKeyHashMap Control.Foldl.sum) [("a",1), ("b",2), ("b",20), ("a",10)]))
    [("a",11),("b",22)]

vector :: Vector v a => Fold a (v a) #

Fold all values into a vector

vectorM :: forall (m :: Type -> Type) v a. (PrimMonad m, Vector v a) => FoldM m a (v a) #

Fold all values into a vector

This is more efficient than `vector` but is impure

# Utilities

`purely` and `impurely` allow you to write folds compatible with the `foldl` library without incurring a `foldl` dependency. Write your fold to accept three parameters corresponding to the step function, initial accumulator, and extraction function and then users can upgrade your function to accept a `Fold` or `FoldM` using the `purely` or `impurely` combinators.

For example, the `pipes` library implements `fold` and `foldM` functions in `Pipes.Prelude` with the following type:

    Pipes.Prelude.fold
        :: Monad m
        -> (x -> a -> x) -> x -> (x -> b) -> Producer a m () -> m b

    Pipes.Prelude.foldM
        :: Monad m
        => (x -> a -> m x) -> m x -> (x -> m b) -> Producer a m () -> m b

Both `fold` and `foldM` is set up so that you can wrap them with either `purely` or `impurely` to accept a `Fold` or `FoldM`, respectively:

    purely Pipes.Prelude.fold
        :: Monad m => Fold a b -> Producer a m () -> m b

    impurely Pipes.Prelude.foldM
        :: Monad m => FoldM m a b -> Producer a m () -> m b

Other streaming libraries supporting `purely` and `impurely` include `io-streams` and `streaming`. So for example we have:

    purely System.IO.Streams.fold_
        :: Fold a b -> Streams.InputStream a -> IO b

    impurely System.IO.Streams.foldM_
        :: FoldM IO a b -> Streams.InputStream a -> IO b

The `monotraversable` package makes it convenient to apply a `Fold` or `FoldM` to pure containers that do not allow a general `Foldable` instance, like unboxed vectors:

    purely ofoldlUnwrap
        :: MonoFoldable mono
        => Fold (Element mono) b -> mono -> b

    impurely ofoldMUnwrap
        :: MonoFoldable mono
        => FoldM m (Element mono) b -> mono -> m b

purely :: (forall x. (x -> a -> x) -> x -> (x -> b) -> r) -> Fold a b -> r #

Upgrade a fold to accept the `Fold` type

purely_ :: (forall x. (x -> a -> x) -> x -> x) -> Fold a b -> b #

Upgrade a more traditional fold to accept the `Fold` type

impurely :: (forall x. (x -> a -> m x) -> m x -> (x -> m b) -> r) -> FoldM m a b -> r #

Upgrade a monadic fold to accept the `FoldM` type

impurely_ :: Monad m => (forall x. (x -> a -> m x) -> m x -> m x) -> FoldM m a b -> m b #

Upgrade a more traditional monadic fold to accept the `FoldM` type

generalize :: forall (m :: Type -> Type) a b. Monad m => Fold a b -> FoldM m a b #

Generalize a `Fold` to a `FoldM`

    generalize (pure r) = pure r

    generalize (f <*> x) = generalize f <*> generalize x

simplify :: FoldM Identity a b -> Fold a b #

Simplify a pure `FoldM` to a `Fold`

    simplify (pure r) = pure r

    simplify (f <*> x) = simplify f <*> simplify x

lifts :: Monad m => m b -> FoldM m a b #

Lift a monadic value to a `FoldM`; works like `lift`.

    lifts . pure = pure

hoists :: (forall x. m x -> n x) -> FoldM m a b -> FoldM n a b #

Shift a `FoldM` from one monad to another with a morphism such as `lift` or `liftIO`; the effect is the same as `hoist`.

duplicateM :: forall (m :: Type -> Type) a b. Applicative m => FoldM m a b -> FoldM m a (FoldM m a b) #

Allows to continue feeding a `FoldM` even after passing it to a function that closes it.

For pure `Fold`s, this is provided by the `Comonad` instance.

_Fold1 :: (a -> a -> a) -> Fold a (Maybe a) #

`_Fold1 step` returns a new `Fold` using just a step function that has the same type for the accumulator and the element. The result type is the accumulator type wrapped in `Maybe`. The initial accumulator is retrieved from the `Foldable`, the result is `None` for empty containers.

premap :: (a -> b) -> Fold b r -> Fold a r #

`(premap f folder)` returns a new `Fold` where f is applied at each step

    fold (premap f folder) list = fold folder (List.map f list)

    >>> fold (premap Sum Foldl.mconcat) [1..10]
    Sum {getSum = 55}

    >>> fold Foldl.mconcat (List.map Sum [1..10])
    Sum {getSum = 55}

    premap id = id

    premap (f . g) = premap g . premap f

    premap k (pure r) = pure r

    premap k (f <*> x) = premap k f <*> premap k x

premapM :: Monad m => (a -> m b) -> FoldM m b r -> FoldM m a r #

`(premapM f folder)` returns a new `FoldM` where f is applied to each input element

    premapM return = id

    premapM (f <=< g) = premap g . premap f

    premapM k (pure r) = pure r

    premapM k (f <*> x) = premapM k f <*> premapM k x

postmapM :: Monad m => (a -> m r) -> FoldM m x a -> FoldM m x r #

`(postmapM f folder)` returns a new `FoldM` where f is applied to the final value.

    postmapM pure = id

    postmapM (f >=> g) = postmapM g . postmapM f

    postmapM k (pure r) = lifts (k r)

prefilter :: (a -> Bool) -> Fold a r -> Fold a r #

`(prefilter f folder)` returns a new `Fold` where the folder's input is used only when the input satisfies a predicate f

This can also be done with `handles` (`handles (filtered f)`) but `prefilter` does not need you to depend on a lens library.

    fold (prefilter p folder) list = fold folder (filter p list)

    >>> fold (prefilter (>5) Control.Foldl.sum) [1..10]
    40

    >>> fold Control.Foldl.sum (filter (>5) [1..10])
    40

prefilterM :: Monad m => (a -> m Bool) -> FoldM m a r -> FoldM m a r #

`(prefilterM f folder)` returns a new `FoldM` where the folder's input is used only when the input satisfies a monadic predicate f.

predropWhile :: (a -> Bool) -> Fold a r -> Fold a r #

Transforms a `Fold` into one which ignores elements until they stop satisfying a predicate

    fold (predropWhile p folder) list = fold folder (dropWhile p list)

    >>> fold (predropWhile (>5) Control.Foldl.sum) [10,9,5,9]
    14

drop :: Natural -> Fold a b -> Fold a b #

`(drop n folder)` returns a new `Fold` that ignores the first `n` inputs but otherwise behaves the same as the original fold.

    fold (drop n folder) list = fold folder (Data.List.genericDrop n list)

    >>> Foldl.fold (Foldl.drop 3 Foldl.sum) [10, 20, 30, 1, 2, 3]
    6

    >>> Foldl.fold (Foldl.drop 10 Foldl.sum) [10, 20, 30, 1, 2, 3]
    0

dropM :: forall (m :: Type -> Type) a b. Monad m => Natural -> FoldM m a b -> FoldM m a b #

`(dropM n folder)` returns a new `FoldM` that ignores the first `n` inputs but otherwise behaves the same as the original fold.

    foldM (dropM n folder) list = foldM folder (Data.List.genericDrop n list)

    >>> Foldl.foldM (Foldl.dropM 3 (Foldl.generalize Foldl.sum)) [10, 20, 30, 1, 2, 3]
    6

    >>> Foldl.foldM (Foldl.dropM 10 (Foldl.generalize Foldl.sum)) [10, 20, 30, 1, 2, 3]
    0

type Handler a b = forall x. (b -> Const (Dual (Endo x)) b) -> a -> Const (Dual (Endo x)) a #

A handler for the upstream input of a `Fold`

Any lens, traversal, or prism will type-check as a `Handler`

handles :: Handler a b -> Fold b r -> Fold a r #

`(handles t folder)` transforms the input of a `Fold` using a lens, traversal, or prism:

    handles _1       :: Fold a r -> Fold (a, b) r
    handles _Left    :: Fold a r -> Fold (Either a b) r
    handles traverse :: Traversable t => Fold a r -> Fold (t a) r
    handles folded   :: Foldable    t => Fold a r -> Fold (t a) r

    >>> fold (handles traverse sum) [[1..5],[6..10]]
    55

    >>> fold (handles (traverse . traverse) sum) [[Nothing, Just 2, Just 7],[Just 13, Nothing, Just 20]]
    42

    >>> fold (handles (filtered even) sum) [1..10]
    30

    >>> fold (handles _2 Foldl.mconcat) [(1,"Hello "),(2,"World"),(3,"!")]
    "Hello World!"

    handles id = id

    handles (f . g) = handles f . handles g

    handles t (pure r) = pure r

    handles t (f <*> x) = handles t f <*> handles t x

foldOver :: Handler s a -> Fold a b -> s -> b #

`(foldOver f folder xs)` folds all values from a Lens, Traversal, Prism or Fold with the given folder

    >>> foldOver (_Just . both) Foldl.sum (Just (2, 3))
    5

    >>> foldOver (_Just . both) Foldl.sum Nothing
    0

    Foldl.foldOver f folder xs == Foldl.fold folder (xs^..f)

    Foldl.foldOver (folded . f) folder == Foldl.fold (handles f folder)

    Foldl.foldOver folded == Foldl.fold

newtype EndoM (m :: Type -> Type) a #

    instance Monad m => Monoid (EndoM m a) where
        mempty = EndoM return
        mappend (EndoM f) (EndoM g) = EndoM (f <=< g)

Constructors

EndoM |
Fields appEndoM :: a -> m a

#### Instances

Instances details

Monad m => Monoid (EndoM m a) # |
Instance details Defined in Control.Foldl Methods mempty :: EndoM m a # mappend :: EndoM m a -> EndoM m a -> EndoM m a # mconcat :: [EndoM m a] -> EndoM m a #
Monad m => Semigroup (EndoM m a) # |
Instance details Defined in Control.Foldl Methods (<>) :: EndoM m a -> EndoM m a -> EndoM m a # sconcat :: NonEmpty (EndoM m a) -> EndoM m a # stimes :: Integral b => b -> EndoM m a -> EndoM m a #

type HandlerM (m :: Type -> Type) a b = forall x. (b -> Const (Dual (EndoM m x)) b) -> a -> Const (Dual (EndoM m x)) a #

A Handler for the upstream input of `FoldM`

Any lens, traversal, or prism will type-check as a `HandlerM`

handlesM :: forall (m :: Type -> Type) a b r. HandlerM m a b -> FoldM m b r -> FoldM m a r #

`(handlesM t folder)` transforms the input of a `FoldM` using a lens, traversal, or prism:

    handlesM _1       :: FoldM m a r -> FoldM (a, b) r
    handlesM _Left    :: FoldM m a r -> FoldM (Either a b) r
    handlesM traverse :: Traversable t => FoldM m a r -> FoldM m (t a) r
    handlesM folded   :: Foldable    t => FoldM m a r -> FoldM m (t a) r

`handlesM` obeys these laws:

    handlesM id = id

    handlesM (f . g) = handlesM f . handlesM g

    handlesM t (pure r) = pure r

    handlesM t (f <*> x) = handlesM t f <*> handlesM t x

foldOverM :: Monad m => HandlerM m s a -> FoldM m a b -> s -> m b #

`(foldOverM f folder xs)` folds all values from a Lens, Traversal, Prism or Fold monadically with the given folder

    Foldl.foldOverM (folded . f) folder == Foldl.foldM (handlesM f folder)

    Foldl.foldOverM folded == Foldl.foldM

folded :: (Contravariant f, Applicative f, Foldable t) => (a -> f a) -> t a -> f (t a) #

    folded :: Foldable t => Fold (t a) a

    handles folded :: Foldable t => Fold a r -> Fold (t a) r

filtered :: Monoid m => (a -> Bool) -> (a -> m) -> a -> m #

    >>> fold (handles (filtered even) sum) [1..10]
    30

    >>> foldM (handlesM (filtered even) (Foldl.mapM_ print)) [1..10]
    2
    4
    6
    8
    10

groupBy :: Ord k => (a -> k) -> Fold a b -> Fold a (Map k b) #

Perform a `Fold` while grouping the data according to a specified group projection function. Returns the folded result grouped as a map keyed by the group.

either :: Fold a1 b1 -> Fold a2 b2 -> Fold (Either a1 a2) (b1, b2) #

Combine two folds into a fold over inputs for either of them.

eitherM :: forall (m :: Type -> Type) a1 b1 a2 b2. Monad m => FoldM m a1 b1 -> FoldM m a2 b2 -> FoldM m (Either a1 a2) (b1, b2) #

Combine two monadic folds into a fold over inputs for either of them.

nest :: Applicative f => Fold a b -> Fold (f a) (f b) #

Nest a fold in an applicative.

# Re-exports

`Control.Monad.Primitive` re-exports the `PrimMonad` type class

`Data.Foldable` re-exports the `Foldable` type class

`Data.Vector.Generic` re-exports the `Vector` type class

data RealWorld #

`RealWorld` is deeply magical. It is primitive, but it is not unlifted (hence `ptrArg`). We never manipulate values of type `RealWorld`; it's only used in the type system, to parameterise `State#`.

class Monad m => PrimMonad (m :: Type -> Type) #

Class of monads which can perform primitive state-transformer actions.

Minimal complete definition

primitive

#### Instances

Instances details

PrimMonad IO |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState IO |
Instance details Defined in Control.Monad.Primitive type PrimState IO = RealWorld
Methods primitive :: (State# (PrimState IO) -> (# State# (PrimState IO), a #)) -> IO a #
PrimMonad (ST s) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (ST s) |
Instance details Defined in Control.Monad.Primitive type PrimState (ST s) = s
Methods primitive :: (State# (PrimState (ST s)) -> (# State# (PrimState (ST s)), a #)) -> ST s a #
PrimMonad (ST s) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (ST s) |
Instance details Defined in Control.Monad.Primitive type PrimState (ST s) = s
Methods primitive :: (State# (PrimState (ST s)) -> (# State# (PrimState (ST s)), a #)) -> ST s a #
PrimMonad m => PrimMonad (MaybeT m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (MaybeT m) |
Instance details Defined in Control.Monad.Primitive type PrimState (MaybeT m) = PrimState m
Methods primitive :: (State# (PrimState (MaybeT m)) -> (# State# (PrimState (MaybeT m)), a #)) -> MaybeT m a #
(Monoid w, PrimMonad m) => PrimMonad (AccumT w m) | Since: primitive-0.6.3.0
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (AccumT w m) |
Instance details Defined in Control.Monad.Primitive type PrimState (AccumT w m) = PrimState m
Methods primitive :: (State# (PrimState (AccumT w m)) -> (# State# (PrimState (AccumT w m)), a #)) -> AccumT w m a #
PrimMonad m => PrimMonad (ExceptT e m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (ExceptT e m) |
Instance details Defined in Control.Monad.Primitive type PrimState (ExceptT e m) = PrimState m
Methods primitive :: (State# (PrimState (ExceptT e m)) -> (# State# (PrimState (ExceptT e m)), a #)) -> ExceptT e m a #
PrimMonad m => PrimMonad (IdentityT m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (IdentityT m) |
Instance details Defined in Control.Monad.Primitive type PrimState (IdentityT m) = PrimState m
Methods primitive :: (State# (PrimState (IdentityT m)) -> (# State# (PrimState (IdentityT m)), a #)) -> IdentityT m a #
PrimMonad m => PrimMonad (ReaderT r m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (ReaderT r m) |
Instance details Defined in Control.Monad.Primitive type PrimState (ReaderT r m) = PrimState m
Methods primitive :: (State# (PrimState (ReaderT r m)) -> (# State# (PrimState (ReaderT r m)), a #)) -> ReaderT r m a #
PrimMonad m => PrimMonad (SelectT r m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (SelectT r m) |
Instance details Defined in Control.Monad.Primitive type PrimState (SelectT r m) = PrimState m
Methods primitive :: (State# (PrimState (SelectT r m)) -> (# State# (PrimState (SelectT r m)), a #)) -> SelectT r m a #
PrimMonad m => PrimMonad (StateT s m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (StateT s m) |
Instance details Defined in Control.Monad.Primitive type PrimState (StateT s m) = PrimState m
Methods primitive :: (State# (PrimState (StateT s m)) -> (# State# (PrimState (StateT s m)), a #)) -> StateT s m a #
PrimMonad m => PrimMonad (StateT s m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (StateT s m) |
Instance details Defined in Control.Monad.Primitive type PrimState (StateT s m) = PrimState m
Methods primitive :: (State# (PrimState (StateT s m)) -> (# State# (PrimState (StateT s m)), a #)) -> StateT s m a #
(Monoid w, PrimMonad m) => PrimMonad (WriterT w m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (WriterT w m) |
Instance details Defined in Control.Monad.Primitive type PrimState (WriterT w m) = PrimState m
Methods primitive :: (State# (PrimState (WriterT w m)) -> (# State# (PrimState (WriterT w m)), a #)) -> WriterT w m a #
(Monoid w, PrimMonad m) => PrimMonad (WriterT w m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (WriterT w m) |
Instance details Defined in Control.Monad.Primitive type PrimState (WriterT w m) = PrimState m
Methods primitive :: (State# (PrimState (WriterT w m)) -> (# State# (PrimState (WriterT w m)), a #)) -> WriterT w m a #
(Monoid w, PrimMonad m) => PrimMonad (WriterT w m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (WriterT w m) |
Instance details Defined in Control.Monad.Primitive type PrimState (WriterT w m) = PrimState m
Methods primitive :: (State# (PrimState (WriterT w m)) -> (# State# (PrimState (WriterT w m)), a #)) -> WriterT w m a #
PrimMonad m => PrimMonad (ContT r m) | Since: primitive-0.6.3.0
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (ContT r m) |
Instance details Defined in Control.Monad.Primitive type PrimState (ContT r m) = PrimState m
Methods primitive :: (State# (PrimState (ContT r m)) -> (# State# (PrimState (ContT r m)), a #)) -> ContT r m a #
(Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive type PrimState (RWST r w s m) = PrimState m
Methods primitive :: (State# (PrimState (RWST r w s m)) -> (# State# (PrimState (RWST r w s m)), a #)) -> RWST r w s m a #
(Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive type PrimState (RWST r w s m) = PrimState m
Methods primitive :: (State# (PrimState (RWST r w s m)) -> (# State# (PrimState (RWST r w s m)), a #)) -> RWST r w s m a #
(Monoid w, PrimMonad m) => PrimMonad (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive Associated Types
type PrimState (RWST r w s m) |
Instance details Defined in Control.Monad.Primitive type PrimState (RWST r w s m) = PrimState m
Methods primitive :: (State# (PrimState (RWST r w s m)) -> (# State# (PrimState (RWST r w s m)), a #)) -> RWST r w s m a #

class Foldable (t :: Type -> Type) #

The Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.

Instances can be derived automatically by enabling the `DeriveFoldable` extension. For example, a derived instance for a binary tree might be:

    {-# LANGUAGE DeriveFoldable #-}
    data Tree a = Empty
                | Leaf a
                | Node (Tree a) a (Tree a)
        deriving Foldable

A more detailed description can be found in the Overview section of Data.Foldable.

For the class laws see the Laws section of Data.Foldable.

Minimal complete definition

foldMap | foldr

#### Instances

Instances details

Foldable Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods fold :: Monoid m => Complex m -> m # foldMap :: Monoid m => (a -> m) -> Complex a -> m # foldMap' :: Monoid m => (a -> m) -> Complex a -> m # foldr :: (a -> b -> b) -> b -> Complex a -> b # foldr' :: (a -> b -> b) -> b -> Complex a -> b # foldl :: (b -> a -> b) -> b -> Complex a -> b # foldl' :: (b -> a -> b) -> b -> Complex a -> b # foldr1 :: (a -> a -> a) -> Complex a -> a # foldl1 :: (a -> a -> a) -> Complex a -> a # toList :: Complex a -> [a] # null :: Complex a -> Bool # length :: Complex a -> Int # elem :: Eq a => a -> Complex a -> Bool # maximum :: Ord a => Complex a -> a # minimum :: Ord a => Complex a -> a # sum :: Num a => Complex a -> a # product :: Num a => Complex a -> a #
Foldable First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldMap' :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldMap' :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Max m -> m # foldMap :: Monoid m => (a -> m) -> Max a -> m # foldMap' :: Monoid m => (a -> m) -> Max a -> m # foldr :: (a -> b -> b) -> b -> Max a -> b # foldr' :: (a -> b -> b) -> b -> Max a -> b # foldl :: (b -> a -> b) -> b -> Max a -> b # foldl' :: (b -> a -> b) -> b -> Max a -> b # foldr1 :: (a -> a -> a) -> Max a -> a # foldl1 :: (a -> a -> a) -> Max a -> a # toList :: Max a -> [a] # null :: Max a -> Bool # length :: Max a -> Int # elem :: Eq a => a -> Max a -> Bool # maximum :: Ord a => Max a -> a # minimum :: Ord a => Max a -> a # sum :: Num a => Max a -> a # product :: Num a => Max a -> a #
Foldable Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Min m -> m # foldMap :: Monoid m => (a -> m) -> Min a -> m # foldMap' :: Monoid m => (a -> m) -> Min a -> m # foldr :: (a -> b -> b) -> b -> Min a -> b # foldr' :: (a -> b -> b) -> b -> Min a -> b # foldl :: (b -> a -> b) -> b -> Min a -> b # foldl' :: (b -> a -> b) -> b -> Min a -> b # foldr1 :: (a -> a -> a) -> Min a -> a # foldl1 :: (a -> a -> a) -> Min a -> a # toList :: Min a -> [a] # null :: Min a -> Bool # length :: Min a -> Int # elem :: Eq a => a -> Min a -> Bool # maximum :: Ord a => Min a -> a # minimum :: Ord a => Min a -> a # sum :: Num a => Min a -> a # product :: Num a => Min a -> a #
Foldable SCC | Since: containers-0.5.9
Instance details Defined in Data.Graph Methods fold :: Monoid m => SCC m -> m # foldMap :: Monoid m => (a -> m) -> SCC a -> m # foldMap' :: Monoid m => (a -> m) -> SCC a -> m # foldr :: (a -> b -> b) -> b -> SCC a -> b # foldr' :: (a -> b -> b) -> b -> SCC a -> b # foldl :: (b -> a -> b) -> b -> SCC a -> b # foldl' :: (b -> a -> b) -> b -> SCC a -> b # foldr1 :: (a -> a -> a) -> SCC a -> a # foldl1 :: (a -> a -> a) -> SCC a -> a # toList :: SCC a -> [a] # null :: SCC a -> Bool # length :: SCC a -> Int # elem :: Eq a => a -> SCC a -> Bool # maximum :: Ord a => SCC a -> a # minimum :: Ord a => SCC a -> a # sum :: Num a => SCC a -> a # product :: Num a => SCC a -> a #
Foldable IntMap | Folds in order of increasing key.
Instance details Defined in Data.IntMap.Internal Methods fold :: Monoid m => IntMap m -> m # foldMap :: Monoid m => (a -> m) -> IntMap a -> m # foldMap' :: Monoid m => (a -> m) -> IntMap a -> m # foldr :: (a -> b -> b) -> b -> IntMap a -> b # foldr' :: (a -> b -> b) -> b -> IntMap a -> b # foldl :: (b -> a -> b) -> b -> IntMap a -> b # foldl' :: (b -> a -> b) -> b -> IntMap a -> b # foldr1 :: (a -> a -> a) -> IntMap a -> a # foldl1 :: (a -> a -> a) -> IntMap a -> a # toList :: IntMap a -> [a] # null :: IntMap a -> Bool # length :: IntMap a -> Int # elem :: Eq a => a -> IntMap a -> Bool # maximum :: Ord a => IntMap a -> a # minimum :: Ord a => IntMap a -> a # sum :: Num a => IntMap a -> a # product :: Num a => IntMap a -> a #
Foldable Digit |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => Digit m -> m # foldMap :: Monoid m => (a -> m) -> Digit a -> m # foldMap' :: Monoid m => (a -> m) -> Digit a -> m # foldr :: (a -> b -> b) -> b -> Digit a -> b # foldr' :: (a -> b -> b) -> b -> Digit a -> b # foldl :: (b -> a -> b) -> b -> Digit a -> b # foldl' :: (b -> a -> b) -> b -> Digit a -> b # foldr1 :: (a -> a -> a) -> Digit a -> a # foldl1 :: (a -> a -> a) -> Digit a -> a # toList :: Digit a -> [a] # null :: Digit a -> Bool # length :: Digit a -> Int # elem :: Eq a => a -> Digit a -> Bool # maximum :: Ord a => Digit a -> a # minimum :: Ord a => Digit a -> a # sum :: Num a => Digit a -> a # product :: Num a => Digit a -> a #
Foldable Elem |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => Elem m -> m # foldMap :: Monoid m => (a -> m) -> Elem a -> m # foldMap' :: Monoid m => (a -> m) -> Elem a -> m # foldr :: (a -> b -> b) -> b -> Elem a -> b # foldr' :: (a -> b -> b) -> b -> Elem a -> b # foldl :: (b -> a -> b) -> b -> Elem a -> b # foldl' :: (b -> a -> b) -> b -> Elem a -> b # foldr1 :: (a -> a -> a) -> Elem a -> a # foldl1 :: (a -> a -> a) -> Elem a -> a # toList :: Elem a -> [a] # null :: Elem a -> Bool # length :: Elem a -> Int # elem :: Eq a => a -> Elem a -> Bool # maximum :: Ord a => Elem a -> a # minimum :: Ord a => Elem a -> a # sum :: Num a => Elem a -> a # product :: Num a => Elem a -> a #
Foldable FingerTree |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => FingerTree m -> m # foldMap :: Monoid m => (a -> m) -> FingerTree a -> m # foldMap' :: Monoid m => (a -> m) -> FingerTree a -> m # foldr :: (a -> b -> b) -> b -> FingerTree a -> b # foldr' :: (a -> b -> b) -> b -> FingerTree a -> b # foldl :: (b -> a -> b) -> b -> FingerTree a -> b # foldl' :: (b -> a -> b) -> b -> FingerTree a -> b # foldr1 :: (a -> a -> a) -> FingerTree a -> a # foldl1 :: (a -> a -> a) -> FingerTree a -> a # toList :: FingerTree a -> [a] # null :: FingerTree a -> Bool # length :: FingerTree a -> Int # elem :: Eq a => a -> FingerTree a -> Bool # maximum :: Ord a => FingerTree a -> a # minimum :: Ord a => FingerTree a -> a # sum :: Num a => FingerTree a -> a # product :: Num a => FingerTree a -> a #
Foldable Node |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => Node m -> m # foldMap :: Monoid m => (a -> m) -> Node a -> m # foldMap' :: Monoid m => (a -> m) -> Node a -> m # foldr :: (a -> b -> b) -> b -> Node a -> b # foldr' :: (a -> b -> b) -> b -> Node a -> b # foldl :: (b -> a -> b) -> b -> Node a -> b # foldl' :: (b -> a -> b) -> b -> Node a -> b # foldr1 :: (a -> a -> a) -> Node a -> a # foldl1 :: (a -> a -> a) -> Node a -> a # toList :: Node a -> [a] # null :: Node a -> Bool # length :: Node a -> Int # elem :: Eq a => a -> Node a -> Bool # maximum :: Ord a => Node a -> a # minimum :: Ord a => Node a -> a # sum :: Num a => Node a -> a # product :: Num a => Node a -> a #
Foldable Seq |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => Seq m -> m # foldMap :: Monoid m => (a -> m) -> Seq a -> m # foldMap' :: Monoid m => (a -> m) -> Seq a -> m # foldr :: (a -> b -> b) -> b -> Seq a -> b # foldr' :: (a -> b -> b) -> b -> Seq a -> b # foldl :: (b -> a -> b) -> b -> Seq a -> b # foldl' :: (b -> a -> b) -> b -> Seq a -> b # foldr1 :: (a -> a -> a) -> Seq a -> a # foldl1 :: (a -> a -> a) -> Seq a -> a # toList :: Seq a -> [a] # null :: Seq a -> Bool # length :: Seq a -> Int # elem :: Eq a => a -> Seq a -> Bool # maximum :: Ord a => Seq a -> a # minimum :: Ord a => Seq a -> a # sum :: Num a => Seq a -> a # product :: Num a => Seq a -> a #
Foldable ViewL |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => ViewL m -> m # foldMap :: Monoid m => (a -> m) -> ViewL a -> m # foldMap' :: Monoid m => (a -> m) -> ViewL a -> m # foldr :: (a -> b -> b) -> b -> ViewL a -> b # foldr' :: (a -> b -> b) -> b -> ViewL a -> b # foldl :: (b -> a -> b) -> b -> ViewL a -> b # foldl' :: (b -> a -> b) -> b -> ViewL a -> b # foldr1 :: (a -> a -> a) -> ViewL a -> a # foldl1 :: (a -> a -> a) -> ViewL a -> a # toList :: ViewL a -> [a] # null :: ViewL a -> Bool # length :: ViewL a -> Int # elem :: Eq a => a -> ViewL a -> Bool # maximum :: Ord a => ViewL a -> a # minimum :: Ord a => ViewL a -> a # sum :: Num a => ViewL a -> a # product :: Num a => ViewL a -> a #
Foldable ViewR |
Instance details Defined in Data.Sequence.Internal Methods fold :: Monoid m => ViewR m -> m # foldMap :: Monoid m => (a -> m) -> ViewR a -> m # foldMap' :: Monoid m => (a -> m) -> ViewR a -> m # foldr :: (a -> b -> b) -> b -> ViewR a -> b # foldr' :: (a -> b -> b) -> b -> ViewR a -> b # foldl :: (b -> a -> b) -> b -> ViewR a -> b # foldl' :: (b -> a -> b) -> b -> ViewR a -> b # foldr1 :: (a -> a -> a) -> ViewR a -> a # foldl1 :: (a -> a -> a) -> ViewR a -> a # toList :: ViewR a -> [a] # null :: ViewR a -> Bool # length :: ViewR a -> Int # elem :: Eq a => a -> ViewR a -> Bool # maximum :: Ord a => ViewR a -> a # minimum :: Ord a => ViewR a -> a # sum :: Num a => ViewR a -> a # product :: Num a => ViewR a -> a #
Foldable Set | Folds in order of increasing key.
Instance details Defined in Data.Set.Internal Methods fold :: Monoid m => Set m -> m # foldMap :: Monoid m => (a -> m) -> Set a -> m # foldMap' :: Monoid m => (a -> m) -> Set a -> m # foldr :: (a -> b -> b) -> b -> Set a -> b # foldr' :: (a -> b -> b) -> b -> Set a -> b # foldl :: (b -> a -> b) -> b -> Set a -> b # foldl' :: (b -> a -> b) -> b -> Set a -> b # foldr1 :: (a -> a -> a) -> Set a -> a # foldl1 :: (a -> a -> a) -> Set a -> a # toList :: Set a -> [a] # null :: Set a -> Bool # length :: Set a -> Int # elem :: Eq a => a -> Set a -> Bool # maximum :: Ord a => Set a -> a # minimum :: Ord a => Set a -> a # sum :: Num a => Set a -> a # product :: Num a => Set a -> a #
Foldable Tree | Folds in preorder
Instance details Defined in Data.Tree Methods fold :: Monoid m => Tree m -> m # foldMap :: Monoid m => (a -> m) -> Tree a -> m # foldMap' :: Monoid m => (a -> m) -> Tree a -> m # foldr :: (a -> b -> b) -> b -> Tree a -> b # foldr' :: (a -> b -> b) -> b -> Tree a -> b # foldl :: (b -> a -> b) -> b -> Tree a -> b # foldl' :: (b -> a -> b) -> b -> Tree a -> b # foldr1 :: (a -> a -> a) -> Tree a -> a # foldl1 :: (a -> a -> a) -> Tree a -> a # toList :: Tree a -> [a] # null :: Tree a -> Bool # length :: Tree a -> Int # elem :: Eq a => a -> Tree a -> Bool # maximum :: Ord a => Tree a -> a # minimum :: Ord a => Tree a -> a # sum :: Num a => Tree a -> a # product :: Num a => Tree a -> a #
Foldable NonEmpty | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # toList :: NonEmpty a -> [a] # null :: NonEmpty a -> Bool # length :: NonEmpty a -> Int # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # sum :: Num a => NonEmpty a -> a # product :: Num a => NonEmpty a -> a #
Foldable Identity | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Functor.Identity Methods fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldMap' :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # toList :: Identity a -> [a] # null :: Identity a -> Bool # length :: Identity a -> Int # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # sum :: Num a => Identity a -> a # product :: Num a => Identity a -> a #
Foldable First | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldMap' :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Last | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldMap' :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable Down | @since base-4.12.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Down m -> m # foldMap :: Monoid m => (a -> m) -> Down a -> m # foldMap' :: Monoid m => (a -> m) -> Down a -> m # foldr :: (a -> b -> b) -> b -> Down a -> b # foldr' :: (a -> b -> b) -> b -> Down a -> b # foldl :: (b -> a -> b) -> b -> Down a -> b # foldl' :: (b -> a -> b) -> b -> Down a -> b # foldr1 :: (a -> a -> a) -> Down a -> a # foldl1 :: (a -> a -> a) -> Down a -> a # toList :: Down a -> [a] # null :: Down a -> Bool # length :: Down a -> Int # elem :: Eq a => a -> Down a -> Bool # maximum :: Ord a => Down a -> a # minimum :: Ord a => Down a -> a # sum :: Num a => Down a -> a # product :: Num a => Down a -> a #
Foldable Dual | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldMap' :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # toList :: Dual a -> [a] # null :: Dual a -> Bool # length :: Dual a -> Int # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # minimum :: Ord a => Dual a -> a # sum :: Num a => Dual a -> a # product :: Num a => Dual a -> a #
Foldable Product | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldMap' :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # toList :: Product a -> [a] # null :: Product a -> Bool # length :: Product a -> Int # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # sum :: Num a => Product a -> a # product :: Num a => Product a -> a #
Foldable Sum | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldMap' :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # toList :: Sum a -> [a] # null :: Sum a -> Bool # length :: Sum a -> Int # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # minimum :: Ord a => Sum a -> a # sum :: Num a => Sum a -> a # product :: Num a => Sum a -> a #
Foldable Par1 | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldMap' :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # toList :: Par1 a -> [a] # null :: Par1 a -> Bool # length :: Par1 a -> Int # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # minimum :: Ord a => Par1 a -> a # sum :: Num a => Par1 a -> a # product :: Num a => Par1 a -> a #
Foldable Hashed |
Instance details Defined in Data.Hashable.Class Methods fold :: Monoid m => Hashed m -> m # foldMap :: Monoid m => (a -> m) -> Hashed a -> m # foldMap' :: Monoid m => (a -> m) -> Hashed a -> m # foldr :: (a -> b -> b) -> b -> Hashed a -> b # foldr' :: (a -> b -> b) -> b -> Hashed a -> b # foldl :: (b -> a -> b) -> b -> Hashed a -> b # foldl' :: (b -> a -> b) -> b -> Hashed a -> b # foldr1 :: (a -> a -> a) -> Hashed a -> a # foldl1 :: (a -> a -> a) -> Hashed a -> a # toList :: Hashed a -> [a] # null :: Hashed a -> Bool # length :: Hashed a -> Int # elem :: Eq a => a -> Hashed a -> Bool # maximum :: Ord a => Hashed a -> a # minimum :: Ord a => Hashed a -> a # sum :: Num a => Hashed a -> a # product :: Num a => Hashed a -> a #
Foldable Array |
Instance details Defined in Data.Primitive.Array Methods fold :: Monoid m => Array m -> m # foldMap :: Monoid m => (a -> m) -> Array a -> m # foldMap' :: Monoid m => (a -> m) -> Array a -> m # foldr :: (a -> b -> b) -> b -> Array a -> b # foldr' :: (a -> b -> b) -> b -> Array a -> b # foldl :: (b -> a -> b) -> b -> Array a -> b # foldl' :: (b -> a -> b) -> b -> Array a -> b # foldr1 :: (a -> a -> a) -> Array a -> a # foldl1 :: (a -> a -> a) -> Array a -> a # toList :: Array a -> [a] # null :: Array a -> Bool # length :: Array a -> Int # elem :: Eq a => a -> Array a -> Bool # maximum :: Ord a => Array a -> a # minimum :: Ord a => Array a -> a # sum :: Num a => Array a -> a # product :: Num a => Array a -> a #
Foldable SmallArray |
Instance details Defined in Data.Primitive.SmallArray Methods fold :: Monoid m => SmallArray m -> m # foldMap :: Monoid m => (a -> m) -> SmallArray a -> m # foldMap' :: Monoid m => (a -> m) -> SmallArray a -> m # foldr :: (a -> b -> b) -> b -> SmallArray a -> b # foldr' :: (a -> b -> b) -> b -> SmallArray a -> b # foldl :: (b -> a -> b) -> b -> SmallArray a -> b # foldl' :: (b -> a -> b) -> b -> SmallArray a -> b # foldr1 :: (a -> a -> a) -> SmallArray a -> a # foldl1 :: (a -> a -> a) -> SmallArray a -> a # toList :: SmallArray a -> [a] # null :: SmallArray a -> Bool # length :: SmallArray a -> Int # elem :: Eq a => a -> SmallArray a -> Bool # maximum :: Ord a => SmallArray a -> a # minimum :: Ord a => SmallArray a -> a # sum :: Num a => SmallArray a -> a # product :: Num a => SmallArray a -> a #
Foldable HashSet |
Instance details Defined in Data.HashSet.Internal Methods fold :: Monoid m => HashSet m -> m # foldMap :: Monoid m => (a -> m) -> HashSet a -> m # foldMap' :: Monoid m => (a -> m) -> HashSet a -> m # foldr :: (a -> b -> b) -> b -> HashSet a -> b # foldr' :: (a -> b -> b) -> b -> HashSet a -> b # foldl :: (b -> a -> b) -> b -> HashSet a -> b # foldl' :: (b -> a -> b) -> b -> HashSet a -> b # foldr1 :: (a -> a -> a) -> HashSet a -> a # foldl1 :: (a -> a -> a) -> HashSet a -> a # toList :: HashSet a -> [a] # null :: HashSet a -> Bool # length :: HashSet a -> Int # elem :: Eq a => a -> HashSet a -> Bool # maximum :: Ord a => HashSet a -> a # minimum :: Ord a => HashSet a -> a # sum :: Num a => HashSet a -> a # product :: Num a => HashSet a -> a #
Foldable Vector |
Instance details Defined in Data.Vector Methods fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldMap' :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # toList :: Vector a -> [a] # null :: Vector a -> Bool # length :: Vector a -> Int # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # sum :: Num a => Vector a -> a # product :: Num a => Vector a -> a #
Foldable Vector |
Instance details Defined in Data.Vector.Strict Methods fold :: Monoid m => Vector m -> m # foldMap :: Monoid m => (a -> m) -> Vector a -> m # foldMap' :: Monoid m => (a -> m) -> Vector a -> m # foldr :: (a -> b -> b) -> b -> Vector a -> b # foldr' :: (a -> b -> b) -> b -> Vector a -> b # foldl :: (b -> a -> b) -> b -> Vector a -> b # foldl' :: (b -> a -> b) -> b -> Vector a -> b # foldr1 :: (a -> a -> a) -> Vector a -> a # foldl1 :: (a -> a -> a) -> Vector a -> a # toList :: Vector a -> [a] # null :: Vector a -> Bool # length :: Vector a -> Int # elem :: Eq a => a -> Vector a -> Bool # maximum :: Ord a => Vector a -> a # minimum :: Ord a => Vector a -> a # sum :: Num a => Vector a -> a # product :: Num a => Vector a -> a #
Foldable Maybe | @since base-2.01
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldMap' :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # toList :: Maybe a -> [a] # null :: Maybe a -> Bool # length :: Maybe a -> Int # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # sum :: Num a => Maybe a -> a # product :: Num a => Maybe a -> a #
Foldable Solo | @since base-4.15
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Solo m -> m # foldMap :: Monoid m => (a -> m) -> Solo a -> m # foldMap' :: Monoid m => (a -> m) -> Solo a -> m # foldr :: (a -> b -> b) -> b -> Solo a -> b # foldr' :: (a -> b -> b) -> b -> Solo a -> b # foldl :: (b -> a -> b) -> b -> Solo a -> b # foldl' :: (b -> a -> b) -> b -> Solo a -> b # foldr1 :: (a -> a -> a) -> Solo a -> a # foldl1 :: (a -> a -> a) -> Solo a -> a # toList :: Solo a -> [a] # null :: Solo a -> Bool # length :: Solo a -> Int # elem :: Eq a => a -> Solo a -> Bool # maximum :: Ord a => Solo a -> a # minimum :: Ord a => Solo a -> a # sum :: Num a => Solo a -> a # product :: Num a => Solo a -> a #
Foldable [] | @since base-2.01
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => [m] -> m # foldMap :: Monoid m => (a -> m) -> [a] -> m # foldMap' :: Monoid m => (a -> m) -> [a] -> m # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # toList :: [a] -> [a] # null :: [a] -> Bool # length :: [a] -> Int # elem :: Eq a => a -> [a] -> Bool # maximum :: Ord a => [a] -> a # minimum :: Ord a => [a] -> a # sum :: Num a => [a] -> a # product :: Num a => [a] -> a #
Foldable (Arg a) | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Arg a m -> m # foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # toList :: Arg a a0 -> [a0] # null :: Arg a a0 -> Bool # length :: Arg a a0 -> Int # elem :: Eq a0 => a0 -> Arg a a0 -> Bool # maximum :: Ord a0 => Arg a a0 -> a0 # minimum :: Ord a0 => Arg a a0 -> a0 # sum :: Num a0 => Arg a a0 -> a0 # product :: Num a0 => Arg a a0 -> a0 #
Foldable (Map k) | Folds in order of increasing key.
Instance details Defined in Data.Map.Internal Methods fold :: Monoid m => Map k m -> m # foldMap :: Monoid m => (a -> m) -> Map k a -> m # foldMap' :: Monoid m => (a -> m) -> Map k a -> m # foldr :: (a -> b -> b) -> b -> Map k a -> b # foldr' :: (a -> b -> b) -> b -> Map k a -> b # foldl :: (b -> a -> b) -> b -> Map k a -> b # foldl' :: (b -> a -> b) -> b -> Map k a -> b # foldr1 :: (a -> a -> a) -> Map k a -> a # foldl1 :: (a -> a -> a) -> Map k a -> a # toList :: Map k a -> [a] # null :: Map k a -> Bool # length :: Map k a -> Int # elem :: Eq a => a -> Map k a -> Bool # maximum :: Ord a => Map k a -> a # minimum :: Ord a => Map k a -> a # sum :: Num a => Map k a -> a # product :: Num a => Map k a -> a #
Foldable (Array i) | @since base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Array i m -> m # foldMap :: Monoid m => (a -> m) -> Array i a -> m # foldMap' :: Monoid m => (a -> m) -> Array i a -> m # foldr :: (a -> b -> b) -> b -> Array i a -> b # foldr' :: (a -> b -> b) -> b -> Array i a -> b # foldl :: (b -> a -> b) -> b -> Array i a -> b # foldl' :: (b -> a -> b) -> b -> Array i a -> b # foldr1 :: (a -> a -> a) -> Array i a -> a # foldl1 :: (a -> a -> a) -> Array i a -> a # toList :: Array i a -> [a] # null :: Array i a -> Bool # length :: Array i a -> Int # elem :: Eq a => a -> Array i a -> Bool # maximum :: Ord a => Array i a -> a # minimum :: Ord a => Array i a -> a # sum :: Num a => Array i a -> a # product :: Num a => Array i a -> a #
Foldable (Either a) | @since base-4.7.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # null :: Either a a0 -> Bool # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # sum :: Num a0 => Either a a0 -> a0 # product :: Num a0 => Either a a0 -> a0 #
Foldable (Proxy :: Type -> Type) | @since base-4.7.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldMap' :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # toList :: Proxy a -> [a] # null :: Proxy a -> Bool # length :: Proxy a -> Int # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # sum :: Num a => Proxy a -> a # product :: Num a => Proxy a -> a #
Foldable (U1 :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldMap' :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # toList :: U1 a -> [a] # null :: U1 a -> Bool # length :: U1 a -> Int # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # minimum :: Ord a => U1 a -> a # sum :: Num a => U1 a -> a # product :: Num a => U1 a -> a #
Foldable (UAddr :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UAddr m -> m # foldMap :: Monoid m => (a -> m) -> UAddr a -> m # foldMap' :: Monoid m => (a -> m) -> UAddr a -> m # foldr :: (a -> b -> b) -> b -> UAddr a -> b # foldr' :: (a -> b -> b) -> b -> UAddr a -> b # foldl :: (b -> a -> b) -> b -> UAddr a -> b # foldl' :: (b -> a -> b) -> b -> UAddr a -> b # foldr1 :: (a -> a -> a) -> UAddr a -> a # foldl1 :: (a -> a -> a) -> UAddr a -> a # toList :: UAddr a -> [a] # null :: UAddr a -> Bool # length :: UAddr a -> Int # elem :: Eq a => a -> UAddr a -> Bool # maximum :: Ord a => UAddr a -> a # minimum :: Ord a => UAddr a -> a # sum :: Num a => UAddr a -> a # product :: Num a => UAddr a -> a #
Foldable (UChar :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UChar m -> m # foldMap :: Monoid m => (a -> m) -> UChar a -> m # foldMap' :: Monoid m => (a -> m) -> UChar a -> m # foldr :: (a -> b -> b) -> b -> UChar a -> b # foldr' :: (a -> b -> b) -> b -> UChar a -> b # foldl :: (b -> a -> b) -> b -> UChar a -> b # foldl' :: (b -> a -> b) -> b -> UChar a -> b # foldr1 :: (a -> a -> a) -> UChar a -> a # foldl1 :: (a -> a -> a) -> UChar a -> a # toList :: UChar a -> [a] # null :: UChar a -> Bool # length :: UChar a -> Int # elem :: Eq a => a -> UChar a -> Bool # maximum :: Ord a => UChar a -> a # minimum :: Ord a => UChar a -> a # sum :: Num a => UChar a -> a # product :: Num a => UChar a -> a #
Foldable (UDouble :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UDouble m -> m # foldMap :: Monoid m => (a -> m) -> UDouble a -> m # foldMap' :: Monoid m => (a -> m) -> UDouble a -> m # foldr :: (a -> b -> b) -> b -> UDouble a -> b # foldr' :: (a -> b -> b) -> b -> UDouble a -> b # foldl :: (b -> a -> b) -> b -> UDouble a -> b # foldl' :: (b -> a -> b) -> b -> UDouble a -> b # foldr1 :: (a -> a -> a) -> UDouble a -> a # foldl1 :: (a -> a -> a) -> UDouble a -> a # toList :: UDouble a -> [a] # null :: UDouble a -> Bool # length :: UDouble a -> Int # elem :: Eq a => a -> UDouble a -> Bool # maximum :: Ord a => UDouble a -> a # minimum :: Ord a => UDouble a -> a # sum :: Num a => UDouble a -> a # product :: Num a => UDouble a -> a #
Foldable (UFloat :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UFloat m -> m # foldMap :: Monoid m => (a -> m) -> UFloat a -> m # foldMap' :: Monoid m => (a -> m) -> UFloat a -> m # foldr :: (a -> b -> b) -> b -> UFloat a -> b # foldr' :: (a -> b -> b) -> b -> UFloat a -> b # foldl :: (b -> a -> b) -> b -> UFloat a -> b # foldl' :: (b -> a -> b) -> b -> UFloat a -> b # foldr1 :: (a -> a -> a) -> UFloat a -> a # foldl1 :: (a -> a -> a) -> UFloat a -> a # toList :: UFloat a -> [a] # null :: UFloat a -> Bool # length :: UFloat a -> Int # elem :: Eq a => a -> UFloat a -> Bool # maximum :: Ord a => UFloat a -> a # minimum :: Ord a => UFloat a -> a # sum :: Num a => UFloat a -> a # product :: Num a => UFloat a -> a #
Foldable (UInt :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UInt m -> m # foldMap :: Monoid m => (a -> m) -> UInt a -> m # foldMap' :: Monoid m => (a -> m) -> UInt a -> m # foldr :: (a -> b -> b) -> b -> UInt a -> b # foldr' :: (a -> b -> b) -> b -> UInt a -> b # foldl :: (b -> a -> b) -> b -> UInt a -> b # foldl' :: (b -> a -> b) -> b -> UInt a -> b # foldr1 :: (a -> a -> a) -> UInt a -> a # foldl1 :: (a -> a -> a) -> UInt a -> a # toList :: UInt a -> [a] # null :: UInt a -> Bool # length :: UInt a -> Int # elem :: Eq a => a -> UInt a -> Bool # maximum :: Ord a => UInt a -> a # minimum :: Ord a => UInt a -> a # sum :: Num a => UInt a -> a # product :: Num a => UInt a -> a #
Foldable (UWord :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => UWord m -> m # foldMap :: Monoid m => (a -> m) -> UWord a -> m # foldMap' :: Monoid m => (a -> m) -> UWord a -> m # foldr :: (a -> b -> b) -> b -> UWord a -> b # foldr' :: (a -> b -> b) -> b -> UWord a -> b # foldl :: (b -> a -> b) -> b -> UWord a -> b # foldl' :: (b -> a -> b) -> b -> UWord a -> b # foldr1 :: (a -> a -> a) -> UWord a -> a # foldl1 :: (a -> a -> a) -> UWord a -> a # toList :: UWord a -> [a] # null :: UWord a -> Bool # length :: UWord a -> Int # elem :: Eq a => a -> UWord a -> Bool # maximum :: Ord a => UWord a -> a # minimum :: Ord a => UWord a -> a # sum :: Num a => UWord a -> a # product :: Num a => UWord a -> a #
Foldable (V1 :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldMap' :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # toList :: V1 a -> [a] # null :: V1 a -> Bool # length :: V1 a -> Int # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # minimum :: Ord a => V1 a -> a # sum :: Num a => V1 a -> a # product :: Num a => V1 a -> a #
Foldable f => Foldable (Lift f) |
Instance details Defined in Control.Applicative.Lift Methods fold :: Monoid m => Lift f m -> m # foldMap :: Monoid m => (a -> m) -> Lift f a -> m # foldMap' :: Monoid m => (a -> m) -> Lift f a -> m # foldr :: (a -> b -> b) -> b -> Lift f a -> b # foldr' :: (a -> b -> b) -> b -> Lift f a -> b # foldl :: (b -> a -> b) -> b -> Lift f a -> b # foldl' :: (b -> a -> b) -> b -> Lift f a -> b # foldr1 :: (a -> a -> a) -> Lift f a -> a # foldl1 :: (a -> a -> a) -> Lift f a -> a # toList :: Lift f a -> [a] # null :: Lift f a -> Bool # length :: Lift f a -> Int # elem :: Eq a => a -> Lift f a -> Bool # maximum :: Ord a => Lift f a -> a # minimum :: Ord a => Lift f a -> a # sum :: Num a => Lift f a -> a # product :: Num a => Lift f a -> a #
Foldable f => Foldable (MaybeT f) |
Instance details Defined in Control.Monad.Trans.Maybe Methods fold :: Monoid m => MaybeT f m -> m # foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m # foldMap' :: Monoid m => (a -> m) -> MaybeT f a -> m # foldr :: (a -> b -> b) -> b -> MaybeT f a -> b # foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b # foldl :: (b -> a -> b) -> b -> MaybeT f a -> b # foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b # foldr1 :: (a -> a -> a) -> MaybeT f a -> a # foldl1 :: (a -> a -> a) -> MaybeT f a -> a # toList :: MaybeT f a -> [a] # null :: MaybeT f a -> Bool # length :: MaybeT f a -> Int # elem :: Eq a => a -> MaybeT f a -> Bool # maximum :: Ord a => MaybeT f a -> a # minimum :: Ord a => MaybeT f a -> a # sum :: Num a => MaybeT f a -> a # product :: Num a => MaybeT f a -> a #
Foldable (HashMap k) |
Instance details Defined in Data.HashMap.Internal Methods fold :: Monoid m => HashMap k m -> m # foldMap :: Monoid m => (a -> m) -> HashMap k a -> m # foldMap' :: Monoid m => (a -> m) -> HashMap k a -> m # foldr :: (a -> b -> b) -> b -> HashMap k a -> b # foldr' :: (a -> b -> b) -> b -> HashMap k a -> b # foldl :: (b -> a -> b) -> b -> HashMap k a -> b # foldl' :: (b -> a -> b) -> b -> HashMap k a -> b # foldr1 :: (a -> a -> a) -> HashMap k a -> a # foldl1 :: (a -> a -> a) -> HashMap k a -> a # toList :: HashMap k a -> [a] # null :: HashMap k a -> Bool # length :: HashMap k a -> Int # elem :: Eq a => a -> HashMap k a -> Bool # maximum :: Ord a => HashMap k a -> a # minimum :: Ord a => HashMap k a -> a # sum :: Num a => HashMap k a -> a # product :: Num a => HashMap k a -> a #
Foldable ((,) a) | @since base-4.7.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => (a, m) -> m # foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldMap' :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # toList :: (a, a0) -> [a0] # null :: (a, a0) -> Bool # length :: (a, a0) -> Int # elem :: Eq a0 => a0 -> (a, a0) -> Bool # maximum :: Ord a0 => (a, a0) -> a0 # minimum :: Ord a0 => (a, a0) -> a0 # sum :: Num a0 => (a, a0) -> a0 # product :: Num a0 => (a, a0) -> a0 #
Bifoldable p => Foldable (Join p) |
Instance details Defined in Data.Bifunctor.Join Methods fold :: Monoid m => Join p m -> m # foldMap :: Monoid m => (a -> m) -> Join p a -> m # foldMap' :: Monoid m => (a -> m) -> Join p a -> m # foldr :: (a -> b -> b) -> b -> Join p a -> b # foldr' :: (a -> b -> b) -> b -> Join p a -> b # foldl :: (b -> a -> b) -> b -> Join p a -> b # foldl' :: (b -> a -> b) -> b -> Join p a -> b # foldr1 :: (a -> a -> a) -> Join p a -> a # foldl1 :: (a -> a -> a) -> Join p a -> a # toList :: Join p a -> [a] # null :: Join p a -> Bool # length :: Join p a -> Int # elem :: Eq a => a -> Join p a -> Bool # maximum :: Ord a => Join p a -> a # minimum :: Ord a => Join p a -> a # sum :: Num a => Join p a -> a # product :: Num a => Join p a -> a #
Foldable w => Foldable (EnvT e w) |
Instance details Defined in Control.Comonad.Trans.Env Methods fold :: Monoid m => EnvT e w m -> m # foldMap :: Monoid m => (a -> m) -> EnvT e w a -> m # foldMap' :: Monoid m => (a -> m) -> EnvT e w a -> m # foldr :: (a -> b -> b) -> b -> EnvT e w a -> b # foldr' :: (a -> b -> b) -> b -> EnvT e w a -> b # foldl :: (b -> a -> b) -> b -> EnvT e w a -> b # foldl' :: (b -> a -> b) -> b -> EnvT e w a -> b # foldr1 :: (a -> a -> a) -> EnvT e w a -> a # foldl1 :: (a -> a -> a) -> EnvT e w a -> a # toList :: EnvT e w a -> [a] # null :: EnvT e w a -> Bool # length :: EnvT e w a -> Int # elem :: Eq a => a -> EnvT e w a -> Bool # maximum :: Ord a => EnvT e w a -> a # minimum :: Ord a => EnvT e w a -> a # sum :: Num a => EnvT e w a -> a # product :: Num a => EnvT e w a -> a #
Foldable (Const m :: Type -> Type) | @since base-4.7.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # toList :: Const m a -> [a] # null :: Const m a -> Bool # length :: Const m a -> Int # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # sum :: Num a => Const m a -> a # product :: Num a => Const m a -> a #
Foldable f => Foldable (Ap f) | @since base-4.12.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Ap f m -> m # foldMap :: Monoid m => (a -> m) -> Ap f a -> m # foldMap' :: Monoid m => (a -> m) -> Ap f a -> m # foldr :: (a -> b -> b) -> b -> Ap f a -> b # foldr' :: (a -> b -> b) -> b -> Ap f a -> b # foldl :: (b -> a -> b) -> b -> Ap f a -> b # foldl' :: (b -> a -> b) -> b -> Ap f a -> b # foldr1 :: (a -> a -> a) -> Ap f a -> a # foldl1 :: (a -> a -> a) -> Ap f a -> a # toList :: Ap f a -> [a] # null :: Ap f a -> Bool # length :: Ap f a -> Int # elem :: Eq a => a -> Ap f a -> Bool # maximum :: Ord a => Ap f a -> a # minimum :: Ord a => Ap f a -> a # sum :: Num a => Ap f a -> a # product :: Num a => Ap f a -> a #
Foldable f => Foldable (Alt f) | @since base-4.12.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Alt f m -> m # foldMap :: Monoid m => (a -> m) -> Alt f a -> m # foldMap' :: Monoid m => (a -> m) -> Alt f a -> m # foldr :: (a -> b -> b) -> b -> Alt f a -> b # foldr' :: (a -> b -> b) -> b -> Alt f a -> b # foldl :: (b -> a -> b) -> b -> Alt f a -> b # foldl' :: (b -> a -> b) -> b -> Alt f a -> b # foldr1 :: (a -> a -> a) -> Alt f a -> a # foldl1 :: (a -> a -> a) -> Alt f a -> a # toList :: Alt f a -> [a] # null :: Alt f a -> Bool # length :: Alt f a -> Int # elem :: Eq a => a -> Alt f a -> Bool # maximum :: Ord a => Alt f a -> a # minimum :: Ord a => Alt f a -> a # sum :: Num a => Alt f a -> a # product :: Num a => Alt f a -> a #
Foldable f => Foldable (Rec1 f) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => Rec1 f m -> m # foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m # foldMap' :: Monoid m => (a -> m) -> Rec1 f a -> m # foldr :: (a -> b -> b) -> b -> Rec1 f a -> b # foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b # foldl :: (b -> a -> b) -> b -> Rec1 f a -> b # foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b # foldr1 :: (a -> a -> a) -> Rec1 f a -> a # foldl1 :: (a -> a -> a) -> Rec1 f a -> a # toList :: Rec1 f a -> [a] # null :: Rec1 f a -> Bool # length :: Rec1 f a -> Int # elem :: Eq a => a -> Rec1 f a -> Bool # maximum :: Ord a => Rec1 f a -> a # minimum :: Ord a => Rec1 f a -> a # sum :: Num a => Rec1 f a -> a # product :: Num a => Rec1 f a -> a #
Foldable (Baz t b) |
Instance details Defined in Data.Profunctor.Traversing Methods fold :: Monoid m => Baz t b m -> m # foldMap :: Monoid m => (a -> m) -> Baz t b a -> m # foldMap' :: Monoid m => (a -> m) -> Baz t b a -> m # foldr :: (a -> b0 -> b0) -> b0 -> Baz t b a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> Baz t b a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> Baz t b a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> Baz t b a -> b0 # foldr1 :: (a -> a -> a) -> Baz t b a -> a # foldl1 :: (a -> a -> a) -> Baz t b a -> a # toList :: Baz t b a -> [a] # null :: Baz t b a -> Bool # length :: Baz t b a -> Int # elem :: Eq a => a -> Baz t b a -> Bool # maximum :: Ord a => Baz t b a -> a # minimum :: Ord a => Baz t b a -> a # sum :: Num a => Baz t b a -> a # product :: Num a => Baz t b a -> a #
Foldable (Tagged s) |
Instance details Defined in Data.Tagged Methods fold :: Monoid m => Tagged s m -> m # foldMap :: Monoid m => (a -> m) -> Tagged s a -> m # foldMap' :: Monoid m => (a -> m) -> Tagged s a -> m # foldr :: (a -> b -> b) -> b -> Tagged s a -> b # foldr' :: (a -> b -> b) -> b -> Tagged s a -> b # foldl :: (b -> a -> b) -> b -> Tagged s a -> b # foldl' :: (b -> a -> b) -> b -> Tagged s a -> b # foldr1 :: (a -> a -> a) -> Tagged s a -> a # foldl1 :: (a -> a -> a) -> Tagged s a -> a # toList :: Tagged s a -> [a] # null :: Tagged s a -> Bool # length :: Tagged s a -> Int # elem :: Eq a => a -> Tagged s a -> Bool # maximum :: Ord a => Tagged s a -> a # minimum :: Ord a => Tagged s a -> a # sum :: Num a => Tagged s a -> a # product :: Num a => Tagged s a -> a #
Foldable f => Foldable (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods fold :: Monoid m => Backwards f m -> m # foldMap :: Monoid m => (a -> m) -> Backwards f a -> m # foldMap' :: Monoid m => (a -> m) -> Backwards f a -> m # foldr :: (a -> b -> b) -> b -> Backwards f a -> b # foldr' :: (a -> b -> b) -> b -> Backwards f a -> b # foldl :: (b -> a -> b) -> b -> Backwards f a -> b # foldl' :: (b -> a -> b) -> b -> Backwards f a -> b # foldr1 :: (a -> a -> a) -> Backwards f a -> a # foldl1 :: (a -> a -> a) -> Backwards f a -> a # toList :: Backwards f a -> [a] # null :: Backwards f a -> Bool # length :: Backwards f a -> Int # elem :: Eq a => a -> Backwards f a -> Bool # maximum :: Ord a => Backwards f a -> a # minimum :: Ord a => Backwards f a -> a # sum :: Num a => Backwards f a -> a # product :: Num a => Backwards f a -> a #
Foldable f => Foldable (ExceptT e f) |
Instance details Defined in Control.Monad.Trans.Except Methods fold :: Monoid m => ExceptT e f m -> m # foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m # foldMap' :: Monoid m => (a -> m) -> ExceptT e f a -> m # foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b # foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b # foldr1 :: (a -> a -> a) -> ExceptT e f a -> a # foldl1 :: (a -> a -> a) -> ExceptT e f a -> a # toList :: ExceptT e f a -> [a] # null :: ExceptT e f a -> Bool # length :: ExceptT e f a -> Int # elem :: Eq a => a -> ExceptT e f a -> Bool # maximum :: Ord a => ExceptT e f a -> a # minimum :: Ord a => ExceptT e f a -> a # sum :: Num a => ExceptT e f a -> a # product :: Num a => ExceptT e f a -> a #
Foldable f => Foldable (IdentityT f) |
Instance details Defined in Control.Monad.Trans.Identity Methods fold :: Monoid m => IdentityT f m -> m # foldMap :: Monoid m => (a -> m) -> IdentityT f a -> m # foldMap' :: Monoid m => (a -> m) -> IdentityT f a -> m # foldr :: (a -> b -> b) -> b -> IdentityT f a -> b # foldr' :: (a -> b -> b) -> b -> IdentityT f a -> b # foldl :: (b -> a -> b) -> b -> IdentityT f a -> b # foldl' :: (b -> a -> b) -> b -> IdentityT f a -> b # foldr1 :: (a -> a -> a) -> IdentityT f a -> a # foldl1 :: (a -> a -> a) -> IdentityT f a -> a # toList :: IdentityT f a -> [a] # null :: IdentityT f a -> Bool # length :: IdentityT f a -> Int # elem :: Eq a => a -> IdentityT f a -> Bool # maximum :: Ord a => IdentityT f a -> a # minimum :: Ord a => IdentityT f a -> a # sum :: Num a => IdentityT f a -> a # product :: Num a => IdentityT f a -> a #
Foldable f => Foldable (WriterT w f) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldMap' :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # sum :: Num a => WriterT w f a -> a # product :: Num a => WriterT w f a -> a #
Foldable f => Foldable (WriterT w f) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods fold :: Monoid m => WriterT w f m -> m # foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m # foldMap' :: Monoid m => (a -> m) -> WriterT w f a -> m # foldr :: (a -> b -> b) -> b -> WriterT w f a -> b # foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b # foldl :: (b -> a -> b) -> b -> WriterT w f a -> b # foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b # foldr1 :: (a -> a -> a) -> WriterT w f a -> a # foldl1 :: (a -> a -> a) -> WriterT w f a -> a # toList :: WriterT w f a -> [a] # null :: WriterT w f a -> Bool # length :: WriterT w f a -> Int # elem :: Eq a => a -> WriterT w f a -> Bool # maximum :: Ord a => WriterT w f a -> a # minimum :: Ord a => WriterT w f a -> a # sum :: Num a => WriterT w f a -> a # product :: Num a => WriterT w f a -> a #
Foldable (Constant a :: Type -> Type) |
Instance details Defined in Data.Functor.Constant Methods fold :: Monoid m => Constant a m -> m # foldMap :: Monoid m => (a0 -> m) -> Constant a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Constant a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Constant a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Constant a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Constant a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Constant a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Constant a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Constant a a0 -> a0 # toList :: Constant a a0 -> [a0] # null :: Constant a a0 -> Bool # length :: Constant a a0 -> Int # elem :: Eq a0 => a0 -> Constant a a0 -> Bool # maximum :: Ord a0 => Constant a a0 -> a0 # minimum :: Ord a0 => Constant a a0 -> a0 # sum :: Num a0 => Constant a a0 -> a0 # product :: Num a0 => Constant a a0 -> a0 #
Foldable f => Foldable (Reverse f) | Fold from right to left.
Instance details Defined in Data.Functor.Reverse Methods fold :: Monoid m => Reverse f m -> m # foldMap :: Monoid m => (a -> m) -> Reverse f a -> m # foldMap' :: Monoid m => (a -> m) -> Reverse f a -> m # foldr :: (a -> b -> b) -> b -> Reverse f a -> b # foldr' :: (a -> b -> b) -> b -> Reverse f a -> b # foldl :: (b -> a -> b) -> b -> Reverse f a -> b # foldl' :: (b -> a -> b) -> b -> Reverse f a -> b # foldr1 :: (a -> a -> a) -> Reverse f a -> a # foldl1 :: (a -> a -> a) -> Reverse f a -> a # toList :: Reverse f a -> [a] # null :: Reverse f a -> Bool # length :: Reverse f a -> Int # elem :: Eq a => a -> Reverse f a -> Bool # maximum :: Ord a => Reverse f a -> a # minimum :: Ord a => Reverse f a -> a # sum :: Num a => Reverse f a -> a # product :: Num a => Reverse f a -> a #
(Foldable f, Foldable g) => Foldable (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods fold :: Monoid m => Product f g m -> m # foldMap :: Monoid m => (a -> m) -> Product f g a -> m # foldMap' :: Monoid m => (a -> m) -> Product f g a -> m # foldr :: (a -> b -> b) -> b -> Product f g a -> b # foldr' :: (a -> b -> b) -> b -> Product f g a -> b # foldl :: (b -> a -> b) -> b -> Product f g a -> b # foldl' :: (b -> a -> b) -> b -> Product f g a -> b # foldr1 :: (a -> a -> a) -> Product f g a -> a # foldl1 :: (a -> a -> a) -> Product f g a -> a # toList :: Product f g a -> [a] # null :: Product f g a -> Bool # length :: Product f g a -> Int # elem :: Eq a => a -> Product f g a -> Bool # maximum :: Ord a => Product f g a -> a # minimum :: Ord a => Product f g a -> a # sum :: Num a => Product f g a -> a # product :: Num a => Product f g a -> a #
(Foldable f, Foldable g) => Foldable (Sum f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods fold :: Monoid m => Sum f g m -> m # foldMap :: Monoid m => (a -> m) -> Sum f g a -> m # foldMap' :: Monoid m => (a -> m) -> Sum f g a -> m # foldr :: (a -> b -> b) -> b -> Sum f g a -> b # foldr' :: (a -> b -> b) -> b -> Sum f g a -> b # foldl :: (b -> a -> b) -> b -> Sum f g a -> b # foldl' :: (b -> a -> b) -> b -> Sum f g a -> b # foldr1 :: (a -> a -> a) -> Sum f g a -> a # foldl1 :: (a -> a -> a) -> Sum f g a -> a # toList :: Sum f g a -> [a] # null :: Sum f g a -> Bool # length :: Sum f g a -> Int # elem :: Eq a => a -> Sum f g a -> Bool # maximum :: Ord a => Sum f g a -> a # minimum :: Ord a => Sum f g a -> a # sum :: Num a => Sum f g a -> a # product :: Num a => Sum f g a -> a #
(Foldable f, Foldable g) => Foldable (f :*: g) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # null :: (f :*: g) a -> Bool # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # sum :: Num a => (f :*: g) a -> a # product :: Num a => (f :*: g) a -> a #
(Foldable f, Foldable g) => Foldable (f :+: g) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # null :: (f :+: g) a -> Bool # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # sum :: Num a => (f :+: g) a -> a # product :: Num a => (f :+: g) a -> a #
Foldable (K1 i c :: Type -> Type) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldMap' :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # toList :: K1 i c a -> [a] # null :: K1 i c a -> Bool # length :: K1 i c a -> Int # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # sum :: Num a => K1 i c a -> a # product :: Num a => K1 i c a -> a #
Foldable (Forget r a :: Type -> Type) |
Instance details Defined in Data.Profunctor.Types Methods fold :: Monoid m => Forget r a m -> m # foldMap :: Monoid m => (a0 -> m) -> Forget r a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Forget r a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Forget r a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Forget r a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Forget r a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Forget r a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 # toList :: Forget r a a0 -> [a0] # null :: Forget r a a0 -> Bool # length :: Forget r a a0 -> Int # elem :: Eq a0 => a0 -> Forget r a a0 -> Bool # maximum :: Ord a0 => Forget r a a0 -> a0 # minimum :: Ord a0 => Forget r a a0 -> a0 # sum :: Num a0 => Forget r a a0 -> a0 # product :: Num a0 => Forget r a a0 -> a0 #
(Foldable f, Foldable g) => Foldable (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fold :: Monoid m => Compose f g m -> m # foldMap :: Monoid m => (a -> m) -> Compose f g a -> m # foldMap' :: Monoid m => (a -> m) -> Compose f g a -> m # foldr :: (a -> b -> b) -> b -> Compose f g a -> b # foldr' :: (a -> b -> b) -> b -> Compose f g a -> b # foldl :: (b -> a -> b) -> b -> Compose f g a -> b # foldl' :: (b -> a -> b) -> b -> Compose f g a -> b # foldr1 :: (a -> a -> a) -> Compose f g a -> a # foldl1 :: (a -> a -> a) -> Compose f g a -> a # toList :: Compose f g a -> [a] # null :: Compose f g a -> Bool # length :: Compose f g a -> Int # elem :: Eq a => a -> Compose f g a -> Bool # maximum :: Ord a => Compose f g a -> a # minimum :: Ord a => Compose f g a -> a # sum :: Num a => Compose f g a -> a # product :: Num a => Compose f g a -> a #
Foldable (Clown f a :: Type -> Type) |
Instance details Defined in Data.Bifunctor.Clown Methods fold :: Monoid m => Clown f a m -> m # foldMap :: Monoid m => (a0 -> m) -> Clown f a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Clown f a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Clown f a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Clown f a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Clown f a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Clown f a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Clown f a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Clown f a a0 -> a0 # toList :: Clown f a a0 -> [a0] # null :: Clown f a a0 -> Bool # length :: Clown f a a0 -> Int # elem :: Eq a0 => a0 -> Clown f a a0 -> Bool # maximum :: Ord a0 => Clown f a a0 -> a0 # minimum :: Ord a0 => Clown f a a0 -> a0 # sum :: Num a0 => Clown f a a0 -> a0 # product :: Num a0 => Clown f a a0 -> a0 #
Bifoldable p => Foldable (Flip p a) |
Instance details Defined in Data.Bifunctor.Flip Methods fold :: Monoid m => Flip p a m -> m # foldMap :: Monoid m => (a0 -> m) -> Flip p a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Flip p a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Flip p a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Flip p a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Flip p a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Flip p a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Flip p a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Flip p a a0 -> a0 # toList :: Flip p a a0 -> [a0] # null :: Flip p a a0 -> Bool # length :: Flip p a a0 -> Int # elem :: Eq a0 => a0 -> Flip p a a0 -> Bool # maximum :: Ord a0 => Flip p a a0 -> a0 # minimum :: Ord a0 => Flip p a a0 -> a0 # sum :: Num a0 => Flip p a a0 -> a0 # product :: Num a0 => Flip p a a0 -> a0 #
Foldable g => Foldable (Joker g a) |
Instance details Defined in Data.Bifunctor.Joker Methods fold :: Monoid m => Joker g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Joker g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Joker g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Joker g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Joker g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Joker g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Joker g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Joker g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Joker g a a0 -> a0 # toList :: Joker g a a0 -> [a0] # null :: Joker g a a0 -> Bool # length :: Joker g a a0 -> Int # elem :: Eq a0 => a0 -> Joker g a a0 -> Bool # maximum :: Ord a0 => Joker g a a0 -> a0 # minimum :: Ord a0 => Joker g a a0 -> a0 # sum :: Num a0 => Joker g a a0 -> a0 # product :: Num a0 => Joker g a a0 -> a0 #
Bifoldable p => Foldable (WrappedBifunctor p a) |
Instance details Defined in Data.Bifunctor.Wrapped Methods fold :: Monoid m => WrappedBifunctor p a m -> m # foldMap :: Monoid m => (a0 -> m) -> WrappedBifunctor p a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> WrappedBifunctor p a a0 -> m # foldr :: (a0 -> b -> b) -> b -> WrappedBifunctor p a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> WrappedBifunctor p a a0 -> b # foldl :: (b -> a0 -> b) -> b -> WrappedBifunctor p a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> WrappedBifunctor p a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> WrappedBifunctor p a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> WrappedBifunctor p a a0 -> a0 # toList :: WrappedBifunctor p a a0 -> [a0] # null :: WrappedBifunctor p a a0 -> Bool # length :: WrappedBifunctor p a a0 -> Int # elem :: Eq a0 => a0 -> WrappedBifunctor p a a0 -> Bool # maximum :: Ord a0 => WrappedBifunctor p a a0 -> a0 # minimum :: Ord a0 => WrappedBifunctor p a a0 -> a0 # sum :: Num a0 => WrappedBifunctor p a a0 -> a0 # product :: Num a0 => WrappedBifunctor p a a0 -> a0 #
(Foldable f, Foldable g) => Foldable (f :.: g) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # null :: (f :.: g) a -> Bool # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # sum :: Num a => (f :.: g) a -> a # product :: Num a => (f :.: g) a -> a #
Foldable f => Foldable (M1 i c f) | @since base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Foldable Methods fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldMap' :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # toList :: M1 i c f a -> [a] # null :: M1 i c f a -> Bool # length :: M1 i c f a -> Int # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # sum :: Num a => M1 i c f a -> a # product :: Num a => M1 i c f a -> a #
(Foldable (f a), Foldable (g a)) => Foldable (Product f g a) |
Instance details Defined in Data.Bifunctor.Product Methods fold :: Monoid m => Product f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Product f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Product f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Product f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Product f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Product f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Product f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Product f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Product f g a a0 -> a0 # toList :: Product f g a a0 -> [a0] # null :: Product f g a a0 -> Bool # length :: Product f g a a0 -> Int # elem :: Eq a0 => a0 -> Product f g a a0 -> Bool # maximum :: Ord a0 => Product f g a a0 -> a0 # minimum :: Ord a0 => Product f g a a0 -> a0 # sum :: Num a0 => Product f g a a0 -> a0 # product :: Num a0 => Product f g a a0 -> a0 #
(Foldable (f a), Foldable (g a)) => Foldable (Sum f g a) |
Instance details Defined in Data.Bifunctor.Sum Methods fold :: Monoid m => Sum f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Sum f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Sum f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Sum f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Sum f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Sum f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Sum f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Sum f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Sum f g a a0 -> a0 # toList :: Sum f g a a0 -> [a0] # null :: Sum f g a a0 -> Bool # length :: Sum f g a a0 -> Int # elem :: Eq a0 => a0 -> Sum f g a a0 -> Bool # maximum :: Ord a0 => Sum f g a a0 -> a0 # minimum :: Ord a0 => Sum f g a a0 -> a0 # sum :: Num a0 => Sum f g a a0 -> a0 # product :: Num a0 => Sum f g a a0 -> a0 #
(Foldable f, Bifoldable p) => Foldable (Tannen f p a) |
Instance details Defined in Data.Bifunctor.Tannen Methods fold :: Monoid m => Tannen f p a m -> m # foldMap :: Monoid m => (a0 -> m) -> Tannen f p a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Tannen f p a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Tannen f p a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Tannen f p a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Tannen f p a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Tannen f p a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Tannen f p a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Tannen f p a a0 -> a0 # toList :: Tannen f p a a0 -> [a0] # null :: Tannen f p a a0 -> Bool # length :: Tannen f p a a0 -> Int # elem :: Eq a0 => a0 -> Tannen f p a a0 -> Bool # maximum :: Ord a0 => Tannen f p a a0 -> a0 # minimum :: Ord a0 => Tannen f p a a0 -> a0 # sum :: Num a0 => Tannen f p a a0 -> a0 # product :: Num a0 => Tannen f p a a0 -> a0 #
(Bifoldable p, Foldable g) => Foldable (Biff p f g a) |
Instance details Defined in Data.Bifunctor.Biff Methods fold :: Monoid m => Biff p f g a m -> m # foldMap :: Monoid m => (a0 -> m) -> Biff p f g a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Biff p f g a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Biff p f g a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Biff p f g a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Biff p f g a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Biff p f g a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Biff p f g a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Biff p f g a a0 -> a0 # toList :: Biff p f g a a0 -> [a0] # null :: Biff p f g a a0 -> Bool # length :: Biff p f g a a0 -> Int # elem :: Eq a0 => a0 -> Biff p f g a a0 -> Bool # maximum :: Ord a0 => Biff p f g a a0 -> a0 # minimum :: Ord a0 => Biff p f g a a0 -> a0 # sum :: Num a0 => Biff p f g a a0 -> a0 # product :: Num a0 => Biff p f g a a0 -> a0 #

class MVector (Mutable v) a => Vector (v :: Type -> Type) a #

Minimal complete definition

basicUnsafeFreeze, basicUnsafeThaw, basicLength, basicUnsafeSlice, basicUnsafeIndexM

#### Instances

Instances details

Vector Vector a |
Instance details Defined in Data.Vector Methods basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a) basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a) basicLength :: Vector a -> Int basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a basicUnsafeIndexM :: Vector a -> Int -> Box a basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s () elemseq :: Vector a -> a -> b -> b
Prim a => Vector Vector a |
Instance details Defined in Data.Vector.Primitive Methods basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a) basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a) basicLength :: Vector a -> Int basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a basicUnsafeIndexM :: Vector a -> Int -> Box a basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s () elemseq :: Vector a -> a -> b -> b
Storable a => Vector Vector a |
Instance details Defined in Data.Vector.Storable Methods basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a) basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a) basicLength :: Vector a -> Int basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a basicUnsafeIndexM :: Vector a -> Int -> Box a basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s () elemseq :: Vector a -> a -> b -> b
Vector Vector a |
Instance details Defined in Data.Vector.Strict Methods basicUnsafeFreeze :: Mutable Vector s a -> ST s (Vector a) basicUnsafeThaw :: Vector a -> ST s (Mutable Vector s a) basicLength :: Vector a -> Int basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a basicUnsafeIndexM :: Vector a -> Int -> Box a basicUnsafeCopy :: Mutable Vector s a -> Vector a -> ST s () elemseq :: Vector a -> a -> b -> b
Vector Vector All |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s All -> ST s (Vector All) basicUnsafeThaw :: Vector All -> ST s (Mutable Vector s All) basicLength :: Vector All -> Int basicUnsafeSlice :: Int -> Int -> Vector All -> Vector All basicUnsafeIndexM :: Vector All -> Int -> Box All basicUnsafeCopy :: Mutable Vector s All -> Vector All -> ST s () elemseq :: Vector All -> All -> b -> b
Vector Vector Any |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Any -> ST s (Vector Any) basicUnsafeThaw :: Vector Any -> ST s (Mutable Vector s Any) basicLength :: Vector Any -> Int basicUnsafeSlice :: Int -> Int -> Vector Any -> Vector Any basicUnsafeIndexM :: Vector Any -> Int -> Box Any basicUnsafeCopy :: Mutable Vector s Any -> Vector Any -> ST s () elemseq :: Vector Any -> Any -> b -> b
Vector Vector Int16 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Int16 -> ST s (Vector Int16) basicUnsafeThaw :: Vector Int16 -> ST s (Mutable Vector s Int16) basicLength :: Vector Int16 -> Int basicUnsafeSlice :: Int -> Int -> Vector Int16 -> Vector Int16 basicUnsafeIndexM :: Vector Int16 -> Int -> Box Int16 basicUnsafeCopy :: Mutable Vector s Int16 -> Vector Int16 -> ST s () elemseq :: Vector Int16 -> Int16 -> b -> b
Vector Vector Int32 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Int32 -> ST s (Vector Int32) basicUnsafeThaw :: Vector Int32 -> ST s (Mutable Vector s Int32) basicLength :: Vector Int32 -> Int basicUnsafeSlice :: Int -> Int -> Vector Int32 -> Vector Int32 basicUnsafeIndexM :: Vector Int32 -> Int -> Box Int32 basicUnsafeCopy :: Mutable Vector s Int32 -> Vector Int32 -> ST s () elemseq :: Vector Int32 -> Int32 -> b -> b
Vector Vector Int64 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Int64 -> ST s (Vector Int64) basicUnsafeThaw :: Vector Int64 -> ST s (Mutable Vector s Int64) basicLength :: Vector Int64 -> Int basicUnsafeSlice :: Int -> Int -> Vector Int64 -> Vector Int64 basicUnsafeIndexM :: Vector Int64 -> Int -> Box Int64 basicUnsafeCopy :: Mutable Vector s Int64 -> Vector Int64 -> ST s () elemseq :: Vector Int64 -> Int64 -> b -> b
Vector Vector Int8 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Int8 -> ST s (Vector Int8) basicUnsafeThaw :: Vector Int8 -> ST s (Mutable Vector s Int8) basicLength :: Vector Int8 -> Int basicUnsafeSlice :: Int -> Int -> Vector Int8 -> Vector Int8 basicUnsafeIndexM :: Vector Int8 -> Int -> Box Int8 basicUnsafeCopy :: Mutable Vector s Int8 -> Vector Int8 -> ST s () elemseq :: Vector Int8 -> Int8 -> b -> b
Vector Vector Word16 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word16 -> ST s (Vector Word16) basicUnsafeThaw :: Vector Word16 -> ST s (Mutable Vector s Word16) basicLength :: Vector Word16 -> Int basicUnsafeSlice :: Int -> Int -> Vector Word16 -> Vector Word16 basicUnsafeIndexM :: Vector Word16 -> Int -> Box Word16 basicUnsafeCopy :: Mutable Vector s Word16 -> Vector Word16 -> ST s () elemseq :: Vector Word16 -> Word16 -> b -> b
Vector Vector Word32 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word32 -> ST s (Vector Word32) basicUnsafeThaw :: Vector Word32 -> ST s (Mutable Vector s Word32) basicLength :: Vector Word32 -> Int basicUnsafeSlice :: Int -> Int -> Vector Word32 -> Vector Word32 basicUnsafeIndexM :: Vector Word32 -> Int -> Box Word32 basicUnsafeCopy :: Mutable Vector s Word32 -> Vector Word32 -> ST s () elemseq :: Vector Word32 -> Word32 -> b -> b
Vector Vector Word64 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word64 -> ST s (Vector Word64) basicUnsafeThaw :: Vector Word64 -> ST s (Mutable Vector s Word64) basicLength :: Vector Word64 -> Int basicUnsafeSlice :: Int -> Int -> Vector Word64 -> Vector Word64 basicUnsafeIndexM :: Vector Word64 -> Int -> Box Word64 basicUnsafeCopy :: Mutable Vector s Word64 -> Vector Word64 -> ST s () elemseq :: Vector Word64 -> Word64 -> b -> b
Vector Vector Word8 |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word8 -> ST s (Vector Word8) basicUnsafeThaw :: Vector Word8 -> ST s (Mutable Vector s Word8) basicLength :: Vector Word8 -> Int basicUnsafeSlice :: Int -> Int -> Vector Word8 -> Vector Word8 basicUnsafeIndexM :: Vector Word8 -> Int -> Box Word8 basicUnsafeCopy :: Mutable Vector s Word8 -> Vector Word8 -> ST s () elemseq :: Vector Word8 -> Word8 -> b -> b
Vector Vector () |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s () -> ST s (Vector ()) basicUnsafeThaw :: Vector () -> ST s (Mutable Vector s ()) basicLength :: Vector () -> Int basicUnsafeSlice :: Int -> Int -> Vector () -> Vector () basicUnsafeIndexM :: Vector () -> Int -> Box () basicUnsafeCopy :: Mutable Vector s () -> Vector () -> ST s () elemseq :: Vector () -> () -> b -> b
Vector Vector Bool |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Bool -> ST s (Vector Bool) basicUnsafeThaw :: Vector Bool -> ST s (Mutable Vector s Bool) basicLength :: Vector Bool -> Int basicUnsafeSlice :: Int -> Int -> Vector Bool -> Vector Bool basicUnsafeIndexM :: Vector Bool -> Int -> Box Bool basicUnsafeCopy :: Mutable Vector s Bool -> Vector Bool -> ST s () elemseq :: Vector Bool -> Bool -> b -> b
Vector Vector Char |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Char -> ST s (Vector Char) basicUnsafeThaw :: Vector Char -> ST s (Mutable Vector s Char) basicLength :: Vector Char -> Int basicUnsafeSlice :: Int -> Int -> Vector Char -> Vector Char basicUnsafeIndexM :: Vector Char -> Int -> Box Char basicUnsafeCopy :: Mutable Vector s Char -> Vector Char -> ST s () elemseq :: Vector Char -> Char -> b -> b
Vector Vector Double |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Double -> ST s (Vector Double) basicUnsafeThaw :: Vector Double -> ST s (Mutable Vector s Double) basicLength :: Vector Double -> Int basicUnsafeSlice :: Int -> Int -> Vector Double -> Vector Double basicUnsafeIndexM :: Vector Double -> Int -> Box Double basicUnsafeCopy :: Mutable Vector s Double -> Vector Double -> ST s () elemseq :: Vector Double -> Double -> b -> b
Vector Vector Float |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Float -> ST s (Vector Float) basicUnsafeThaw :: Vector Float -> ST s (Mutable Vector s Float) basicLength :: Vector Float -> Int basicUnsafeSlice :: Int -> Int -> Vector Float -> Vector Float basicUnsafeIndexM :: Vector Float -> Int -> Box Float basicUnsafeCopy :: Mutable Vector s Float -> Vector Float -> ST s () elemseq :: Vector Float -> Float -> b -> b
Vector Vector Int |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Int -> ST s (Vector Int) basicUnsafeThaw :: Vector Int -> ST s (Mutable Vector s Int) basicLength :: Vector Int -> Int basicUnsafeSlice :: Int -> Int -> Vector Int -> Vector Int basicUnsafeIndexM :: Vector Int -> Int -> Box Int basicUnsafeCopy :: Mutable Vector s Int -> Vector Int -> ST s () elemseq :: Vector Int -> Int -> b -> b
Vector Vector Word |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s Word -> ST s (Vector Word) basicUnsafeThaw :: Vector Word -> ST s (Mutable Vector s Word) basicLength :: Vector Word -> Int basicUnsafeSlice :: Int -> Int -> Vector Word -> Vector Word basicUnsafeIndexM :: Vector Word -> Int -> Box Word basicUnsafeCopy :: Mutable Vector s Word -> Vector Word -> ST s () elemseq :: Vector Word -> Word -> b -> b
Unbox a => Vector Vector (Complex a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Complex a) -> ST s (Vector (Complex a)) basicUnsafeThaw :: Vector (Complex a) -> ST s (Mutable Vector s (Complex a)) basicLength :: Vector (Complex a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Complex a) -> Vector (Complex a) basicUnsafeIndexM :: Vector (Complex a) -> Int -> Box (Complex a) basicUnsafeCopy :: Mutable Vector s (Complex a) -> Vector (Complex a) -> ST s () elemseq :: Vector (Complex a) -> Complex a -> b -> b
Unbox a => Vector Vector (First a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (First a) -> ST s (Vector (First a)) basicUnsafeThaw :: Vector (First a) -> ST s (Mutable Vector s (First a)) basicLength :: Vector (First a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (First a) -> Vector (First a) basicUnsafeIndexM :: Vector (First a) -> Int -> Box (First a) basicUnsafeCopy :: Mutable Vector s (First a) -> Vector (First a) -> ST s () elemseq :: Vector (First a) -> First a -> b -> b
Unbox a => Vector Vector (Last a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Last a) -> ST s (Vector (Last a)) basicUnsafeThaw :: Vector (Last a) -> ST s (Mutable Vector s (Last a)) basicLength :: Vector (Last a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Last a) -> Vector (Last a) basicUnsafeIndexM :: Vector (Last a) -> Int -> Box (Last a) basicUnsafeCopy :: Mutable Vector s (Last a) -> Vector (Last a) -> ST s () elemseq :: Vector (Last a) -> Last a -> b -> b
Unbox a => Vector Vector (Max a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Max a) -> ST s (Vector (Max a)) basicUnsafeThaw :: Vector (Max a) -> ST s (Mutable Vector s (Max a)) basicLength :: Vector (Max a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Max a) -> Vector (Max a) basicUnsafeIndexM :: Vector (Max a) -> Int -> Box (Max a) basicUnsafeCopy :: Mutable Vector s (Max a) -> Vector (Max a) -> ST s () elemseq :: Vector (Max a) -> Max a -> b -> b
Unbox a => Vector Vector (Min a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Min a) -> ST s (Vector (Min a)) basicUnsafeThaw :: Vector (Min a) -> ST s (Mutable Vector s (Min a)) basicLength :: Vector (Min a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Min a) -> Vector (Min a) basicUnsafeIndexM :: Vector (Min a) -> Int -> Box (Min a) basicUnsafeCopy :: Mutable Vector s (Min a) -> Vector (Min a) -> ST s () elemseq :: Vector (Min a) -> Min a -> b -> b
Unbox a => Vector Vector (WrappedMonoid a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (WrappedMonoid a) -> ST s (Vector (WrappedMonoid a)) basicUnsafeThaw :: Vector (WrappedMonoid a) -> ST s (Mutable Vector s (WrappedMonoid a)) basicLength :: Vector (WrappedMonoid a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (WrappedMonoid a) -> Vector (WrappedMonoid a) basicUnsafeIndexM :: Vector (WrappedMonoid a) -> Int -> Box (WrappedMonoid a) basicUnsafeCopy :: Mutable Vector s (WrappedMonoid a) -> Vector (WrappedMonoid a) -> ST s () elemseq :: Vector (WrappedMonoid a) -> WrappedMonoid a -> b -> b
Unbox a => Vector Vector (Identity a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Identity a) -> ST s (Vector (Identity a)) basicUnsafeThaw :: Vector (Identity a) -> ST s (Mutable Vector s (Identity a)) basicLength :: Vector (Identity a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Identity a) -> Vector (Identity a) basicUnsafeIndexM :: Vector (Identity a) -> Int -> Box (Identity a) basicUnsafeCopy :: Mutable Vector s (Identity a) -> Vector (Identity a) -> ST s () elemseq :: Vector (Identity a) -> Identity a -> b -> b
Unbox a => Vector Vector (Down a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Down a) -> ST s (Vector (Down a)) basicUnsafeThaw :: Vector (Down a) -> ST s (Mutable Vector s (Down a)) basicLength :: Vector (Down a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Down a) -> Vector (Down a) basicUnsafeIndexM :: Vector (Down a) -> Int -> Box (Down a) basicUnsafeCopy :: Mutable Vector s (Down a) -> Vector (Down a) -> ST s () elemseq :: Vector (Down a) -> Down a -> b -> b
Unbox a => Vector Vector (Dual a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Dual a) -> ST s (Vector (Dual a)) basicUnsafeThaw :: Vector (Dual a) -> ST s (Mutable Vector s (Dual a)) basicLength :: Vector (Dual a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Dual a) -> Vector (Dual a) basicUnsafeIndexM :: Vector (Dual a) -> Int -> Box (Dual a) basicUnsafeCopy :: Mutable Vector s (Dual a) -> Vector (Dual a) -> ST s () elemseq :: Vector (Dual a) -> Dual a -> b -> b
Unbox a => Vector Vector (Product a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Product a) -> ST s (Vector (Product a)) basicUnsafeThaw :: Vector (Product a) -> ST s (Mutable Vector s (Product a)) basicLength :: Vector (Product a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Product a) -> Vector (Product a) basicUnsafeIndexM :: Vector (Product a) -> Int -> Box (Product a) basicUnsafeCopy :: Mutable Vector s (Product a) -> Vector (Product a) -> ST s () elemseq :: Vector (Product a) -> Product a -> b -> b
Unbox a => Vector Vector (Sum a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Sum a) -> ST s (Vector (Sum a)) basicUnsafeThaw :: Vector (Sum a) -> ST s (Mutable Vector s (Sum a)) basicLength :: Vector (Sum a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Sum a) -> Vector (Sum a) basicUnsafeIndexM :: Vector (Sum a) -> Int -> Box (Sum a) basicUnsafeCopy :: Mutable Vector s (Sum a) -> Vector (Sum a) -> ST s () elemseq :: Vector (Sum a) -> Sum a -> b -> b
Vector Vector (DoNotUnboxLazy a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (DoNotUnboxLazy a) -> ST s (Vector (DoNotUnboxLazy a)) basicUnsafeThaw :: Vector (DoNotUnboxLazy a) -> ST s (Mutable Vector s (DoNotUnboxLazy a)) basicLength :: Vector (DoNotUnboxLazy a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (DoNotUnboxLazy a) -> Vector (DoNotUnboxLazy a) basicUnsafeIndexM :: Vector (DoNotUnboxLazy a) -> Int -> Box (DoNotUnboxLazy a) basicUnsafeCopy :: Mutable Vector s (DoNotUnboxLazy a) -> Vector (DoNotUnboxLazy a) -> ST s () elemseq :: Vector (DoNotUnboxLazy a) -> DoNotUnboxLazy a -> b -> b
NFData a => Vector Vector (DoNotUnboxNormalForm a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (DoNotUnboxNormalForm a) -> ST s (Vector (DoNotUnboxNormalForm a)) basicUnsafeThaw :: Vector (DoNotUnboxNormalForm a) -> ST s (Mutable Vector s (DoNotUnboxNormalForm a)) basicLength :: Vector (DoNotUnboxNormalForm a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (DoNotUnboxNormalForm a) -> Vector (DoNotUnboxNormalForm a) basicUnsafeIndexM :: Vector (DoNotUnboxNormalForm a) -> Int -> Box (DoNotUnboxNormalForm a) basicUnsafeCopy :: Mutable Vector s (DoNotUnboxNormalForm a) -> Vector (DoNotUnboxNormalForm a) -> ST s () elemseq :: Vector (DoNotUnboxNormalForm a) -> DoNotUnboxNormalForm a -> b -> b
Vector Vector (DoNotUnboxStrict a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (DoNotUnboxStrict a) -> ST s (Vector (DoNotUnboxStrict a)) basicUnsafeThaw :: Vector (DoNotUnboxStrict a) -> ST s (Mutable Vector s (DoNotUnboxStrict a)) basicLength :: Vector (DoNotUnboxStrict a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (DoNotUnboxStrict a) -> Vector (DoNotUnboxStrict a) basicUnsafeIndexM :: Vector (DoNotUnboxStrict a) -> Int -> Box (DoNotUnboxStrict a) basicUnsafeCopy :: Mutable Vector s (DoNotUnboxStrict a) -> Vector (DoNotUnboxStrict a) -> ST s () elemseq :: Vector (DoNotUnboxStrict a) -> DoNotUnboxStrict a -> b -> b
Prim a => Vector Vector (UnboxViaPrim a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (UnboxViaPrim a) -> ST s (Vector (UnboxViaPrim a)) basicUnsafeThaw :: Vector (UnboxViaPrim a) -> ST s (Mutable Vector s (UnboxViaPrim a)) basicLength :: Vector (UnboxViaPrim a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (UnboxViaPrim a) -> Vector (UnboxViaPrim a) basicUnsafeIndexM :: Vector (UnboxViaPrim a) -> Int -> Box (UnboxViaPrim a) basicUnsafeCopy :: Mutable Vector s (UnboxViaPrim a) -> Vector (UnboxViaPrim a) -> ST s () elemseq :: Vector (UnboxViaPrim a) -> UnboxViaPrim a -> b -> b
(Unbox a, Unbox b) => Vector Vector (Arg a b) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Arg a b) -> ST s (Vector (Arg a b)) basicUnsafeThaw :: Vector (Arg a b) -> ST s (Mutable Vector s (Arg a b)) basicLength :: Vector (Arg a b) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Arg a b) -> Vector (Arg a b) basicUnsafeIndexM :: Vector (Arg a b) -> Int -> Box (Arg a b) basicUnsafeCopy :: Mutable Vector s (Arg a b) -> Vector (Arg a b) -> ST s () elemseq :: Vector (Arg a b) -> Arg a b -> b0 -> b0
(IsoUnbox a b, Unbox b) => Vector Vector (As a b) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (As a b) -> ST s (Vector (As a b)) basicUnsafeThaw :: Vector (As a b) -> ST s (Mutable Vector s (As a b)) basicLength :: Vector (As a b) -> Int basicUnsafeSlice :: Int -> Int -> Vector (As a b) -> Vector (As a b) basicUnsafeIndexM :: Vector (As a b) -> Int -> Box (As a b) basicUnsafeCopy :: Mutable Vector s (As a b) -> Vector (As a b) -> ST s () elemseq :: Vector (As a b) -> As a b -> b0 -> b0
(Unbox a, Unbox b) => Vector Vector (a, b) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (a, b) -> ST s (Vector (a, b)) basicUnsafeThaw :: Vector (a, b) -> ST s (Mutable Vector s (a, b)) basicLength :: Vector (a, b) -> Int basicUnsafeSlice :: Int -> Int -> Vector (a, b) -> Vector (a, b) basicUnsafeIndexM :: Vector (a, b) -> Int -> Box (a, b) basicUnsafeCopy :: Mutable Vector s (a, b) -> Vector (a, b) -> ST s () elemseq :: Vector (a, b) -> (a, b) -> b0 -> b0
Unbox a => Vector Vector (Const a b) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Const a b) -> ST s (Vector (Const a b)) basicUnsafeThaw :: Vector (Const a b) -> ST s (Mutable Vector s (Const a b)) basicLength :: Vector (Const a b) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Const a b) -> Vector (Const a b) basicUnsafeIndexM :: Vector (Const a b) -> Int -> Box (Const a b) basicUnsafeCopy :: Mutable Vector s (Const a b) -> Vector (Const a b) -> ST s () elemseq :: Vector (Const a b) -> Const a b -> b0 -> b0
Unbox (f a) => Vector Vector (Alt f a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Alt f a) -> ST s (Vector (Alt f a)) basicUnsafeThaw :: Vector (Alt f a) -> ST s (Mutable Vector s (Alt f a)) basicLength :: Vector (Alt f a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Alt f a) -> Vector (Alt f a) basicUnsafeIndexM :: Vector (Alt f a) -> Int -> Box (Alt f a) basicUnsafeCopy :: Mutable Vector s (Alt f a) -> Vector (Alt f a) -> ST s () elemseq :: Vector (Alt f a) -> Alt f a -> b -> b
(Unbox a, Unbox b, Unbox c) => Vector Vector (a, b, c) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (a, b, c) -> ST s (Vector (a, b, c)) basicUnsafeThaw :: Vector (a, b, c) -> ST s (Mutable Vector s (a, b, c)) basicLength :: Vector (a, b, c) -> Int basicUnsafeSlice :: Int -> Int -> Vector (a, b, c) -> Vector (a, b, c) basicUnsafeIndexM :: Vector (a, b, c) -> Int -> Box (a, b, c) basicUnsafeCopy :: Mutable Vector s (a, b, c) -> Vector (a, b, c) -> ST s () elemseq :: Vector (a, b, c) -> (a, b, c) -> b0 -> b0
(Unbox a, Unbox b, Unbox c, Unbox d) => Vector Vector (a, b, c, d) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (a, b, c, d) -> ST s (Vector (a, b, c, d)) basicUnsafeThaw :: Vector (a, b, c, d) -> ST s (Mutable Vector s (a, b, c, d)) basicLength :: Vector (a, b, c, d) -> Int basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d) -> Vector (a, b, c, d) basicUnsafeIndexM :: Vector (a, b, c, d) -> Int -> Box (a, b, c, d) basicUnsafeCopy :: Mutable Vector s (a, b, c, d) -> Vector (a, b, c, d) -> ST s () elemseq :: Vector (a, b, c, d) -> (a, b, c, d) -> b0 -> b0
Unbox (f (g a)) => Vector Vector (Compose f g a) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (Compose f g a) -> ST s (Vector (Compose f g a)) basicUnsafeThaw :: Vector (Compose f g a) -> ST s (Mutable Vector s (Compose f g a)) basicLength :: Vector (Compose f g a) -> Int basicUnsafeSlice :: Int -> Int -> Vector (Compose f g a) -> Vector (Compose f g a) basicUnsafeIndexM :: Vector (Compose f g a) -> Int -> Box (Compose f g a) basicUnsafeCopy :: Mutable Vector s (Compose f g a) -> Vector (Compose f g a) -> ST s () elemseq :: Vector (Compose f g a) -> Compose f g a -> b -> b
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Vector Vector (a, b, c, d, e) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (a, b, c, d, e) -> ST s (Vector (a, b, c, d, e)) basicUnsafeThaw :: Vector (a, b, c, d, e) -> ST s (Mutable Vector s (a, b, c, d, e)) basicLength :: Vector (a, b, c, d, e) -> Int basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e) -> Vector (a, b, c, d, e) basicUnsafeIndexM :: Vector (a, b, c, d, e) -> Int -> Box (a, b, c, d, e) basicUnsafeCopy :: Mutable Vector s (a, b, c, d, e) -> Vector (a, b, c, d, e) -> ST s () elemseq :: Vector (a, b, c, d, e) -> (a, b, c, d, e) -> b0 -> b0
(Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Vector Vector (a, b, c, d, e, f) |
Instance details Defined in Data.Vector.Unboxed.Base Methods basicUnsafeFreeze :: Mutable Vector s (a, b, c, d, e, f) -> ST s (Vector (a, b, c, d, e, f)) basicUnsafeThaw :: Vector (a, b, c, d, e, f) -> ST s (Mutable Vector s (a, b, c, d, e, f)) basicLength :: Vector (a, b, c, d, e, f) -> Int basicUnsafeSlice :: Int -> Int -> Vector (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) basicUnsafeIndexM :: Vector (a, b, c, d, e, f) -> Int -> Box (a, b, c, d, e, f) basicUnsafeCopy :: Mutable Vector s (a, b, c, d, e, f) -> Vector (a, b, c, d, e, f) -> ST s () elemseq :: Vector (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> b0 -> b0

type family Mutable (v :: Type -> Type) = (mv :: Type -> Type -> Type) | mv -> v #

#### Instances

Instances details

type Mutable Array |
Instance details Defined in Data.Vector.Generic.Base type Mutable Array = MutableArray
type Mutable PrimArray |
Instance details Defined in Data.Vector.Generic.Base type Mutable PrimArray = MutablePrimArray
type Mutable SmallArray |
Instance details Defined in Data.Vector.Generic.Base type Mutable SmallArray = SmallMutableArray
type Mutable Vector |
Instance details Defined in Data.Vector type Mutable Vector = MVector
type Mutable Vector |
Instance details Defined in Data.Vector.Primitive type Mutable Vector = MVector
type Mutable Vector |
Instance details Defined in Data.Vector.Storable type Mutable Vector = MVector
type Mutable Vector |
Instance details Defined in Data.Vector.Strict type Mutable Vector = MVector
type Mutable Vector |
Instance details Defined in Data.Vector.Unboxed.Base type Mutable Vector = MVector