{-# LANGUAGE MultiParamTypeClasses #-}

module Control.Monad.RWS.Lazy.Wiring() where

import Control.Monad.Wiring
import Control.Monad.RWS.Lazy

instance (Wirable w1 w2, Wirable r1 r2, Functor f) => Wirable (RWST r2 w1 s f a) (RWST r1 w2 s f a) where
  wire = withRWST (\r -> \s -> (wire r, s)) . mapRWST (fmap (\(a, s, w) -> (a, s, wire w)))