@@ -139,7 +139,13 @@ runIOorExplode ma = do
140newtype PandocIO a = PandocIO {
140newtype PandocIO a = PandocIO {
141 unPandocIO :: ExceptT PandocExecutionError (StateT PandocStateIO IO) a
141 unPandocIO :: ExceptT PandocExecutionError (StateT PandocStateIO IO) a
142+ } deriving ( MonadIO
146+ , MonadState PandocStateIO
142− } deriving (MonadIO, Functor, Applicative, Monad, MonadState PandocStateIO, MonadError PandocExecutionError)
147+ , MonadError PandocExecutionError
144instance PandocMonad PandocIO where
150instance PandocMonad PandocIO where
145 lookupEnv = liftIO . IO.lookupEnv
151 lookupEnv = liftIO . IO.lookupEnv
@@ -219,7 +225,13 @@ instance E.Exception PandocExecutionError
219newtype PandocPure a = PandocPure {
225newtype PandocPure a = PandocPure {
220 unPandocPure :: ExceptT PandocExecutionError
226 unPandocPure :: ExceptT PandocExecutionError
221 (ReaderT PureEnv (State PureState)) a
227 (ReaderT PureEnv (State PureState)) a
228+ } deriving ( Functor
231+ , MonadReader PureEnv
232+ , MonadState PureState
222− } deriving (Functor, Applicative, Monad, MonadReader PureEnv, MonadState PureState, MonadError PandocExecutionError)
233+ , MonadError PandocExecutionError
224runPure :: PandocPure a -> Either PandocExecutionError a
236runPure :: PandocPure a -> Either PandocExecutionError a
225runPure x = flip evalState def $ flip runReaderT def $ runExceptT $ unPandocPure x
237runPure x = flip evalState def $ flip runReaderT def $ runExceptT $ unPandocPure x