| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.Foil.Relative
Documentation
class RelMonad (f :: S -> Type) (m :: S -> Type) where Source #
Relative monads, restricted to types indexed by scopes in kind S.
Methods
rreturn :: forall (a :: S). f a -> m a Source #
Relative version of return.
rbind :: forall (b :: S) (a :: S). Distinct b => Scope b -> m a -> (f a -> m b) -> m b Source #
Relative version of >>=.
Note the two special additions to the usual definition of a relative binding operation:
is added since is corresponds to the runtime counterpart of the type parameterScopebb.constraint helps to ensure we only work with scopes that are distinct.Distinctb
Technically, it is also possible add similar components for a parameter.
Also, we could probably treat types in S as singletons and extract distinct scopes that way,
preserving the more general type signature for rbind.