Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Covariant t => Applicative t where
- (<*>) :: t (a -> b) -> t a -> t b
- apply :: t (a -> b) -> t a -> t b
- (*>) :: t a -> t b -> t b
- (<*) :: t a -> t b -> t a
- forever :: t a -> t b
- (<**>) :: Applicative u => ((t :. u) := (a -> b)) -> ((t :. u) := a) -> (t :. u) := b
- (<***>) :: (Applicative u, Applicative v) => ((t :. (u :. v)) := (a -> b)) -> ((t :. (u :. v)) := a) -> (t :. (u :. v)) := b
- (<****>) :: (Applicative u, Applicative v, Applicative w) => ((t :. (u :. (v :. w))) := (a -> b)) -> ((t :. (u :. (v :. w))) := a) -> (t :. (u :. (v :. w))) := b
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
(<*>) :: 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 infixl 3 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 infixl 2 Source #
(<****>) :: (Applicative u, Applicative v, Applicative w) => ((t :. (u :. (v :. w))) := (a -> b)) -> ((t :. (u :. (v :. w))) := a) -> (t :. (u :. (v :. w))) := b infixl 1 Source #