| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Papa.Include.Data.Functor.Bind
Documentation
Minimal definition: Either join or >>-
If defining both, then the following laws (the default definitions) must hold:
join = (>>- id) m >>- f = join (fmap f m)
Laws:
induced definition of <.>: f <.> x = f >>- (<$> x)
Finally, there are two associativity conditions:
associativity of (>>-): (m >>- f) >>- g == m >>- (\x -> f x >>- g) associativity of join: join . join = join . fmap join
These can both be seen as special cases of the constraint that
associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h)
Instances
| Bind [] | |
| Bind Maybe | |
| Bind IO | |
| Bind Identity | |
| Bind Option | |
| Bind NonEmpty | |
| Bind Tree | |
| Bind Seq | |
| Bind IntMap | |
| Bind ((->) m) | |
| Bind (Either a) | |
| Semigroup m => Bind ((,) m) | |
| Monad m => Bind (WrappedMonad m) | |
| Ord k => Bind (Map k) | |
| (Apply m, Monad m) => Bind (ListT m) | |
| (Functor m, Monad m) => Bind (MaybeT m) | |
| Bind m => Bind (IdentityT * m) | |
| (Functor m, Monad m) => Bind (ErrorT e m) | |
| (Functor m, Monad m) => Bind (ExceptT e m) | |
| Bind m => Bind (StateT s m) | |
| Bind m => Bind (StateT s m) | |
| (Bind m, Semigroup w) => Bind (WriterT w m) | |
| (Bind m, Semigroup w) => Bind (WriterT w m) | |
| (Bind f, Bind g) => Bind (Product * f g) | |
| Bind (ContT * r m) | |
| Bind m => Bind (ReaderT * e m) | |
| (Bind m, Semigroup w) => Bind (RWST r w s m) | |
| (Bind m, Semigroup w) => Bind (RWST r w s m) | |