-- | Wrap the base monad in 'RWS.RWST'
rwsC
  :: (Monad m, Monad (t1 (RWS.RWST t w t2 m)), MonadTrans t1,
      Monoid w, MFunctor t1) =>
     (t -> t2 -> t1 m (b, t2, w)) -> t1 (RWS.RWST t w t2 m) b
rwsC k = do
    i <- lift RWS.ask
    s <- lift RWS.get
    (r, s', w) <- hoist lift (k i s)
    lift $ do
        RWS.put s'
        RWS.tell w
    return r

rwsC
  :: (Monad m, Monad (t1 (RWS.RWST t w t2 m)), MonadTrans t1,
      Monoid w, MFunctor t1) =>
     (t -> t2 -> t1 m (b, t2, w)) -> t1 (RWS.RWST t w t2 m) b
rwsC k = do
    i <- lift RWS.ask
    s <- lift RWS.get
    (r, s', w) <- hoist lift (k i s)
    lift $ do
        RWS.put s'
        RWS.tell w
    return r

rwsC k = do
    i <- lift RWS.ask
    s <- lift RWS.get
    (r, s', w) <- hoist lift (k i s)
    lift $ do
        RWS.put s'
        RWS.tell w
    return r
