Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
class RelMonad (f :: S -> Type) (m :: S -> Type) where Source #
Relative monads, restricted to types indexed by scopes in kind S
.
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 parameterScope
bb
.
constraint helps to ensure we only work with scopes that are distinct.Distinct
b
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
.