pipes-4.3.10: Compositional pipelines

Safe Haskell | Trustworthy
Language | Haskell2010

Pipes

Contents

- The Proxy Monad Transformer
  - Producers
  - Consumers
  - Pipes
- ListT
- Utilities
- Re-exports

Description

This module is the recommended entry point to the `pipes` library.

Read Pipes.Tutorial if you want a tutorial explaining how to use this library.

Synopsis

- data Proxy a' a b' b m r
- type X = Void
- type Effect = Proxy X () () X
- type Effect' m r = forall x' x y' y. Proxy x' x y' y m r
- runEffect :: Monad m => Effect m r -> m r
- type Producer b = Proxy X () () b
- type Producer' b m r = forall x' x. Proxy x' x () b m r
- yield :: Functor m => a -> Producer' a m ()
- for :: Functor m => Proxy x' x b' b m a' -> (b -> Proxy x' x c' c m b') -> Proxy x' x c' c m a'
- (~>) :: Functor m => (a -> Proxy x' x b' b m a') -> (b -> Proxy x' x c' c m b') -> a -> Proxy x' x c' c m a'
- (<~) :: Functor m => (b -> Proxy x' x c' c m b') -> (a -> Proxy x' x b' b m a') -> a -> Proxy x' x c' c m a'
- type Consumer a = Proxy () a () X
- type Consumer' a m r = forall y' y. Proxy () a y' y m r
- await :: Functor m => Consumer' a m a
- (>~) :: Functor m => Proxy a' a y' y m b -> Proxy () b y' y m c -> Proxy a' a y' y m c
- (~<) :: Functor m => Proxy () b y' y m c -> Proxy a' a y' y m b -> Proxy a' a y' y m c
- type Pipe a b = Proxy () a () b
- cat :: Functor m => Pipe a a m r
- (>->) :: Functor m => Proxy a' a () b m r -> Proxy () b c' c m r -> Proxy a' a c' c m r
- (<-<) :: Functor m => Proxy () b c' c m r -> Proxy a' a () b m r -> Proxy a' a c' c m r
- newtype ListT m a = Select {
  - enumerate :: Producer a m ()
  }
- runListT :: Monad m => ListT m a -> m ()
- class Enumerable t where
  - toListT :: Monad m => t m a -> ListT m a
- next :: Monad m => Producer a m r -> m (Either r (a, Producer a m r))
- each :: (Functor m, Foldable f) => f a -> Producer' a m ()
- every :: (Monad m, Enumerable t) => t m a -> Producer' a m ()
- discard :: Monad m => a -> m ()
- void :: Functor f => f a -> f ()
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
  - mzero :: m a
  - mplus :: m a -> m a -> m a
- class Monad m => MonadIO (m :: Type -> Type) where
  - liftIO :: IO a -> m a
- class MonadTrans (t :: (Type -> Type) -> Type -> Type) where
  - lift :: Monad m => m a -> t m a
- class MFunctor (t :: (Type -> Type) -> k -> Type) where
  - hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b
- class (MFunctor t, MonadTrans t) => MMonad (t :: (Type -> Type) -> Type -> Type) where
  - embed :: Monad n => (forall a. m a -> t n a) -> t m b -> t n b
- class Foldable (t :: Type -> Type)

# The Proxy Monad Transformer

data Proxy a' a b' b m r Source #

A `Proxy` is a monad transformer that receives and sends information on both an upstream and downstream interface.

The type variables signify:

- `a'` and `a` - The upstream interface, where `(a')`s go out and `(a)`s come in
- `b'` and `b` - The downstream interface, where `(b)`s go out and `(b')`s come in
- `m` - The base monad
- `r` - The return value

Instances

