[project @ 2003-06-03 22:26:44 by diatchki]
[ghc-base.git] / Control / Monad / X / Types.hs
1 module Control.Monad.X.Types where
2
3 import Control.Monad(MonadPlus(..))
4
5 newtype ReaderT r m a = R { unR :: r -> m a }
6 newtype WriterT w m a = W { unW :: m (a, w) }
7 newtype StateT s m a  = S { unS :: s -> m (a,s) }
8 newtype ErrorT e m a  = E { unE :: m (Either e a) }
9 newtype NondetT m a   = N { unN :: m (T m a) }
10 newtype ResumeT m a   = Re { unRe :: m (Res m a) }
11 newtype ContT r m a   = C { unC :: (a -> m r) -> m r }
12
13 data T m a            = Empty | Cons a (NondetT m a)
14 data Res m a          = Value a | Delay (ResumeT m a)
15
16