on master help sign in
add some necessary instances for KatipContextT
commit620eaf3a0c4d65d4ed920ac530915faf59b5b960 authorMichael Xavier <michael@michaelxavier.net> dateWed 2 Mar 2016, 08:57 (11 years ago) parentcd42405
1 file changed+16
katip/src/Katip/Monadic.hs+16
katip/src/Katip/Monadic.hs+16
@@ -40,6 +40,7 @@ import Control.Monad.Error.Class
4040import Control.Monad.IO.Class
4141import Control.Monad.Reader
4242import Control.Monad.State
43+import Control.Monad.Trans.Control
4344import Control.Monad.Trans.Either (EitherT)
4445import Control.Monad.Trans.Except (ExceptT)
4546import Control.Monad.Trans.Identity (IdentityT)
@@ -228,6 +229,21 @@ data KatipContextTState = KatipContextTState {
228229 , ltsNamespace :: !Namespace
229230 }
230231
232+
233+instance MonadTransControl KatipContextT where
234+ type StT KatipContextT a = StT (ReaderT KatipContextTState) a
235+ liftWith = defaultLiftWith KatipContextT unKatipContextT
236+ restoreT = defaultRestoreT KatipContextT
237+ {-# INLINE liftWith #-}
238+ {-# INLINE restoreT #-}
239+
240+
241+instance (MonadBaseControl b m) => MonadBaseControl b (KatipContextT m) where
242+ type StM (KatipContextT m) a = ComposeSt KatipContextT m a
243+ liftBaseWith = defaultLiftBaseWith
244+ restoreM = defaultRestoreM
245+
246+
231247-- Reader is a passthrough. We don't expose our internal reader so as not to conflict
232248instance (MonadReader r m) => MonadReader r (KatipContextT m) where
233249 ask = lift ask