module Parameterized.Control.Monad
( module Parameterized.Control.Applicative
, PMonad(..)
, (&>>=)
, (&>>)
, (&=<<)
, (&>=>)
, (&<=<)
) where
import Data.Kind
import Parameterized.Control.Applicative
class PApplicative m t u v => PMonad (m :: k -> Type -> Type) (t :: k) (u :: k) (v :: k) where
pbind :: PUnary m t a -> (a -> PUnary m u b) -> PUnary m v b
(&>>=) :: PMonad m t u v => PUnary m t a -> (a -> PUnary m u b) -> PUnary m v b
(&>>=) = pbind
infixl 1 &>>=
infixl 1 `pbind`
(&>>) :: PMonad m t u v => PUnary m t a -> PUnary m u b -> PUnary m v b
m &>> k = m &>>= \_ -> k
infixl 1 &>>
(&=<<) :: PMonad m t u v => (a -> PUnary m u b) -> PUnary m t a -> PUnary m v b
f &=<< x = x &>>= f
infixr 1 &=<<
(&>=>) :: (PMonad m t u v) => (a -> PUnary m t b) -> (b -> PUnary m u c) -> (a -> PUnary m v c)
f &>=> g = \x -> f x &>>= g
infixr 1 &>=>
(&<=<) :: (PMonad m t u v) => (b -> PUnary m u c) -> (a -> PUnary m t b) -> (a -> PUnary m v c)
(&<=<) = flip (&>=>)
infixr 1 &<=<