@@ -1,4 +1,5 @@
11{-# LANGUAGE CPP #-}
2+{-# LANGUAGE TemplateHaskell #-}
23
34module Control.EnvT
45 ( EnvT(..)
@@ -18,7 +19,6 @@ import Control.Monad.Trans.Control
1819import Control.Monad.Trans.Resource
1920import Control.Monad.Zip
2021#ifndef ghcjs_HOST_OS
21−import Control.Lens.Missing
2222import Katip
2323import Katip.Monadic
2424#endif
@@ -56,6 +56,14 @@ runEnvT :: forall r m a. EnvT r m a -> r -> m a
5656runEnvT m r = flip runReaderT r . unEnvT $ m
5757
5858#ifndef ghcjs_HOST_OS
59+-- FIXME: These lens should probably be moved into a separate package
60+-- or sent to upstream katip.
61+makeLensesFor
62+ [ ("ltsLogEnv", "_ltsLogEnv")
63+ , ("ltsContext", "_ltsContext")
64+ , ("ltsNamespace", "_ltsNamespace")
65+ ] ''KatipContextTState
66+
5967instance (Has KatipContextTState r, MonadIO m)
6068 => KatipContext (EnvT r m) where
6169 getKatipContext = view $ part . _ltsContext