@@ -42,6 +42,7 @@ import Control.Ether.Tagged (Taggable(..), Tagged(..))
4242import GHC.Generics (Generic)
4343import qualified Control.Newtype as NT
4444
45+import qualified Control.Monad.Base as MB
4546import qualified Control.Monad.Trans.Control as MC
4647import qualified Control.Monad.Trans.Writer.Lazy as Trans
4748
@@ -77,11 +78,19 @@ newtype WriterT tag w m a = WriterT (Trans.WriterT w m a)
7778
7879instance NT.Newtype (WriterT tag w m a)
7980
81+instance (Monoid w, MB.MonadBase b m) => MB.MonadBase b (WriterT tag w m) where
82+ liftBase = MB.liftBaseDefault
83+
8084instance Monoid w => MC.MonadTransControl (WriterT tag w) where
8185 type StT (WriterT tag w) a = MC.StT (Trans.WriterT w) a
8286 liftWith = MC.defaultLiftWith NT.pack NT.unpack
8387 restoreT = MC.defaultRestoreT NT.pack
8488
89+instance (Monoid w, MC.MonadBaseControl b m) => MC.MonadBaseControl b (WriterT tag w m) where
90+ type StM (WriterT tag w m) a = MC.ComposeSt (WriterT tag w) m a
91+ liftBaseWith = MC.defaultLiftBaseWith
92+ restoreM = MC.defaultRestoreM
93+
8594type instance Lift.StT (WriterT tag w) a = MC.StT (WriterT tag w) a
8695
8796instance Monoid w => Lift.LiftLocal (WriterT tag w) where
@@ -97,8 +106,8 @@ instance Monoid w' => Lift.LiftPass (WriterT tag w') where
97106 liftPass = Lift.defaultLiftPass NT.pack NT.unpack
98107
99108instance Monoid w => Lift.LiftCallCC (WriterT tag w) where
100− liftCallCC = Lift.defaultLiftCallCC WT runWT
101− liftCallCC' = Lift.defaultLiftCallCC WT runWT
109+ liftCallCC = Lift.defaultLiftCallCC NT.pack NT.unpack
110+ liftCallCC' = Lift.defaultLiftCallCC NT.pack NT.unpack
102111
103112instance Taggable (WriterT tag w m) where
104113 type Tag (WriterT tag w m) = 'Just tag