X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=RWST.dcl;h=582bb0de8b3dec7e3ad276f140d0c3279effaee4;hb=f081c2c5e248331eb6e2f090f4afe818fd8259eb;hp=334df7e84ceb3180b9f6d8b3a6117acb7dc30ac3;hpb=bc9dea4b8b3d12283a6192bd688c1f2e24bd7198;p=cc1516.git diff --git a/RWST.dcl b/RWST.dcl index 334df7e..582bb0d 100644 --- a/RWST.dcl +++ b/RWST.dcl @@ -2,7 +2,7 @@ definition module RWST from Control.Applicative import class Applicative from Control.Monad import class Monad -from Data.Void import :: Void +from Control.Monad.Trans import class MonadTrans from Data.Functor import class Functor from Data.Functor.Identity import :: Identity from Data.Monoid import class Monoid, class Semigroup @@ -23,6 +23,7 @@ withRWS :: (r` s -> (r, s)) (RWS r w s a) -> RWS r` w s a instance Functor (RWST r w s m) | Monad m & Monoid w instance Applicative (RWST r w s m) | Monad m & Monoid w instance Monad (RWST r w s m) | Monad m & Monoid w +instance MonadTrans (RWST r w s) | Monoid w runRWST :: (RWST r w s m a) r s -> m (a, s, w) evalRWST :: (RWST r w s m a) r s -> m (a, w) | Monad m @@ -36,7 +37,7 @@ local :: (r -> r) (RWST r w s m a) -> RWST r w s m a | Monoid w & Monad m asks :: (r -> a) -> RWST r w s m a | Monoid w & Monad m // Writer operations -tell :: w -> RWST r w s m Void | Monoid w & Monad m +tell :: w -> RWST r w s m () | Monoid w & Monad m listen :: (RWST r w s m a) -> RWST r w s m (a, w) | Monoid w & Monad m pass :: (RWST r w s m (a, w -> w)) -> RWST r w s m a | Monoid w & Monad m listens :: (w -> b) (RWST r w s m a) -> RWST r w s m (a, b)| Monoid w & Monad m @@ -44,8 +45,8 @@ censor :: (w -> w) (RWST r w s m a) -> RWST r w s m a | Monoid w & Monad m // State operations get :: RWST r w s m s | Monoid w & Monad m -put :: s -> RWST r w s m Void | Monoid w & Monad m -modify :: (s -> s) -> RWST r w s m Void | Monoid w & Monad m +put :: s -> RWST r w s m () | Monoid w & Monad m +modify :: (s -> s) -> RWST r w s m () | Monoid w & Monad m gets :: (s -> a) -> RWST r w s m a | Monoid w & Monad m // Lifting other operations