@@ -42,6 +42,7 @@ import Control.Ether.Tagged (Taggable(..), Tagged(..))
42import GHC.Generics (Generic)
42import GHC.Generics (Generic)
43import qualified Control.Newtype as NT
43import qualified Control.Newtype as NT
45+import qualified Control.Monad.Base as MB
45import qualified Control.Monad.Trans.Control as MC
46import qualified Control.Monad.Trans.Control as MC
46import qualified Control.Monad.Trans.Writer.Lazy as Trans
47import qualified Control.Monad.Trans.Writer.Lazy as Trans
@@ -77,11 +78,19 @@ newtype WriterT tag w m a = WriterT (Trans.WriterT w m a)
78instance NT.Newtype (WriterT tag w m a)
79instance NT.Newtype (WriterT tag w m a)
81+instance (Monoid w, MB.MonadBase b m) => MB.MonadBase b (WriterT tag w m) where
82+ liftBase = MB.liftBaseDefault
80instance Monoid w => MC.MonadTransControl (WriterT tag w) where
84instance Monoid w => MC.MonadTransControl (WriterT tag w) where
81 type StT (WriterT tag w) a = MC.StT (Trans.WriterT w) a
85 type StT (WriterT tag w) a = MC.StT (Trans.WriterT w) a
82 liftWith = MC.defaultLiftWith NT.pack NT.unpack
86 liftWith = MC.defaultLiftWith NT.pack NT.unpack
83 restoreT = MC.defaultRestoreT NT.pack
87 restoreT = MC.defaultRestoreT NT.pack
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
85type instance Lift.StT (WriterT tag w) a = MC.StT (WriterT tag w) a
94type instance Lift.StT (WriterT tag w) a = MC.StT (WriterT tag w) a
87instance Monoid w => Lift.LiftLocal (WriterT tag w) where
96instance Monoid w => Lift.LiftLocal (WriterT tag w) where
@@ -97,8 +106,8 @@ instance Monoid w' => Lift.LiftPass (WriterT tag w') where
97 liftPass = Lift.defaultLiftPass NT.pack NT.unpack
106 liftPass = Lift.defaultLiftPass NT.pack NT.unpack
99instance Monoid w => Lift.LiftCallCC (WriterT tag w) where
108instance Monoid w => Lift.LiftCallCC (WriterT tag w) where
100− liftCallCC = Lift.defaultLiftCallCC WT runWT
109+ liftCallCC = Lift.defaultLiftCallCC NT.pack NT.unpack
101− liftCallCC' = Lift.defaultLiftCallCC WT runWT
110+ liftCallCC' = Lift.defaultLiftCallCC NT.pack NT.unpack
103instance Taggable (WriterT tag w m) where
112instance Taggable (WriterT tag w m) where
104 type Tag (WriterT tag w m) = 'Just tag
113 type Tag (WriterT tag w m) = 'Just tag