pandora-0.3.2: A box of patterns and paradigms

Pandora.Pattern.Functor.Applicative

Synopsis

# Documentation

class Covariant t => Applicative t where Source #

When providing a new instance, you should ensure it satisfies the three laws:
* Interpreted: (.) <$> u <*> v <*> w ≡ u <*> (v <*> w) * Left interchange: x <*> (f <$> y) ≡ (. f) <$> x <*> y * Right interchange: f <$> (x <*> y) ≡ (f .) <\$> x <*> y

Minimal complete definition

(<*>)

Methods

(<*>) :: t (a -> b) -> t a -> t b infixl 4 Source #

Infix version of apply

apply :: t (a -> b) -> t a -> t b Source #

Prefix version of <*>

(*>) :: t a -> t b -> t b infixl 4 Source #

Sequence actions, discarding the value of the first argument

(<*) :: t a -> t b -> t a infixl 4 Source #

Sequence actions, discarding the value of the second argument

forever :: t a -> t b Source #

Repeat an action indefinitely

(<**>) :: Applicative u => ((t :. u) := (a -> b)) -> ((t :. u) := a) -> (t :. u) := b Source #

Infix versions of apply with various nesting levels

(<***>) :: (Applicative u, Applicative v) => ((t :. (u :. v)) := (a -> b)) -> ((t :. (u :. v)) := a) -> (t :. (u :. v)) := b Source #

(<****>) :: (Applicative u, Applicative v, Applicative w) => ((t :. (u :. (v :. w))) := (a -> b)) -> ((t :. (u :. (v :. w))) := a) -> (t :. (u :. (v :. w))) := b Source #

#### Instances

Instances details