| Copyright | (c) 2020 Edwin Westbrook |
|---|---|
| License | BSD3 |
| Maintainer | westbrook@galois.com |
| Stability | experimental |
| Portability | GHC |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Binding.Hobbits.MonadBind
Description
This module defines monads that are compatible with the notion of
name-binding, where a monad is compatible with name-binding iff it can
intuitively run computations that are inside name-bindings. More formally, a
binding monad is a monad with an operation mbM that commutes name-binding
with the monadic operations, meaning:
'mbM' ('nuMulti' $ \ns -> 'return' a) == 'return' ('nuMulti' $ \ns -> a)
'mbM' ('nuMulti' $ \ns -> m >>= f)
== 'mbM' ('nuMulti' $ \ns -> m) >>= \mb_x ->
'mbM' (('nuMulti' $ \ns x -> f x) `'mbApply'` mb_x)Documentation
class Monad m => MonadBind m where Source #
The class of name-binding monads
Instances
| MonadBind Maybe Source # | |
Defined in Data.Binding.Hobbits.MonadBind | |
| MonadBind Identity Source # | |
Defined in Data.Binding.Hobbits.MonadBind | |
| MonadBind m => MonadBind (ReaderT r m) Source # | |
Defined in Data.Binding.Hobbits.MonadBind | |
| (MonadBind m, BindState s) => MonadBind (StateT s m) Source # | |
Defined in Data.Binding.Hobbits.MonadBind | |
class MonadBind m => MonadStrongBind m where Source #
A version of MonadBind that does not require a NuMatching instance on
the element type of the multi-binding in the monad
Instances
| MonadStrongBind Identity Source # | |
| MonadStrongBind m => MonadStrongBind (ReaderT r m) Source # | |
| (MonadStrongBind m, BindState s) => MonadStrongBind (StateT s m) Source # | |