from Data.Functor.Identity import :: Identity
 from Data.Monoid import class Monoid, class Semigroup
 
+// The RWS monad 
 :: RWS r w s a :== RWST r w s Identity a
 
+rws :: (r -> s -> (a, s, w)) -> RWS r w s a
+runRWS :: (RWS r w s a) r s -> (a, s, w)
+evalRWS :: (RWS r w s a) r s -> (a, w)
+execRWS :: (RWS r w s a) r s -> (s, w)
+mapRWS :: ((a, s, w) -> (b, s, w`)) (RWS r w s a) -> RWS r w` s b
+withRWS :: (r` s -> (r, s)) (RWS r w s a) -> RWS r` w s a
+
 // The RWST monad transformer
 :: RWST r w s m a = RWST (r s -> m (a, s, w))
 
 
 import Control.Monad
 import Control.Applicative
 
+// The RWS monad 
+:: RWS r w s a :== RWST r w s Identity a
+
+rws :: (r -> s -> (a, s, w)) -> RWS r w s a
+rws f = RWST \r s->Identity $ f r s
+
+runRWS :: (RWS r w s a) r s -> (a, s, w)
+runRWS m r s = runIdentity $ runRWST m r s
+
+evalRWS :: (RWS r w s a) r s -> (a, w)
+evalRWS m r s = let (a, _, w) = runRWS m r s in (a, w)
+
+execRWS :: (RWS r w s a) r s -> (s, w)
+execRWS m r s = let (_, s`, w) = runRWS m r s in (s`, w)
+
+mapRWS :: ((a, s, w) -> (b, s, w`)) (RWS r w s a) -> RWS r w` s b
+mapRWS f m = mapRWST (Identity o f o runIdentity) m
+
+withRWS :: (r` s -> (r, s)) (RWS r w s a) -> RWS r` w s a
+withRWS f m = withRWST f m
 
 // The RWST monad transformer
 :: RWST r w s m a = RWST (r s -> m (a, s, w))