{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
module Control.Monad.Foil.Relative where
import Control.Monad.Foil
import Data.Kind (Type)
class RelMonad (f :: S -> Type) (m :: S -> Type) where
rreturn :: f a -> m a
rbind :: Distinct b => Scope b -> m a -> (f a -> m b) -> m b
liftRM :: (RelMonad f m, Distinct b) => Scope b -> (f a -> f b) -> m a -> m b
liftRM :: forall (f :: S -> *) (m :: S -> *) (b :: S) (a :: S).
(RelMonad f m, Distinct b) =>
Scope b -> (f a -> f b) -> m a -> m b
liftRM Scope b
scope f a -> f b
f m a
m = Scope b -> m a -> (f a -> m b) -> m b
forall (b :: S) (a :: S).
Distinct b =>
Scope b -> m a -> (f a -> m b) -> m b
forall (f :: S -> *) (m :: S -> *) (b :: S) (a :: S).
(RelMonad f m, Distinct b) =>
Scope b -> m a -> (f a -> m b) -> m b
rbind Scope b
scope m a
m (f b -> m b
forall (a :: S). f a -> m a
forall (f :: S -> *) (m :: S -> *) (a :: S).
RelMonad f m =>
f a -> m a
rreturn (f b -> m b) -> (f a -> f b) -> f a -> m b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. f a -> f b
f)