MonadWriter w m => MonadWriter w (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods writer :: (a0, w) -> Proxy a' a b' b m a0 Source # tell :: w -> Proxy a' a b' b m () Source # listen :: Proxy a' a b' b m a0 -> Proxy a' a b' b m (a0, w) Source # pass :: Proxy a' a b' b m (a0, w -> w) -> Proxy a' a b' b m a0 Source #
MonadState s m => MonadState s (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods get :: Proxy a' a b' b m s Source # put :: s -> Proxy a' a b' b m () Source # state :: (s -> (a0, s)) -> Proxy a' a b' b m a0 Source #
MonadReader r m => MonadReader r (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods ask :: Proxy a' a b' b m r Source # local :: (r -> r) -> Proxy a' a b' b m a0 -> Proxy a' a b' b m a0 Source # reader :: (r -> a0) -> Proxy a' a b' b m a0 Source #
MonadError e m => MonadError e (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods throwError :: e -> Proxy a' a b' b m a0 Source # catchError :: Proxy a' a b' b m a0 -> (e -> Proxy a' a b' b m a0) -> Proxy a' a b' b m a0 Source #
MFunctor (Proxy a' a b' b :: (Type -> Type) -> Type -> Type) Source # |
Instance details Defined in Pipes.Internal Methods hoist :: Monad m => (forall a0. m a0 -> n a0) -> Proxy a' a b' b m b0 -> Proxy a' a b' b n b0 Source #
MMonad (Proxy a' a b' b) Source # |
Instance details Defined in Pipes.Internal Methods embed :: Monad n => (forall a0. m a0 -> Proxy a' a b' b n a0) -> Proxy a' a b' b m b0 -> Proxy a' a b' b n b0 Source #
MonadTrans (Proxy a' a b' b) Source # |
Instance details Defined in Pipes.Internal Methods lift :: Monad m => m a0 -> Proxy a' a b' b m a0 Source #
Functor m => Monad (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods (>>=) :: Proxy a' a b' b m a0 -> (a0 -> Proxy a' a b' b m b0) -> Proxy a' a b' b m b0 Source # (>>) :: Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 -> Proxy a' a b' b m b0 Source # return :: a0 -> Proxy a' a b' b m a0 Source # fail :: String -> Proxy a' a b' b m a0 Source #
Functor m => Functor (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods fmap :: (a0 -> b0) -> Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 Source # (<$) :: a0 -> Proxy a' a b' b m b0 -> Proxy a' a b' b m a0 Source #
Functor m => Applicative (Proxy a' a b' b m) Source # |

Instance details

Defined in Pipes.Internal

Methods

pure :: a0 -> Proxy a' a b' b m a0 Source #

(<*>) :: Proxy a' a b' b m (a0 -> b0) -> Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 Source #

liftA2 :: (a0 -> b0 -> c) -> Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 -> Proxy a' a b' b m c Source #

(*>) :: Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 -> Proxy a' a b' b m b0 Source #

(<*) :: Proxy a' a b' b m a0 -> Proxy a' a b' b m b0 -> Proxy a' a b' b m a0 Source #

MonadIO m => MonadIO (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods liftIO :: IO a0 -> Proxy a' a b' b m a0 Source #
MonadThrow m => MonadThrow (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods throwM :: Exception e => e -> Proxy a' a b' b m a0 Source #
MonadCatch m => MonadCatch (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods catch :: Exception e => Proxy a' a b' b m a0 -> (e -> Proxy a' a b' b m a0) -> Proxy a' a b' b m a0 Source #
(Functor m, Semigroup r) => Semigroup (Proxy a' a b' b m r) Source # |
Instance details Defined in Pipes.Internal Methods (<>) :: Proxy a' a b' b m r -> Proxy a' a b' b m r -> Proxy a' a b' b m r Source # sconcat :: NonEmpty (Proxy a' a b' b m r) -> Proxy a' a b' b m r Source # stimes :: Integral b0 => b0 -> Proxy a' a b' b m r -> Proxy a' a b' b m r Source #
(Functor m, Monoid r, Semigroup r) => Monoid (Proxy a' a b' b m r) Source # |
Instance details Defined in Pipes.Internal Methods mempty :: Proxy a' a b' b m r Source # mappend :: Proxy a' a b' b m r -> Proxy a' a b' b m r -> Proxy a' a b' b m r Source # mconcat :: [Proxy a' a b' b m r] -> Proxy a' a b' b m r Source #

type X = Void Source #

The empty type, used to close output ends

type Effect = Proxy X () () X Source #

An effect in the base monad

`Effect`s neither `await` nor `yield`

type Effect' m r = forall x' x y' y. Proxy x' x y' y m r Source #

Like `Effect`, but with a polymorphic type

runEffect :: Monad m => Effect m r -> m r Source #

Run a self-contained `Effect`, converting it back to the base monad

## Producers

Use `yield` to produce output and (`~>`) / `for` to substitute `yield`s.

`yield` and (`~>`) obey the `Category` laws:

    -- Substituting 'yield' with 'f' gives 'f'
    yield ~> f = f

    -- Substituting every 'yield' with another 'yield' does nothing
    f ~> yield = f

    -- 'yield' substitution is associative
    (f ~> g) ~> h = f ~> (g ~> h)

These are equivalent to the following "for loop laws":

    -- Looping over a single yield simplifies to function application
    for (yield x) f = f x

    -- Re-yielding every element of a stream returns the original stream
    for s yield = s

    -- Nested for loops can become a sequential for loops if the inner loop
    -- body ignores the outer loop variable
    for s (\a -> for (f a) g) = for (for s f) g = for s (f ~> g)

type Producer b = Proxy X () () b Source #

`Producer`s can only `yield`

type Producer' b m r = forall x' x. Proxy x' x () b m r Source #

Like `Producer`, but with a polymorphic type

yield :: Functor m => a -> Producer' a m () Source #

Produce a value

    yield :: Monad m => a -> Pipe x a m ()

for Source #

Arguments

:: Functor m |
=> Proxy x' x b' b m a' |
-> (b -> Proxy x' x c' c m b') |
-> Proxy x' x c' c m a' |

`(for p body)` loops over `p` replacing each `yield` with `body`.

    for :: Functor m => Producer b m r -> (b -> Effect       m ()) -> Effect       m r
    for :: Functor m => Producer b m r -> (b -> Producer   c m ()) -> Producer   c m r
    for :: Functor m => Pipe   x b m r -> (b -> Consumer x   m ()) -> Consumer x   m r
    for :: Functor m => Pipe   x b m r -> (b -> Pipe     x c m ()) -> Pipe     x c m r

The following diagrams show the flow of information:

                                  .--->   b
                                 /        |
       +-----------+            /   +-----|-----+                 +---------------+
       |           |           /    |     v     |                 |               |
       |           |          /     |           |                 |               |
    x ==>    p    ==> b   ---'   x ==>   body  ==> c     =     x ==> for p body  ==> c
       |           |                |           |                 |               |
       |     |     |                |     |     |                 |       |       |
       +-----|-----+                +-----|-----+                 +-------|-------+
             v                            v                               v
             r                            ()                              r

For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".

(~>) infixr 4 Source #

Arguments

:: Functor m |
=> (a -> Proxy x' x b' b m a') |
-> (b -> Proxy x' x c' c m b') |
-> a -> Proxy x' x c' c m a' |

Compose loop bodies

    (~>) :: Functor m => (a -> Producer b m r) -> (b -> Effect       m ()) -> (a -> Effect       m r)
    (~>) :: Functor m => (a -> Producer b m r) -> (b -> Producer   c m ()) -> (a -> Producer   c m r)
    (~>) :: Functor m => (a -> Pipe   x b m r) -> (b -> Consumer x   m ()) -> (a -> Consumer x   m r)
    (~>) :: Functor m => (a -> Pipe   x b m r) -> (b -> Pipe     x c m ()) -> (a -> Pipe     x c m r)

The following diagrams show the flow of information:

             a                    .--->   b                              a
             |                   /        |                              |
       +-----|-----+            /   +-----|-----+                 +------|------+
       |     v     |           /    |     v     |                 |      v      |
       |           |          /     |           |                 |             |
    x ==>    f    ==> b   ---'   x ==>    g    ==> c     =     x ==>   f ~> g  ==> c
       |           |                |           |                 |             |
       |     |     |                |     |     |                 |      |      |
       +-----|-----+                +-----|-----+                 +------|------+
             v                            v                              v
             r                            ()                             r

For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".

(<~) infixl 4 Source #

Arguments

:: Functor m |
=> (b -> Proxy x' x c' c m b') |
-> (a -> Proxy x' x b' b m a') |
-> a -> Proxy x' x c' c m a' |

(`~>`) with the arguments flipped

## Consumers

Use `await` to request input and (`>~`) to substitute `await`s.

`await` and (`>~`) obey the `Category` laws:

    -- Substituting every 'await' with another 'await' does nothing
    await >~ f = f

    -- Substituting 'await' with 'f' gives 'f'
    f >~ await = f

    -- 'await' substitution is associative
    (f >~ g) >~ h = f >~ (g >~ h)

type Consumer a = Proxy () a () X Source #

`Consumer`s can only `await`

type Consumer' a m r = forall y' y. Proxy () a y' y m r Source #

Like `Consumer`, but with a polymorphic type

await :: Functor m => Consumer' a m a Source #

Consume a value

    await :: Functor m => Pipe a y m a

(>~) infixr 5 Source #

Arguments

:: Functor m |
=> Proxy a' a y' y m b |
-> Proxy () b y' y m c |
-> Proxy a' a y' y m c |

`(draw >~ p)` loops over `p` replacing each `await` with `draw`

    (>~) :: Functor m => Effect       m b -> Consumer b   m c -> Effect       m c
    (>~) :: Functor m => Consumer a   m b -> Consumer b   m c -> Consumer a   m c
    (>~) :: Functor m => Producer   y m b -> Pipe     b y m c -> Producer   y m c
    (>~) :: Functor m => Pipe     a y m b -> Pipe     b y m c -> Pipe     a y m c

The following diagrams show the flow of information:

       +-----------+                 +-----------+                 +-------------+
       |           |                 |           |                 |             |
       |           |                 |           |                 |             |
    a ==>    f    ==> y   .--->   b ==>    g    ==> y     =     a ==>   f >~ g  ==> y
       |           |     /           |           |                 |             |
       |     |     |    /            |     |     |                 |      |      |
       +-----|-----+   /             +-----|-----+                 +------|------+
             v        /                    v                              v
             b   ----'                     c                              c

For a more complete diagram including bidirectional flow, see "Pipes.Core#request-diagram".

(~<) infixl 5 Source #

Arguments

:: Functor m |
=> Proxy () b y' y m c |
-> Proxy a' a y' y m b |
-> Proxy a' a y' y m c |

(`>~`) with the arguments flipped

## Pipes

Use `await` and `yield` to build `Pipe`s and (`>->`) to connect `Pipe`s.

`cat` and (`>->`) obey the `Category` laws:

    -- Useless use of cat
    cat >-> f = f

    -- Redirecting output to cat does nothing
    f >-> cat = f

    -- The pipe operator is associative
    (f >-> g) >-> h = f >-> (g >-> h)

type Pipe a b = Proxy () a () b Source #

`Pipe`s can both `await` and `yield`

cat :: Functor m => Pipe a a m r Source #

The identity `Pipe`, analogous to the Unix `cat` program

(>->) infixl 7 Source #

Arguments

:: Functor m |
=> Proxy a' a () b m r |
-> Proxy () b c' c m r |
-> Proxy a' a c' c m r |

`Pipe` composition, analogous to the Unix pipe operator

    (>->) :: Functor m => Producer b m r -> Consumer b   m r -> Effect       m r
    (>->) :: Functor m => Producer b m r -> Pipe     b c m r -> Producer   c m r
    (>->) :: Functor m => Pipe   a b m r -> Consumer b   m r -> Consumer a   m r
    (>->) :: Functor m => Pipe   a b m r -> Pipe     b c m r -> Pipe     a c m r

The following diagrams show the flow of information:

       +-----------+     +-----------+                 +-------------+
       |           |     |           |                 |             |
       |           |     |           |                 |             |
    a ==>    f    ==> b ==>    g    ==> c     =     a ==>  f >-> g  ==> c
       |           |     |           |                 |             |
       |     |     |     |     |     |                 |      |      |
       +-----|-----+     +-----|-----+                 +------|------+
             v                 v                              v
             r                 r                              r

For a more complete diagram including bidirectional flow, see "Pipes.Core#pull-diagram".

(<-<) infixr 7 Source #

Arguments

:: Functor m |
=> Proxy () b c' c m r |
-> Proxy a' a () b m r |
-> Proxy a' a c' c m r |

(`>->`) with the arguments flipped

# ListT

newtype ListT m a Source #

The list monad transformer, which extends a monad with non-determinism

`return` corresponds to `yield`, yielding a single value

(`>>=`) corresponds to `for`, calling the second computation once for each time the first computation `yield`s.

Constructors

Select |

Fields

- enumerate :: Producer a m ()

Instances

MMonad ListT Source # |
Instance details Defined in Pipes Methods embed :: Monad n => (forall a. m a -> ListT n a) -> ListT m b -> ListT n b Source #
MonadTrans ListT Source # |
Instance details Defined in Pipes Methods lift :: Monad m => m a -> ListT m a Source #
Enumerable ListT Source # |
Instance details Defined in Pipes Methods toListT :: Monad m => ListT m a -> ListT m a Source #
MonadWriter w m => MonadWriter w (ListT m) Source # |
Instance details Defined in Pipes Methods writer :: (a, w) -> ListT m a Source # tell :: w -> ListT m () Source # listen :: ListT m a -> ListT m (a, w) Source # pass :: ListT m (a, w -> w) -> ListT m a Source #
MonadState s m => MonadState s (ListT m) Source # |
Instance details Defined in Pipes Methods get :: ListT m s Source # put :: s -> ListT m () Source # state :: (s -> (a, s)) -> ListT m a Source #
MonadReader i m => MonadReader i (ListT m) Source # |
Instance details Defined in Pipes Methods ask :: ListT m i Source # local :: (i -> i) -> ListT m a -> ListT m a Source # reader :: (i -> a) -> ListT m a Source #
MonadError e m => MonadError e (ListT m) Source # |
Instance details Defined in Pipes Methods throwError :: e -> ListT m a Source # catchError :: ListT m a -> (e -> ListT m a) -> ListT m a Source #
Monad m => Monad (ListT m) Source # |
Instance details Defined in Pipes Methods (>>=) :: ListT m a -> (a -> ListT m b) -> ListT m b Source # (>>) :: ListT m a -> ListT m b -> ListT m b Source # return :: a -> ListT m a Source # fail :: String -> ListT m a Source #
Functor m => Functor (ListT m) Source # |
Instance details Defined in Pipes Methods fmap :: (a -> b) -> ListT m a -> ListT m b Source # (<$) :: a -> ListT m b -> ListT m a Source #
Monad m => MonadFail (ListT m) Source # |
Instance details Defined in Pipes Methods fail :: String -> ListT m a Source #
Functor m => Applicative (ListT m) Source # |
Instance details Defined in Pipes Methods pure :: a -> ListT m a Source # (<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b Source # liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c Source # (*>) :: ListT m a -> ListT m b -> ListT m b Source # (<*) :: ListT m a -> ListT m b -> ListT m a Source #
Foldable m => Foldable (ListT m) Source # |

Instance details

Defined in Pipes

Methods

fold :: Monoid m0 => ListT m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> ListT m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> ListT m a -> b Source #

foldr' :: (a -> b -> b) -> b -> ListT m a -> b Source #

foldl :: (b -> a -> b) -> b -> ListT m a -> b Source #

foldl' :: (b -> a -> b) -> b -> ListT m a -> b Source #

foldr1 :: (a -> a -> a) -> ListT m a -> a Source #

foldl1 :: (a -> a -> a) -> ListT m a -> a Source #

toList :: ListT m a -> [a] Source #

null :: ListT m a -> Bool Source #

length :: ListT m a -> Int Source #

elem :: Eq a => a -> ListT m a -> Bool Source #

maximum :: Ord a => ListT m a -> a Source #

minimum :: Ord a => ListT m a -> a Source #

sum :: Num a => ListT m a -> a Source #

product :: Num a => ListT m a -> a Source #

(Functor m, Traversable m) => Traversable (ListT m) Source # |
Instance details Defined in Pipes Methods traverse :: Applicative f => (a -> f b) -> ListT m a -> f (ListT m b) Source # sequenceA :: Applicative f => ListT m (f a) -> f (ListT m a) Source # mapM :: Monad m0 => (a -> m0 b) -> ListT m a -> m0 (ListT m b) Source # sequence :: Monad m0 => ListT m (m0 a) -> m0 (ListT m a) Source #
Monad m => MonadZip (ListT m) Source # |
Instance details Defined in Pipes Methods mzip :: ListT m a -> ListT m b -> ListT m (a, b) Source # mzipWith :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c Source # munzip :: ListT m (a, b) -> (ListT m a, ListT m b) Source #
MonadIO m => MonadIO (ListT m) Source # |
Instance details Defined in Pipes Methods liftIO :: IO a -> ListT m a Source #
Functor m => Alternative (ListT m) Source # |
Instance details Defined in Pipes Methods empty :: ListT m a Source # (<|>) :: ListT m a -> ListT m a -> ListT m a Source # some :: ListT m a -> ListT m [a] Source # many :: ListT m a -> ListT m [a] Source #
Monad m => MonadPlus (ListT m) Source # |
Instance details Defined in Pipes Methods mzero :: ListT m a Source # mplus :: ListT m a -> ListT m a -> ListT m a Source #
MonadThrow m => MonadThrow (ListT m) Source # |
Instance details Defined in Pipes Methods throwM :: Exception e => e -> ListT m a Source #
MonadCatch m => MonadCatch (ListT m) Source # |
Instance details Defined in Pipes Methods catch :: Exception e => ListT m a -> (e -> ListT m a) -> ListT m a Source #
MFunctor ListT Source # |
Instance details Defined in Pipes Methods hoist :: Monad m => (forall a. m a -> n a) -> ListT m b -> ListT n b Source #
Functor m => Semigroup (ListT m a) Source # |
Instance details Defined in Pipes Methods (<>) :: ListT m a -> ListT m a -> ListT m a Source # sconcat :: NonEmpty (ListT m a) -> ListT m a Source # stimes :: Integral b => b -> ListT m a -> ListT m a Source #
Functor m => Monoid (ListT m a) Source # |
Instance details Defined in Pipes Methods mempty :: ListT m a Source # mappend :: ListT m a -> ListT m a -> ListT m a Source # mconcat :: [ListT m a] -> ListT m a Source #

runListT :: Monad m => ListT m a -> m () Source #

Run a self-contained `ListT` computation

class Enumerable t where Source #

`Enumerable` generalizes `Foldable`, converting effectful containers to `ListT`s.

Instances of `Enumerable` must satisfy these two laws:

    toListT (return r) = return r

    toListT $ do x <- m  =  do x <- toListT m
                 f x           toListT (f x)

In other words, `toListT` is monad morphism.

Methods

toListT :: Monad m => t m a -> ListT m a Source #

Instances

Enumerable MaybeT Source # |
Instance details Defined in Pipes Methods toListT :: Monad m => MaybeT m a -> ListT m a Source #
Enumerable ListT Source # |
Instance details Defined in Pipes Methods toListT :: Monad m => ListT m a -> ListT m a Source #
Enumerable (ExceptT e) Source # |
Instance details Defined in Pipes Methods toListT :: Monad m => ExceptT e m a -> ListT m a Source #
Enumerable (IdentityT :: (Type -> Type) -> Type -> Type) Source # |
Instance details Defined in Pipes Methods toListT :: Monad m => IdentityT m a -> ListT m a Source #

# Utilities

next :: Monad m => Producer a m r -> m (Either r (a, Producer a m r)) Source #

Consume the first value from a `Producer`

`next` either fails with a `Left` if the `Producer` terminates or succeeds with a `Right` providing the next value and the remainder of the `Producer`.

each :: (Functor m, Foldable f) => f a -> Producer' a m () Source #

Convert a `Foldable` to a `Producer`

every :: (Monad m, Enumerable t) => t m a -> Producer' a m () Source #

Convert an `Enumerable` to a `Producer`

discard :: Monad m => a -> m () Source #

Discards a value

# Re-exports

Control.Monad re-exports `void`

Control.Monad.IO.Class re-exports `MonadIO`.

Control.Monad.Trans.Class re-exports `MonadTrans`.

Control.Monad.Morph re-exports `MFunctor`.

Data.Foldable re-exports `Foldable` (the class name only).

void :: Functor f => f a -> f () Source #

``void` value` discards or ignores the result of evaluation, such as the return value of an `IO` action.

#### Examples

Expand

Replace the contents of a ``Maybe` `Int`` with unit:

    >>> void Nothing
    Nothing
    >>> void (Just 3)
    Just ()

Replace the contents of an ``Either` `Int` `Int`` with unit, resulting in an ``Either` `Int` '()'`:

    >>> void (Left 8675309)
    Left 8675309
    >>> void (Right 8675309)
    Right ()

Replace every element of a list with unit:

    >>> void [1,2,3]
    [(),(),()]

Replace the second element of a pair with unit:

    >>> void (1,2)
    (1,())

Discard the result of an `IO` action:

    >>> mapM print [1,2]
    1
    2
    [(),()]
    >>> void $ mapM print [1,2]
    1
    2

class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where Source #

Monads that also support choice and failure.

Minimal complete definition

Nothing

Methods

mzero :: m a Source #

The identity of `mplus`. It should also satisfy the equations

    mzero >>= f  =  mzero
    v >> mzero   =  mzero

The default definition is

    mzero = empty

mplus :: m a -> m a -> m a Source #

An associative operation. The default definition is

    mplus = (<|>)

Instances

MonadPlus [] | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: [a] Source # mplus :: [a] -> [a] -> [a] Source #
MonadPlus Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a Source # mplus :: Maybe a -> Maybe a -> Maybe a Source #
MonadPlus IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a Source # mplus :: IO a -> IO a -> IO a Source #
MonadPlus Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mzero :: Option a Source # mplus :: Option a -> Option a -> Option a Source #
MonadPlus STM | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods mzero :: STM a Source # mplus :: STM a -> STM a -> STM a Source #
MonadPlus ReadP | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: ReadP a Source # mplus :: ReadP a -> ReadP a -> ReadP a Source #
MonadPlus P | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods mzero :: P a Source # mplus :: P a -> P a -> P a Source #
MonadPlus (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: U1 a Source # mplus :: U1 a -> U1 a -> U1 a Source #
(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods mzero :: ArrowMonad a a0 Source # mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 Source #
MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods mzero :: Proxy a Source # mplus :: Proxy a -> Proxy a -> Proxy a Source #
Monad m => MonadPlus (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods mzero :: MaybeT m a Source # mplus :: MaybeT m a -> MaybeT m a -> MaybeT m a Source #
Monad m => MonadPlus (ListT m) |
Instance details Defined in Control.Monad.Trans.List Methods mzero :: ListT m a Source # mplus :: ListT m a -> ListT m a -> ListT m a Source #
Monad m => MonadPlus (ListT m) Source # |
Instance details Defined in Pipes Methods mzero :: ListT m a Source # mplus :: ListT m a -> ListT m a -> ListT m a Source #
MonadPlus f => MonadPlus (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: Rec1 f a Source # mplus :: Rec1 f a -> Rec1 f a -> Rec1 f a Source #
MonadPlus f => MonadPlus (Ap f) | Since: base-4.12.0.0
Instance details Defined in Data.Monoid Methods mzero :: Ap f a Source # mplus :: Ap f a -> Ap f a -> Ap f a Source #
MonadPlus f => MonadPlus (Alt f) | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods mzero :: Alt f a Source # mplus :: Alt f a -> Alt f a -> Alt f a Source #
(Monad m, Monoid e) => MonadPlus (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods mzero :: ExceptT e m a Source # mplus :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source #
MonadPlus m => MonadPlus (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods mzero :: IdentityT m a Source # mplus :: IdentityT m a -> IdentityT m a -> IdentityT m a Source #
(Monad m, Error e) => MonadPlus (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods mzero :: ErrorT e m a Source # mplus :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a Source #
MonadPlus m => MonadPlus (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods mzero :: ReaderT r m a Source # mplus :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a Source #
MonadPlus m => MonadPlus (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods mzero :: StateT s m a Source # mplus :: StateT s m a -> StateT s m a -> StateT s m a Source #
MonadPlus m => MonadPlus (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods mzero :: StateT s m a Source # mplus :: StateT s m a -> StateT s m a -> StateT s m a Source #
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods mzero :: WriterT w m a Source # mplus :: WriterT w m a -> WriterT w m a -> WriterT w m a Source #
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods mzero :: WriterT w m a Source # mplus :: WriterT w m a -> WriterT w m a -> WriterT w m a Source #
(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: (f :*: g) a Source # mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source #
(MonadPlus f, MonadPlus g) => MonadPlus (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods mzero :: Product f g a Source # mplus :: Product f g a -> Product f g a -> Product f g a Source #
MonadPlus f => MonadPlus (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods mzero :: M1 i c f a Source # mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a Source #
(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods mzero :: RWST r w s m a Source # mplus :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source #
(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods mzero :: RWST r w s m a Source # mplus :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source #

class Monad m => MonadIO (m :: Type -> Type) where Source #

Monads in which `IO` computations may be embedded. Any monad built by applying a sequence of monad transformers to the `IO` monad will be an instance of this class.

Instances should satisfy the following laws, which state that `liftIO` is a transformer of monads:

-     liftIO . return = return

-     liftIO (m >>= f) = liftIO m >>= (liftIO . f)

Methods

liftIO :: IO a -> m a Source #

Lift a computation from the `IO` monad.

Instances

MonadIO IO | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a Source #
MonadIO Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods liftIO :: IO a -> Q a Source #
MonadIO m => MonadIO (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods liftIO :: IO a -> MaybeT m a Source #
MonadIO m => MonadIO (ListT m) |
Instance details Defined in Control.Monad.Trans.List Methods liftIO :: IO a -> ListT m a Source #
MonadIO m => MonadIO (ListT m) Source # |
Instance details Defined in Pipes Methods liftIO :: IO a -> ListT m a Source #
MonadIO m => MonadIO (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods liftIO :: IO a -> ExceptT e m a Source #
MonadIO m => MonadIO (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods liftIO :: IO a -> IdentityT m a Source #
(Error e, MonadIO m) => MonadIO (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods liftIO :: IO a -> ErrorT e m a Source #
MonadIO m => MonadIO (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods liftIO :: IO a -> ReaderT r m a Source #
MonadIO m => MonadIO (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods liftIO :: IO a -> StateT s m a Source #
MonadIO m => MonadIO (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods liftIO :: IO a -> StateT s m a Source #
(Monoid w, MonadIO m) => MonadIO (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods liftIO :: IO a -> WriterT w m a Source #
(Monoid w, MonadIO m) => MonadIO (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods liftIO :: IO a -> WriterT w m a Source #
MonadIO m => MonadIO (ContT r m) |
Instance details Defined in Control.Monad.Trans.Cont Methods liftIO :: IO a -> ContT r m a Source #
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods liftIO :: IO a -> RWST r w s m a Source #
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods liftIO :: IO a -> RWST r w s m a Source #
MonadIO m => MonadIO (Proxy a' a b' b m) Source # |
Instance details Defined in Pipes.Internal Methods liftIO :: IO a0 -> Proxy a' a b' b m a0 Source #

class MonadTrans (t :: (Type -> Type) -> Type -> Type) where Source #

The class of monad transformers. Instances should satisfy the following laws, which state that `lift` is a monad transformation:

-     lift . return = return

-     lift (m >>= f) = lift m >>= (lift . f)

Methods

lift :: Monad m => m a -> t m a Source #

Lift a computation from the argument monad to the constructed monad.

Instances

MonadTrans MaybeT |
Instance details Defined in Control.Monad.Trans.Maybe Methods lift :: Monad m => m a -> MaybeT m a Source #
MonadTrans ListT |
Instance details Defined in Control.Monad.Trans.List Methods lift :: Monad m => m a -> ListT m a Source #
MonadTrans ListT Source # |
Instance details Defined in Pipes Methods lift :: Monad m => m a -> ListT m a Source #
MonadTrans (ExceptT e) |
Instance details Defined in Control.Monad.Trans.Except Methods lift :: Monad m => m a -> ExceptT e m a Source #
MonadTrans (IdentityT :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Trans.Identity Methods lift :: Monad m => m a -> IdentityT m a Source #
MonadTrans (ErrorT e) |
Instance details Defined in Control.Monad.Trans.Error Methods lift :: Monad m => m a -> ErrorT e m a Source #
MonadTrans (ReaderT r) |
Instance details Defined in Control.Monad.Trans.Reader Methods lift :: Monad m => m a -> ReaderT r m a Source #
MonadTrans (StateT s) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods lift :: Monad m => m a -> StateT s m a Source #
MonadTrans (StateT s) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods lift :: Monad m => m a -> StateT s m a Source #
Monoid w => MonadTrans (WriterT w) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods lift :: Monad m => m a -> WriterT w m a Source #
Monoid w => MonadTrans (WriterT w) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods lift :: Monad m => m a -> WriterT w m a Source #
MonadTrans (ContT r) |
Instance details Defined in Control.Monad.Trans.Cont Methods lift :: Monad m => m a -> ContT r m a Source #
Monoid w => MonadTrans (RWST r w s) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods lift :: Monad m => m a -> RWST r w s m a Source #
Monoid w => MonadTrans (RWST r w s) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods lift :: Monad m => m a -> RWST r w s m a Source #
MonadTrans (Proxy a' a b' b) Source # |
Instance details Defined in Pipes.Internal Methods lift :: Monad m => m a0 -> Proxy a' a b' b m a0 Source #

class MFunctor (t :: (Type -> Type) -> k -> Type) where Source #

A functor in the category of monads, using `hoist` as the analog of `fmap`:

    hoist (f . g) = hoist f . hoist g

    hoist id = id

Methods

hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b Source #

Lift a monad morphism from `m` to `n` into a monad morphism from `(t m)` to `(t n)`

The first argument to `hoist` must be a monad morphism, even though the type system does not enforce this

Instances

MFunctor MaybeT |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> MaybeT m b -> MaybeT n b Source #
MFunctor ListT |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> ListT m b -> ListT n b Source #
MFunctor Lift |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> Lift m b -> Lift n b Source #
MFunctor ListT Source # |
Instance details Defined in Pipes Methods hoist :: Monad m => (forall a. m a -> n a) -> ListT m b -> ListT n b Source #
MFunctor (ExceptT e :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> ExceptT e m b -> ExceptT e n b Source #
MFunctor (IdentityT :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> IdentityT m b -> IdentityT n b Source #
MFunctor (ErrorT e :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> ErrorT e m b -> ErrorT e n b Source #
MFunctor (ReaderT r :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> ReaderT r m b -> ReaderT r n b Source #
MFunctor (StateT s :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> StateT s m b -> StateT s n b Source #
MFunctor (StateT s :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> StateT s m b -> StateT s n b Source #
MFunctor (WriterT w :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> WriterT w m b -> WriterT w n b Source #
MFunctor (WriterT w :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> WriterT w m b -> WriterT w n b Source #
MFunctor (Backwards :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> Backwards m b -> Backwards n b Source #
MFunctor (Product f :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> Product f m b -> Product f n b Source #
Functor f => MFunctor (Compose f :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> Compose f m b -> Compose f n b Source #
MFunctor (RWST r w s :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> RWST r w s m b -> RWST r w s n b Source #
MFunctor (RWST r w s :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods hoist :: Monad m => (forall a. m a -> n a) -> RWST r w s m b -> RWST r w s n b Source #
MFunctor (Proxy a' a b' b :: (Type -> Type) -> Type -> Type) Source # |
Instance details Defined in Pipes.Internal Methods hoist :: Monad m => (forall a0. m a0 -> n a0) -> Proxy a' a b' b m b0 -> Proxy a' a b' b n b0 Source #

class (MFunctor t, MonadTrans t) => MMonad (t :: (Type -> Type) -> Type -> Type) where Source #

A monad in the category of monads, using `lift` from `MonadTrans` as the analog of `return` and `embed` as the analog of (`=<<`):

    embed lift = id

    embed f (lift m) = f m

    embed g (embed f t) = embed (\m -> embed g (f m)) t

Methods

embed :: Monad n => (forall a. m a -> t n a) -> t m b -> t n b Source #

Embed a newly created `MMonad` layer within an existing layer

`embed` is analogous to (`=<<`)

Instances

MMonad MaybeT |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> MaybeT n a) -> MaybeT m b -> MaybeT n b Source #
MMonad ListT |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> ListT n a) -> ListT m b -> ListT n b Source #
MMonad ListT Source # |
Instance details Defined in Pipes Methods embed :: Monad n => (forall a. m a -> ListT n a) -> ListT m b -> ListT n b Source #
MMonad (ExceptT e) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> ExceptT e n a) -> ExceptT e m b -> ExceptT e n b Source #
MMonad (IdentityT :: (Type -> Type) -> Type -> Type) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> IdentityT n a) -> IdentityT m b -> IdentityT n b Source #
Error e => MMonad (ErrorT e) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> ErrorT e n a) -> ErrorT e m b -> ErrorT e n b Source #
MMonad (ReaderT r) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> ReaderT r n a) -> ReaderT r m b -> ReaderT r n b Source #
Monoid w => MMonad (WriterT w) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> WriterT w n a) -> WriterT w m b -> WriterT w n b Source #
Monoid w => MMonad (WriterT w) |
Instance details Defined in Control.Monad.Morph Methods embed :: Monad n => (forall a. m a -> WriterT w n a) -> WriterT w m b -> WriterT w n b Source #
MMonad (Proxy a' a b' b) Source # |
Instance details Defined in Pipes.Internal Methods embed :: Monad n => (forall a0. m a0 -> Proxy a' a b' b n a0) -> Proxy a' a b' b m b0 -> Proxy a' a b' b n b0 Source #

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

Data structures that can be folded.

For example, given a data type

    data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

    instance Foldable Tree where
       foldMap f Empty = mempty
       foldMap f (Leaf x) = f x
       foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define `foldr`:

    instance Foldable Tree where
       foldr f z Empty = z
       foldr f z (Leaf x) = f x z
       foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

`Foldable` instances are expected to satisfy the following laws:

    foldr f z t = appEndo (foldMap (Endo . f) t ) z

    foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z

    fold = foldMap id

    length = getSum . foldMap (Sum . const  1)

`sum`, `product`, `maximum`, and `minimum` should all be essentially equivalent to `foldMap` forms, such as

    sum = getSum . foldMap Sum

but may be less defined.

If the type is also a `Functor` instance, it should satisfy

    foldMap f = fold . fmap f

which implies that

    foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

foldMap | foldr

Instances

Foldable [] | Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => [m] -> m Source #

foldMap :: Monoid m => (a -> m) -> [a] -> m Source #

foldr :: (a -> b -> b) -> b -> [a] -> b Source #

foldr' :: (a -> b -> b) -> b -> [a] -> b Source #

foldl :: (b -> a -> b) -> b -> [a] -> b Source #

foldl' :: (b -> a -> b) -> b -> [a] -> b Source #

foldr1 :: (a -> a -> a) -> [a] -> a Source #

foldl1 :: (a -> a -> a) -> [a] -> a Source #

toList :: [a] -> [a] Source #

null :: [a] -> Bool Source #

length :: [a] -> Int Source #

elem :: Eq a => a -> [a] -> Bool Source #

maximum :: Ord a => [a] -> a Source #

minimum :: Ord a => [a] -> a Source #

sum :: Num a => [a] -> a Source #

product :: Num a => [a] -> a Source #

Foldable Maybe | Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Maybe m -> m Source #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m Source #

foldr :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldl :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldr1 :: (a -> a -> a) -> Maybe a -> a Source #

foldl1 :: (a -> a -> a) -> Maybe a -> a Source #

toList :: Maybe a -> [a] Source #

null :: Maybe a -> Bool Source #

length :: Maybe a -> Int Source #

elem :: Eq a => a -> Maybe a -> Bool Source #

maximum :: Ord a => Maybe a -> a Source #

minimum :: Ord a => Maybe a -> a Source #

sum :: Num a => Maybe a -> a Source #

product :: Num a => Maybe a -> a Source #

Foldable Par1 | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Par1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> Par1 a -> m Source #

foldr :: (a -> b -> b) -> b -> Par1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> Par1 a -> b Source #

foldl :: (b -> a -> b) -> b -> Par1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> Par1 a -> b Source #

foldr1 :: (a -> a -> a) -> Par1 a -> a Source #

foldl1 :: (a -> a -> a) -> Par1 a -> a Source #

toList :: Par1 a -> [a] Source #

null :: Par1 a -> Bool Source #

length :: Par1 a -> Int Source #

elem :: Eq a => a -> Par1 a -> Bool Source #

maximum :: Ord a => Par1 a -> a Source #

minimum :: Ord a => Par1 a -> a Source #

sum :: Num a => Par1 a -> a Source #

product :: Num a => Par1 a -> a Source #

Foldable Min | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Min m -> m Source #

foldMap :: Monoid m => (a -> m) -> Min a -> m Source #

foldr :: (a -> b -> b) -> b -> Min a -> b Source #

foldr' :: (a -> b -> b) -> b -> Min a -> b Source #

foldl :: (b -> a -> b) -> b -> Min a -> b Source #

foldl' :: (b -> a -> b) -> b -> Min a -> b Source #

foldr1 :: (a -> a -> a) -> Min a -> a Source #

foldl1 :: (a -> a -> a) -> Min a -> a Source #

toList :: Min a -> [a] Source #

null :: Min a -> Bool Source #

length :: Min a -> Int Source #

elem :: Eq a => a -> Min a -> Bool Source #

maximum :: Ord a => Min a -> a Source #

minimum :: Ord a => Min a -> a Source #

sum :: Num a => Min a -> a Source #

product :: Num a => Min a -> a Source #

Foldable Max | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Max m -> m Source #

foldMap :: Monoid m => (a -> m) -> Max a -> m Source #

foldr :: (a -> b -> b) -> b -> Max a -> b Source #

foldr' :: (a -> b -> b) -> b -> Max a -> b Source #

foldl :: (b -> a -> b) -> b -> Max a -> b Source #

foldl' :: (b -> a -> b) -> b -> Max a -> b Source #

foldr1 :: (a -> a -> a) -> Max a -> a Source #

foldl1 :: (a -> a -> a) -> Max a -> a Source #

toList :: Max a -> [a] Source #

null :: Max a -> Bool Source #

length :: Max a -> Int Source #

elem :: Eq a => a -> Max a -> Bool Source #

maximum :: Ord a => Max a -> a Source #

minimum :: Ord a => Max a -> a Source #

sum :: Num a => Max a -> a Source #

product :: Num a => Max a -> a Source #

Foldable First | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => First m -> m Source #

foldMap :: Monoid m => (a -> m) -> First a -> m Source #

foldr :: (a -> b -> b) -> b -> First a -> b Source #

foldr' :: (a -> b -> b) -> b -> First a -> b Source #

foldl :: (b -> a -> b) -> b -> First a -> b Source #

foldl' :: (b -> a -> b) -> b -> First a -> b Source #

foldr1 :: (a -> a -> a) -> First a -> a Source #

foldl1 :: (a -> a -> a) -> First a -> a Source #

toList :: First a -> [a] Source #

null :: First a -> Bool Source #

length :: First a -> Int Source #

elem :: Eq a => a -> First a -> Bool Source #

maximum :: Ord a => First a -> a Source #

minimum :: Ord a => First a -> a Source #

sum :: Num a => First a -> a Source #

product :: Num a => First a -> a Source #

Foldable Last | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Last m -> m Source #

foldMap :: Monoid m => (a -> m) -> Last a -> m Source #

foldr :: (a -> b -> b) -> b -> Last a -> b Source #

foldr' :: (a -> b -> b) -> b -> Last a -> b Source #

foldl :: (b -> a -> b) -> b -> Last a -> b Source #

foldl' :: (b -> a -> b) -> b -> Last a -> b Source #

foldr1 :: (a -> a -> a) -> Last a -> a Source #

foldl1 :: (a -> a -> a) -> Last a -> a Source #

toList :: Last a -> [a] Source #

null :: Last a -> Bool Source #

length :: Last a -> Int Source #

elem :: Eq a => a -> Last a -> Bool Source #

maximum :: Ord a => Last a -> a Source #

minimum :: Ord a => Last a -> a Source #

sum :: Num a => Last a -> a Source #

product :: Num a => Last a -> a Source #

Foldable Option | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Option m -> m Source #

foldMap :: Monoid m => (a -> m) -> Option a -> m Source #

foldr :: (a -> b -> b) -> b -> Option a -> b Source #

foldr' :: (a -> b -> b) -> b -> Option a -> b Source #

foldl :: (b -> a -> b) -> b -> Option a -> b Source #

foldl' :: (b -> a -> b) -> b -> Option a -> b Source #

foldr1 :: (a -> a -> a) -> Option a -> a Source #

foldl1 :: (a -> a -> a) -> Option a -> a Source #

toList :: Option a -> [a] Source #

null :: Option a -> Bool Source #

length :: Option a -> Int Source #

elem :: Eq a => a -> Option a -> Bool Source #

maximum :: Ord a => Option a -> a Source #

minimum :: Ord a => Option a -> a Source #

sum :: Num a => Option a -> a Source #

product :: Num a => Option a -> a Source #

Foldable ZipList | Since: base-4.9.0.0

Instance details

Defined in Control.Applicative

Methods

fold :: Monoid m => ZipList m -> m Source #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldr :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldl :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldr1 :: (a -> a -> a) -> ZipList a -> a Source #

foldl1 :: (a -> a -> a) -> ZipList a -> a Source #

toList :: ZipList a -> [a] Source #

null :: ZipList a -> Bool Source #

length :: ZipList a -> Int Source #

elem :: Eq a => a -> ZipList a -> Bool Source #

maximum :: Ord a => ZipList a -> a Source #

minimum :: Ord a => ZipList a -> a Source #

sum :: Num a => ZipList a -> a Source #

product :: Num a => ZipList a -> a Source #

Foldable Identity | Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m Source #

foldMap :: Monoid m => (a -> m) -> Identity a -> m Source #

foldr :: (a -> b -> b) -> b -> Identity a -> b Source #

foldr' :: (a -> b -> b) -> b -> Identity a -> b Source #

foldl :: (b -> a -> b) -> b -> Identity a -> b Source #

foldl' :: (b -> a -> b) -> b -> Identity a -> b Source #

foldr1 :: (a -> a -> a) -> Identity a -> a Source #

foldl1 :: (a -> a -> a) -> Identity a -> a Source #

toList :: Identity a -> [a] Source #

null :: Identity a -> Bool Source #

length :: Identity a -> Int Source #

elem :: Eq a => a -> Identity a -> Bool Source #

maximum :: Ord a => Identity a -> a Source #

minimum :: Ord a => Identity a -> a Source #

sum :: Num a => Identity a -> a Source #

product :: Num a => Identity a -> a Source #

Foldable First | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => First m -> m Source #

foldMap :: Monoid m => (a -> m) -> First a -> m Source #

foldr :: (a -> b -> b) -> b -> First a -> b Source #

foldr' :: (a -> b -> b) -> b -> First a -> b Source #

foldl :: (b -> a -> b) -> b -> First a -> b Source #

foldl' :: (b -> a -> b) -> b -> First a -> b Source #

foldr1 :: (a -> a -> a) -> First a -> a Source #

foldl1 :: (a -> a -> a) -> First a -> a Source #

toList :: First a -> [a] Source #

null :: First a -> Bool Source #

length :: First a -> Int Source #

elem :: Eq a => a -> First a -> Bool Source #

maximum :: Ord a => First a -> a Source #

minimum :: Ord a => First a -> a Source #

sum :: Num a => First a -> a Source #

product :: Num a => First a -> a Source #

Foldable Last | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Last m -> m Source #

foldMap :: Monoid m => (a -> m) -> Last a -> m Source #

foldr :: (a -> b -> b) -> b -> Last a -> b Source #

foldr' :: (a -> b -> b) -> b -> Last a -> b Source #

foldl :: (b -> a -> b) -> b -> Last a -> b Source #

foldl' :: (b -> a -> b) -> b -> Last a -> b Source #

foldr1 :: (a -> a -> a) -> Last a -> a Source #

foldl1 :: (a -> a -> a) -> Last a -> a Source #

toList :: Last a -> [a] Source #

null :: Last a -> Bool Source #

length :: Last a -> Int Source #

elem :: Eq a => a -> Last a -> Bool Source #

maximum :: Ord a => Last a -> a Source #

minimum :: Ord a => Last a -> a Source #

sum :: Num a => Last a -> a Source #

product :: Num a => Last a -> a Source #

Foldable Dual | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Dual m -> m Source #

foldMap :: Monoid m => (a -> m) -> Dual a -> m Source #

foldr :: (a -> b -> b) -> b -> Dual a -> b Source #

foldr' :: (a -> b -> b) -> b -> Dual a -> b Source #

foldl :: (b -> a -> b) -> b -> Dual a -> b Source #

foldl' :: (b -> a -> b) -> b -> Dual a -> b Source #

foldr1 :: (a -> a -> a) -> Dual a -> a Source #

foldl1 :: (a -> a -> a) -> Dual a -> a Source #

toList :: Dual a -> [a] Source #

null :: Dual a -> Bool Source #

length :: Dual a -> Int Source #

elem :: Eq a => a -> Dual a -> Bool Source #

maximum :: Ord a => Dual a -> a Source #

minimum :: Ord a => Dual a -> a Source #

sum :: Num a => Dual a -> a Source #

product :: Num a => Dual a -> a Source #

Foldable Sum | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Sum m -> m Source #

foldMap :: Monoid m => (a -> m) -> Sum a -> m Source #

foldr :: (a -> b -> b) -> b -> Sum a -> b Source #

foldr' :: (a -> b -> b) -> b -> Sum a -> b Source #

foldl :: (b -> a -> b) -> b -> Sum a -> b Source #

foldl' :: (b -> a -> b) -> b -> Sum a -> b Source #

foldr1 :: (a -> a -> a) -> Sum a -> a Source #

foldl1 :: (a -> a -> a) -> Sum a -> a Source #

toList :: Sum a -> [a] Source #

null :: Sum a -> Bool Source #

length :: Sum a -> Int Source #

elem :: Eq a => a -> Sum a -> Bool Source #

maximum :: Ord a => Sum a -> a Source #

minimum :: Ord a => Sum a -> a Source #

sum :: Num a => Sum a -> a Source #

product :: Num a => Sum a -> a Source #

Foldable Product | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Product m -> m Source #

foldMap :: Monoid m => (a -> m) -> Product a -> m Source #

foldr :: (a -> b -> b) -> b -> Product a -> b Source #

foldr' :: (a -> b -> b) -> b -> Product a -> b Source #

foldl :: (b -> a -> b) -> b -> Product a -> b Source #

foldl' :: (b -> a -> b) -> b -> Product a -> b Source #

foldr1 :: (a -> a -> a) -> Product a -> a Source #

foldl1 :: (a -> a -> a) -> Product a -> a Source #

toList :: Product a -> [a] Source #

null :: Product a -> Bool Source #

length :: Product a -> Int Source #

elem :: Eq a => a -> Product a -> Bool Source #

maximum :: Ord a => Product a -> a Source #

minimum :: Ord a => Product a -> a Source #

sum :: Num a => Product a -> a Source #

product :: Num a => Product a -> a Source #

Foldable Down | Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Down m -> m Source #

foldMap :: Monoid m => (a -> m) -> Down a -> m Source #

foldr :: (a -> b -> b) -> b -> Down a -> b Source #

foldr' :: (a -> b -> b) -> b -> Down a -> b Source #

foldl :: (b -> a -> b) -> b -> Down a -> b Source #

foldl' :: (b -> a -> b) -> b -> Down a -> b Source #

foldr1 :: (a -> a -> a) -> Down a -> a Source #

foldl1 :: (a -> a -> a) -> Down a -> a Source #

toList :: Down a -> [a] Source #

null :: Down a -> Bool Source #

length :: Down a -> Int Source #

elem :: Eq a => a -> Down a -> Bool Source #

maximum :: Ord a => Down a -> a Source #

minimum :: Ord a => Down a -> a Source #

sum :: Num a => Down a -> a Source #

product :: Num a => Down a -> a Source #

Foldable NonEmpty | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => NonEmpty m -> m Source #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m Source #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b Source #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b Source #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a Source #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a Source #

toList :: NonEmpty a -> [a] Source #

null :: NonEmpty a -> Bool Source #

length :: NonEmpty a -> Int Source #

elem :: Eq a => a -> NonEmpty a -> Bool Source #

maximum :: Ord a => NonEmpty a -> a Source #

minimum :: Ord a => NonEmpty a -> a Source #

sum :: Num a => NonEmpty a -> a Source #

product :: Num a => NonEmpty a -> a Source #

Foldable (Either a) | Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Either a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

toList :: Either a a0 -> [a0] Source #

null :: Either a a0 -> Bool Source #

length :: Either a a0 -> Int Source #

elem :: Eq a0 => a0 -> Either a a0 -> Bool Source #

maximum :: Ord a0 => Either a a0 -> a0 Source #

minimum :: Ord a0 => Either a a0 -> a0 Source #

sum :: Num a0 => Either a a0 -> a0 Source #

product :: Num a0 => Either a a0 -> a0 Source #

Foldable (V1 :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => V1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> V1 a -> m Source #

foldr :: (a -> b -> b) -> b -> V1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> V1 a -> b Source #

foldl :: (b -> a -> b) -> b -> V1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> V1 a -> b Source #

foldr1 :: (a -> a -> a) -> V1 a -> a Source #

foldl1 :: (a -> a -> a) -> V1 a -> a Source #

toList :: V1 a -> [a] Source #

null :: V1 a -> Bool Source #

length :: V1 a -> Int Source #

elem :: Eq a => a -> V1 a -> Bool Source #

maximum :: Ord a => V1 a -> a Source #

minimum :: Ord a => V1 a -> a Source #

sum :: Num a => V1 a -> a Source #

product :: Num a => V1 a -> a Source #

Foldable (U1 :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => U1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> U1 a -> m Source #

foldr :: (a -> b -> b) -> b -> U1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> U1 a -> b Source #

foldl :: (b -> a -> b) -> b -> U1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> U1 a -> b Source #

foldr1 :: (a -> a -> a) -> U1 a -> a Source #

foldl1 :: (a -> a -> a) -> U1 a -> a Source #

toList :: U1 a -> [a] Source #

null :: U1 a -> Bool Source #

length :: U1 a -> Int Source #

elem :: Eq a => a -> U1 a -> Bool Source #

maximum :: Ord a => U1 a -> a Source #

minimum :: Ord a => U1 a -> a Source #

sum :: Num a => U1 a -> a Source #

product :: Num a => U1 a -> a Source #

Foldable ((,) a) | Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (a, m) -> m Source #

foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m Source #

foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b Source #

foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b Source #

foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b Source #

foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 Source #

toList :: (a, a0) -> [a0] Source #

null :: (a, a0) -> Bool Source #

length :: (a, a0) -> Int Source #

elem :: Eq a0 => a0 -> (a, a0) -> Bool Source #

maximum :: Ord a0 => (a, a0) -> a0 Source #

minimum :: Ord a0 => (a, a0) -> a0 Source #

sum :: Num a0 => (a, a0) -> a0 Source #

product :: Num a0 => (a, a0) -> a0 Source #

Foldable (Array i) | Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Array i m -> m Source #

foldMap :: Monoid m => (a -> m) -> Array i a -> m Source #

foldr :: (a -> b -> b) -> b -> Array i a -> b Source #

foldr' :: (a -> b -> b) -> b -> Array i a -> b Source #

foldl :: (b -> a -> b) -> b -> Array i a -> b Source #

foldl' :: (b -> a -> b) -> b -> Array i a -> b Source #

foldr1 :: (a -> a -> a) -> Array i a -> a Source #

foldl1 :: (a -> a -> a) -> Array i a -> a Source #

toList :: Array i a -> [a] Source #

null :: Array i a -> Bool Source #

length :: Array i a -> Int Source #

elem :: Eq a => a -> Array i a -> Bool Source #

maximum :: Ord a => Array i a -> a Source #

minimum :: Ord a => Array i a -> a Source #

sum :: Num a => Array i a -> a Source #

product :: Num a => Array i a -> a Source #

Foldable (Arg a) | Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

fold :: Monoid m => Arg a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 Source #

toList :: Arg a a0 -> [a0] Source #

null :: Arg a a0 -> Bool Source #

length :: Arg a a0 -> Int Source #

elem :: Eq a0 => a0 -> Arg a a0 -> Bool Source #

maximum :: Ord a0 => Arg a a0 -> a0 Source #

minimum :: Ord a0 => Arg a a0 -> a0 Source #

sum :: Num a0 => Arg a a0 -> a0 Source #

product :: Num a0 => Arg a a0 -> a0 Source #

Foldable (Proxy :: Type -> Type) | Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m Source #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m Source #

foldr :: (a -> b -> b) -> b -> Proxy a -> b Source #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b Source #

foldl :: (b -> a -> b) -> b -> Proxy a -> b Source #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b Source #

foldr1 :: (a -> a -> a) -> Proxy a -> a Source #

foldl1 :: (a -> a -> a) -> Proxy a -> a Source #

toList :: Proxy a -> [a] Source #

null :: Proxy a -> Bool Source #

length :: Proxy a -> Int Source #

elem :: Eq a => a -> Proxy a -> Bool Source #

maximum :: Ord a => Proxy a -> a Source #

minimum :: Ord a => Proxy a -> a Source #

sum :: Num a => Proxy a -> a Source #

product :: Num a => Proxy a -> a Source #

Foldable f => Foldable (MaybeT f) |

Instance details

Defined in Control.Monad.Trans.Maybe

Methods

fold :: Monoid m => MaybeT f m -> m Source #

foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m Source #

foldr :: (a -> b -> b) -> b -> MaybeT f a -> b Source #

foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b Source #

foldl :: (b -> a -> b) -> b -> MaybeT f a -> b Source #

foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b Source #

foldr1 :: (a -> a -> a) -> MaybeT f a -> a Source #

foldl1 :: (a -> a -> a) -> MaybeT f a -> a Source #

toList :: MaybeT f a -> [a] Source #

null :: MaybeT f a -> Bool Source #

length :: MaybeT f a -> Int Source #

elem :: Eq a => a -> MaybeT f a -> Bool Source #

maximum :: Ord a => MaybeT f a -> a Source #

minimum :: Ord a => MaybeT f a -> a Source #

sum :: Num a => MaybeT f a -> a Source #

product :: Num a => MaybeT f a -> a Source #

Foldable f => Foldable (ListT f) |

Instance details

Defined in Control.Monad.Trans.List

Methods

fold :: Monoid m => ListT f m -> m Source #

foldMap :: Monoid m => (a -> m) -> ListT f a -> m Source #

foldr :: (a -> b -> b) -> b -> ListT f a -> b Source #

foldr' :: (a -> b -> b) -> b -> ListT f a -> b Source #

foldl :: (b -> a -> b) -> b -> ListT f a -> b Source #

foldl' :: (b -> a -> b) -> b -> ListT f a -> b Source #

foldr1 :: (a -> a -> a) -> ListT f a -> a Source #

foldl1 :: (a -> a -> a) -> ListT f a -> a Source #

toList :: ListT f a -> [a] Source #

null :: ListT f a -> Bool Source #

length :: ListT f a -> Int Source #

elem :: Eq a => a -> ListT f a -> Bool Source #

maximum :: Ord a => ListT f a -> a Source #

minimum :: Ord a => ListT f a -> a Source #

sum :: Num a => ListT f a -> a Source #

product :: Num a => ListT f a -> a Source #

Foldable f => Foldable (Lift f) |

Instance details

Defined in Control.Applicative.Lift

Methods

fold :: Monoid m => Lift f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Lift f a -> m Source #

foldr :: (a -> b -> b) -> b -> Lift f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Lift f a -> b Source #

foldl :: (b -> a -> b) -> b -> Lift f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Lift f a -> b Source #

foldr1 :: (a -> a -> a) -> Lift f a -> a Source #

foldl1 :: (a -> a -> a) -> Lift f a -> a Source #

toList :: Lift f a -> [a] Source #

null :: Lift f a -> Bool Source #

length :: Lift f a -> Int Source #

elem :: Eq a => a -> Lift f a -> Bool Source #

maximum :: Ord a => Lift f a -> a Source #

minimum :: Ord a => Lift f a -> a Source #

sum :: Num a => Lift f a -> a Source #

product :: Num a => Lift f a -> a Source #

Foldable m => Foldable (ListT m) Source # |

Instance details

Defined in Pipes

Methods

fold :: Monoid m0 => ListT m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> ListT m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> ListT m a -> b Source #

foldr' :: (a -> b -> b) -> b -> ListT m a -> b Source #

foldl :: (b -> a -> b) -> b -> ListT m a -> b Source #

foldl' :: (b -> a -> b) -> b -> ListT m a -> b Source #

foldr1 :: (a -> a -> a) -> ListT m a -> a Source #

foldl1 :: (a -> a -> a) -> ListT m a -> a Source #

toList :: ListT m a -> [a] Source #

null :: ListT m a -> Bool Source #

length :: ListT m a -> Int Source #

elem :: Eq a => a -> ListT m a -> Bool Source #

maximum :: Ord a => ListT m a -> a Source #

minimum :: Ord a => ListT m a -> a Source #

sum :: Num a => ListT m a -> a Source #

product :: Num a => ListT m a -> a Source #

Foldable f => Foldable (Rec1 f) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Rec1 f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m Source #

foldr :: (a -> b -> b) -> b -> Rec1 f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b Source #

foldl :: (b -> a -> b) -> b -> Rec1 f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b Source #

foldr1 :: (a -> a -> a) -> Rec1 f a -> a Source #

foldl1 :: (a -> a -> a) -> Rec1 f a -> a Source #

toList :: Rec1 f a -> [a] Source #

null :: Rec1 f a -> Bool Source #

length :: Rec1 f a -> Int Source #

elem :: Eq a => a -> Rec1 f a -> Bool Source #

maximum :: Ord a => Rec1 f a -> a Source #

minimum :: Ord a => Rec1 f a -> a Source #

sum :: Num a => Rec1 f a -> a Source #

product :: Num a => Rec1 f a -> a Source #

Foldable (URec Char :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Char m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldr1 :: (a -> a -> a) -> URec Char a -> a Source #

foldl1 :: (a -> a -> a) -> URec Char a -> a Source #

toList :: URec Char a -> [a] Source #

null :: URec Char a -> Bool Source #

length :: URec Char a -> Int Source #

elem :: Eq a => a -> URec Char a -> Bool Source #

maximum :: Ord a => URec Char a -> a Source #

minimum :: Ord a => URec Char a -> a Source #

sum :: Num a => URec Char a -> a Source #

product :: Num a => URec Char a -> a Source #

Foldable (URec Double :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Double m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldr1 :: (a -> a -> a) -> URec Double a -> a Source #

foldl1 :: (a -> a -> a) -> URec Double a -> a Source #

toList :: URec Double a -> [a] Source #

null :: URec Double a -> Bool Source #

length :: URec Double a -> Int Source #

elem :: Eq a => a -> URec Double a -> Bool Source #

maximum :: Ord a => URec Double a -> a Source #

minimum :: Ord a => URec Double a -> a Source #

sum :: Num a => URec Double a -> a Source #

product :: Num a => URec Double a -> a Source #

Foldable (URec Float :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Float m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldr1 :: (a -> a -> a) -> URec Float a -> a Source #

foldl1 :: (a -> a -> a) -> URec Float a -> a Source #

toList :: URec Float a -> [a] Source #

null :: URec Float a -> Bool Source #

length :: URec Float a -> Int Source #

elem :: Eq a => a -> URec Float a -> Bool Source #

maximum :: Ord a => URec Float a -> a Source #

minimum :: Ord a => URec Float a -> a Source #

sum :: Num a => URec Float a -> a Source #

product :: Num a => URec Float a -> a Source #

Foldable (URec Int :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Int m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Int a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldr1 :: (a -> a -> a) -> URec Int a -> a Source #

foldl1 :: (a -> a -> a) -> URec Int a -> a Source #

toList :: URec Int a -> [a] Source #

null :: URec Int a -> Bool Source #

length :: URec Int a -> Int Source #

elem :: Eq a => a -> URec Int a -> Bool Source #

maximum :: Ord a => URec Int a -> a Source #

minimum :: Ord a => URec Int a -> a Source #

sum :: Num a => URec Int a -> a Source #

product :: Num a => URec Int a -> a Source #

Foldable (URec Word :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec Word m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldr1 :: (a -> a -> a) -> URec Word a -> a Source #

foldl1 :: (a -> a -> a) -> URec Word a -> a Source #

toList :: URec Word a -> [a] Source #

null :: URec Word a -> Bool Source #

length :: URec Word a -> Int Source #

elem :: Eq a => a -> URec Word a -> Bool Source #

maximum :: Ord a => URec Word a -> a Source #

minimum :: Ord a => URec Word a -> a Source #

sum :: Num a => URec Word a -> a Source #

product :: Num a => URec Word a -> a Source #

Foldable (URec (Ptr ()) :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => URec (Ptr ()) m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m Source #

foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b Source #

foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b Source #

foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a Source #

foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a Source #

toList :: URec (Ptr ()) a -> [a] Source #

null :: URec (Ptr ()) a -> Bool Source #

length :: URec (Ptr ()) a -> Int Source #

elem :: Eq a => a -> URec (Ptr ()) a -> Bool Source #

maximum :: Ord a => URec (Ptr ()) a -> a Source #

minimum :: Ord a => URec (Ptr ()) a -> a Source #

sum :: Num a => URec (Ptr ()) a -> a Source #

product :: Num a => URec (Ptr ()) a -> a Source #

Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0

Instance details

Defined in Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> Const m a -> b Source #

foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #

foldl :: (b -> a -> b) -> b -> Const m a -> b Source #

foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #

foldr1 :: (a -> a -> a) -> Const m a -> a Source #

foldl1 :: (a -> a -> a) -> Const m a -> a Source #

toList :: Const m a -> [a] Source #

null :: Const m a -> Bool Source #

length :: Const m a -> Int Source #

elem :: Eq a => a -> Const m a -> Bool Source #

maximum :: Ord a => Const m a -> a Source #

minimum :: Ord a => Const m a -> a Source #

sum :: Num a => Const m a -> a Source #

product :: Num a => Const m a -> a Source #

Foldable f => Foldable (Ap f) | Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Ap f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Ap f a -> m Source #

foldr :: (a -> b -> b) -> b -> Ap f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Ap f a -> b Source #

foldl :: (b -> a -> b) -> b -> Ap f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Ap f a -> b Source #

foldr1 :: (a -> a -> a) -> Ap f a -> a Source #

foldl1 :: (a -> a -> a) -> Ap f a -> a Source #

toList :: Ap f a -> [a] Source #

null :: Ap f a -> Bool Source #

length :: Ap f a -> Int Source #

elem :: Eq a => a -> Ap f a -> Bool Source #

maximum :: Ord a => Ap f a -> a Source #

minimum :: Ord a => Ap f a -> a Source #

sum :: Num a => Ap f a -> a Source #

product :: Num a => Ap f a -> a Source #

Foldable f => Foldable (Alt f) | Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Alt f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Alt f a -> m Source #

foldr :: (a -> b -> b) -> b -> Alt f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Alt f a -> b Source #

foldl :: (b -> a -> b) -> b -> Alt f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Alt f a -> b Source #

foldr1 :: (a -> a -> a) -> Alt f a -> a Source #

foldl1 :: (a -> a -> a) -> Alt f a -> a Source #

toList :: Alt f a -> [a] Source #

null :: Alt f a -> Bool Source #

length :: Alt f a -> Int Source #

elem :: Eq a => a -> Alt f a -> Bool Source #

maximum :: Ord a => Alt f a -> a Source #

minimum :: Ord a => Alt f a -> a Source #

sum :: Num a => Alt f a -> a Source #

product :: Num a => Alt f a -> a Source #

Foldable f => Foldable (ExceptT e f) |

Instance details

Defined in Control.Monad.Trans.Except

Methods

fold :: Monoid m => ExceptT e f m -> m Source #

foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m Source #

foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b Source #

foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b Source #

foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b Source #

foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b Source #

foldr1 :: (a -> a -> a) -> ExceptT e f a -> a Source #

foldl1 :: (a -> a -> a) -> ExceptT e f a -> a Source #

toList :: ExceptT e f a -> [a] Source #

null :: ExceptT e f a -> Bool Source #

length :: ExceptT e f a -> Int Source #

elem :: Eq a => a -> ExceptT e f a -> Bool Source #

maximum :: Ord a => ExceptT e f a -> a Source #

minimum :: Ord a => ExceptT e f a -> a Source #

sum :: Num a => ExceptT e f a -> a Source #

product :: Num a => ExceptT e f a -> a Source #

Foldable f => Foldable (IdentityT f) |

Instance details

Defined in Control.Monad.Trans.Identity

Methods

fold :: Monoid m => IdentityT f m -> m Source #

foldMap :: Monoid m => (a -> m) -> IdentityT f a -> m Source #

foldr :: (a -> b -> b) -> b -> IdentityT f a -> b Source #

foldr' :: (a -> b -> b) -> b -> IdentityT f a -> b Source #

foldl :: (b -> a -> b) -> b -> IdentityT f a -> b Source #

foldl' :: (b -> a -> b) -> b -> IdentityT f a -> b Source #

foldr1 :: (a -> a -> a) -> IdentityT f a -> a Source #

foldl1 :: (a -> a -> a) -> IdentityT f a -> a Source #

toList :: IdentityT f a -> [a] Source #

null :: IdentityT f a -> Bool Source #

length :: IdentityT f a -> Int Source #

elem :: Eq a => a -> IdentityT f a -> Bool Source #

maximum :: Ord a => IdentityT f a -> a Source #

minimum :: Ord a => IdentityT f a -> a Source #

sum :: Num a => IdentityT f a -> a Source #

product :: Num a => IdentityT f a -> a Source #

Foldable f => Foldable (ErrorT e f) |

Instance details

Defined in Control.Monad.Trans.Error

Methods

fold :: Monoid m => ErrorT e f m -> m Source #

foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m Source #

foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b Source #

foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b Source #

foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b Source #

foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b Source #

foldr1 :: (a -> a -> a) -> ErrorT e f a -> a Source #

foldl1 :: (a -> a -> a) -> ErrorT e f a -> a Source #

toList :: ErrorT e f a -> [a] Source #

null :: ErrorT e f a -> Bool Source #

length :: ErrorT e f a -> Int Source #

elem :: Eq a => a -> ErrorT e f a -> Bool Source #

maximum :: Ord a => ErrorT e f a -> a Source #

minimum :: Ord a => ErrorT e f a -> a Source #

sum :: Num a => ErrorT e f a -> a Source #

product :: Num a => ErrorT e f a -> a Source #

Foldable f => Foldable (WriterT w f) |

Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

fold :: Monoid m => WriterT w f m -> m Source #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m Source #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b Source #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b Source #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b Source #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b Source #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a Source #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a Source #

toList :: WriterT w f a -> [a] Source #

null :: WriterT w f a -> Bool Source #

length :: WriterT w f a -> Int Source #

elem :: Eq a => a -> WriterT w f a -> Bool Source #

maximum :: Ord a => WriterT w f a -> a Source #

minimum :: Ord a => WriterT w f a -> a Source #

sum :: Num a => WriterT w f a -> a Source #

product :: Num a => WriterT w f a -> a Source #

Foldable f => Foldable (WriterT w f) |

Instance details

Defined in Control.Monad.Trans.Writer.Strict

Methods

fold :: Monoid m => WriterT w f m -> m Source #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m Source #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b Source #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b Source #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b Source #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b Source #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a Source #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a Source #

toList :: WriterT w f a -> [a] Source #

null :: WriterT w f a -> Bool Source #

length :: WriterT w f a -> Int Source #

elem :: Eq a => a -> WriterT w f a -> Bool Source #

maximum :: Ord a => WriterT w f a -> a Source #

minimum :: Ord a => WriterT w f a -> a Source #

sum :: Num a => WriterT w f a -> a Source #

product :: Num a => WriterT w f a -> a Source #

Foldable f => Foldable (Backwards f) | Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

fold :: Monoid m => Backwards f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Backwards f a -> m Source #

foldr :: (a -> b -> b) -> b -> Backwards f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Backwards f a -> b Source #

foldl :: (b -> a -> b) -> b -> Backwards f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Backwards f a -> b Source #

foldr1 :: (a -> a -> a) -> Backwards f a -> a Source #

foldl1 :: (a -> a -> a) -> Backwards f a -> a Source #

toList :: Backwards f a -> [a] Source #

null :: Backwards f a -> Bool Source #

length :: Backwards f a -> Int Source #

elem :: Eq a => a -> Backwards f a -> Bool Source #

maximum :: Ord a => Backwards f a -> a Source #

minimum :: Ord a => Backwards f a -> a Source #

sum :: Num a => Backwards f a -> a Source #

product :: Num a => Backwards f a -> a Source #

Foldable (K1 i c :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => K1 i c m -> m Source #

foldMap :: Monoid m => (a -> m) -> K1 i c a -> m Source #

foldr :: (a -> b -> b) -> b -> K1 i c a -> b Source #

foldr' :: (a -> b -> b) -> b -> K1 i c a -> b Source #

foldl :: (b -> a -> b) -> b -> K1 i c a -> b Source #

foldl' :: (b -> a -> b) -> b -> K1 i c a -> b Source #

foldr1 :: (a -> a -> a) -> K1 i c a -> a Source #

foldl1 :: (a -> a -> a) -> K1 i c a -> a Source #

toList :: K1 i c a -> [a] Source #

null :: K1 i c a -> Bool Source #

length :: K1 i c a -> Int Source #

elem :: Eq a => a -> K1 i c a -> Bool Source #

maximum :: Ord a => K1 i c a -> a Source #

minimum :: Ord a => K1 i c a -> a Source #

sum :: Num a => K1 i c a -> a Source #

product :: Num a => K1 i c a -> a Source #

(Foldable f, Foldable g) => Foldable (f :+: g) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :+: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a Source #

toList :: (f :+: g) a -> [a] Source #

null :: (f :+: g) a -> Bool Source #

length :: (f :+: g) a -> Int Source #

elem :: Eq a => a -> (f :+: g) a -> Bool Source #

maximum :: Ord a => (f :+: g) a -> a Source #

minimum :: Ord a => (f :+: g) a -> a Source #

sum :: Num a => (f :+: g) a -> a Source #

product :: Num a => (f :+: g) a -> a Source #

(Foldable f, Foldable g) => Foldable (f :*: g) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :*: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a Source #

toList :: (f :*: g) a -> [a] Source #

null :: (f :*: g) a -> Bool Source #

length :: (f :*: g) a -> Int Source #

elem :: Eq a => a -> (f :*: g) a -> Bool Source #

maximum :: Ord a => (f :*: g) a -> a Source #

minimum :: Ord a => (f :*: g) a -> a Source #

sum :: Num a => (f :*: g) a -> a Source #

product :: Num a => (f :*: g) a -> a Source #

(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 Source #

foldMap :: Monoid m => (a -> m) -> Product f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Product f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Product f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Product f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Product f g a -> b Source #

foldr1 :: (a -> a -> a) -> Product f g a -> a Source #

foldl1 :: (a -> a -> a) -> Product f g a -> a Source #

toList :: Product f g a -> [a] Source #

null :: Product f g a -> Bool Source #

length :: Product f g a -> Int Source #

elem :: Eq a => a -> Product f g a -> Bool Source #

maximum :: Ord a => Product f g a -> a Source #

minimum :: Ord a => Product f g a -> a Source #

sum :: Num a => Product f g a -> a Source #

product :: Num a => Product f g a -> a Source #

(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 Source #

foldMap :: Monoid m => (a -> m) -> Sum f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Sum f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Sum f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Sum f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Sum f g a -> b Source #

foldr1 :: (a -> a -> a) -> Sum f g a -> a Source #

foldl1 :: (a -> a -> a) -> Sum f g a -> a Source #

toList :: Sum f g a -> [a] Source #

null :: Sum f g a -> Bool Source #

length :: Sum f g a -> Int Source #

elem :: Eq a => a -> Sum f g a -> Bool Source #

maximum :: Ord a => Sum f g a -> a Source #

minimum :: Ord a => Sum f g a -> a Source #

sum :: Num a => Sum f g a -> a Source #

product :: Num a => Sum f g a -> a Source #

Foldable f => Foldable (M1 i c f) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => M1 i c f m -> m Source #

foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m Source #

foldr :: (a -> b -> b) -> b -> M1 i c f a -> b Source #

foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b Source #

foldl :: (b -> a -> b) -> b -> M1 i c f a -> b Source #

foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b Source #

foldr1 :: (a -> a -> a) -> M1 i c f a -> a Source #

foldl1 :: (a -> a -> a) -> M1 i c f a -> a Source #

toList :: M1 i c f a -> [a] Source #

null :: M1 i c f a -> Bool Source #

length :: M1 i c f a -> Int Source #

elem :: Eq a => a -> M1 i c f a -> Bool Source #

maximum :: Ord a => M1 i c f a -> a Source #

minimum :: Ord a => M1 i c f a -> a Source #

sum :: Num a => M1 i c f a -> a Source #

product :: Num a => M1 i c f a -> a Source #

(Foldable f, Foldable g) => Foldable (f :.: g) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :.: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :.: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :.: g) a -> a Source #

toList :: (f :.: g) a -> [a] Source #

null :: (f :.: g) a -> Bool Source #

length :: (f :.: g) a -> Int Source #

elem :: Eq a => a -> (f :.: g) a -> Bool Source #

maximum :: Ord a => (f :.: g) a -> a Source #

minimum :: Ord a => (f :.: g) a -> a Source #

sum :: Num a => (f :.: g) a -> a Source #

product :: Num a => (f :.: g) a -> a Source #

(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 Source #

foldMap :: Monoid m => (a -> m) -> Compose f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Compose f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Compose f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Compose f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Compose f g a -> b Source #

foldr1 :: (a -> a -> a) -> Compose f g a -> a Source #

foldl1 :: (a -> a -> a) -> Compose f g a -> a Source #

toList :: Compose f g a -> [a] Source #

null :: Compose f g a -> Bool Source #

length :: Compose f g a -> Int Source #

elem :: Eq a => a -> Compose f g a -> Bool Source #

maximum :: Ord a => Compose f g a -> a Source #

minimum :: Ord a => Compose f g a -> a Source #

sum :: Num a => Compose f g a -> a Source #

product :: Num a => Compose f g a -> a Source #