@@ -395,9 +395,15 @@ instance (MonadIO m) => KatipContext (KatipContextT m) where
395395 localKatipNamespace f (KatipContextT m) = KatipContextT $ local (\s -> s { ltsNamespace = f (ltsNamespace s)}) m
396396
397397instance MonadUnliftIO m => MonadUnliftIO (KatipContextT m) where
398+#if MIN_VERSION_unliftio_core(0, 2, 0)
399+ withRunInIO inner = KatipContextT $ ReaderT $ \lts -> withRunInIO $ \run ->
400+ inner (run . runKatipContextT (ltsLogEnv lts) (ltsContext lts) (ltsNamespace lts))
401+#else
398402 askUnliftIO = KatipContextT $
399− withUnliftIO $ \u ->
400− pure (UnliftIO (unliftIO u . unKatipContextT))
403+ withUnliftIO $ \u ->
404+ pure (UnliftIO (unliftIO u . unKatipContextT))
405+#endif
406+
401407
402408#if MIN_VERSION_base(4, 9, 0)
403409instance MF.MonadFail m => MF.MonadFail (KatipContextT m) where
@@ -482,9 +488,15 @@ instance MonadBaseControl b m => MonadBaseControl b (NoLoggingT m) where
482488 restoreM = NoLoggingT . restoreM
483489
484490instance MonadUnliftIO m => MonadUnliftIO (NoLoggingT m) where
491+#if MIN_VERSION_unliftio_core(0, 2, 0)
492+ withRunInIO inner = NoLoggingT $ withRunInIO $ \run ->
493+ inner (run . runNoLoggingT)
494+#else
485495 askUnliftIO = NoLoggingT $
486− withUnliftIO $ \u ->
487− pure (UnliftIO (unliftIO u . runNoLoggingT))
496+ withUnliftIO $ \u ->
497+ pure (UnliftIO (unliftIO u . runNoLoggingT))
498+#endif
499+
488500
489501instance MonadIO m => Katip (NoLoggingT m) where
490502 getLogEnv = liftIO (initLogEnv "NoLoggingT" "no-logging")