@@ -5,6 +5,7 @@
55{-# LANGUAGE KindSignatures #-}
66{-# LANGUAGE MultiParamTypeClasses #-}
77{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TemplateHaskell #-}
89{-# LANGUAGE TypeFamilies #-}
910{-# LANGUAGE UndecidableInstances #-}
1011
@@ -26,7 +27,7 @@ module Control.Monad.Trans.PagerDuty
2627 , PD
2728
2829 -- * Run
29− , runAWST
30+ , runPDT
3031
3132 -- * Environment
3233 , Env
@@ -44,6 +45,7 @@ module Control.Monad.Trans.PagerDuty
4445 ) where
4546
4647import Control.Applicative
48+import Control.Lens
4749import Control.Monad.Base
4850import Control.Monad.Catch
4951import Control.Monad.Except
@@ -65,6 +67,8 @@ data Env (s :: Security) = Env
6567-- , _envLogging ::
6668 }
6769
70+makeLenses ''Env
71+
6872-- | A convenient alias for 'PDT' 'IO'.
6973type PD s = PDT s IO
7074
@@ -90,17 +94,17 @@ instance MonadBase b m => MonadBase b (PDT s m) where
9094 {-# INLINE liftBase #-}
9195
9296instance MonadTransControl (PDT s) where
93− newtype StT (PDT s) a = StTAWS
94− { unStTAWS :: StT (ExceptT Error) (StT (ReaderT (Env s)) a)
97+ newtype StT (PDT s) a = StTPD
98+ { unStTPD :: StT (ExceptT Error) (StT (ReaderT (Env s)) a)
9599 }
96100
97101 liftWith f = PDT $
98102 liftWith $ \g ->
99103 liftWith $ \h ->
100− f (liftM StTAWS . h . g . unPDT)
104+ f (liftM StTPD . h . g . unPDT)
101105 {-# INLINE liftWith #-}
102106
103− restoreT = PDT . restoreT . restoreT . liftM unStTAWS
107+ restoreT = PDT . restoreT . restoreT . liftM unStTPD
104108 {-# INLINE restoreT #-}
105109
106110instance MonadBaseControl b m => MonadBaseControl b (PDT s m) where