| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Haskell.DoNotation
Description
Synopsis
- class BindSyntax (x :: Type -> Type) (y :: Type -> Type) (z :: Type -> Type) | x y -> z, x z -> y, y z -> x where
- class PureSyntax (x :: Type -> Type) where
- class Applicative m => Monad (m :: * -> *)
- class IxApplicative m => IxMonad (m :: k -> k -> * -> *)
Documentation
class BindSyntax (x :: Type -> Type) (y :: Type -> Type) (z :: Type -> Type) | x y -> z, x z -> y, y z -> x where Source #
Typeclass that provides '(>>=)' and '(>>)'.
Minimal complete definition
Instances
| (IxMonad m, x ~ m i j, y ~ m j k2, z ~ m i k2) => BindSyntax x y z Source # | |
| (Monad m, x ~ m) => BindSyntax m x m Source # | |
class PureSyntax (x :: Type -> Type) where Source #
Instances
| Applicative m => PureSyntax m Source # | |
| (IxMonad m, j ~ i) => PureSyntax (m i j) Source # | |
class Applicative m => Monad (m :: * -> *) #
The Monad class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad should satisfy the following laws:
Furthermore, the Monad and Applicative operations should relate as follows:
The above laws imply:
and that pure and (<*>) satisfy the applicative functor laws.
The instances of Monad for lists, Maybe and IO
defined in the Prelude satisfy these laws.
Minimal complete definition
Instances
| Monad [] | Since: base-2.1 |
| Monad Maybe | Since: base-2.1 |
| Monad IO | Since: base-2.1 |
| Monad ReadP | Since: base-2.1 |
| Monad NonEmpty | Since: base-4.9.0.0 |
| Monad P | Since: base-2.1 |
| Monad (Either e) | Since: base-4.4.0.0 |
| Monoid a => Monad ((,) a) | Since: base-4.9.0.0 |
| Monad ((->) r :: * -> *) | Since: base-2.1 |
| Monad m => Monad (Ix m i j) # | |