@@ -1,7 +1,10 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2module Text.Pandoc.Compat.Except ( ExceptT
2module Text.Pandoc.Compat.Except ( ExceptT
3 , Error(..)
4 , Error(..)
4 , runExceptT
5 , runExceptT
5 , throwError
8 , throwError
6 , catchError )
9 , catchError )
@@ -18,10 +21,17 @@ class Error a where
20import Control.Monad.Error
23import Control.Monad.Error
24+import Control.Monad.Identity (Identity, runIdentity)
21type ExceptT = ErrorT
26type ExceptT = ErrorT
28+type Except s a = ErrorT s Identity a
23−runExceptT :: ExceptT e m a -> m (Either e a)
30+runExceptT :: ExceptT e m a -> m (Either e a)
24runExceptT = runErrorT
31runExceptT = runErrorT
33+runExcept :: ExceptT e Identity a -> Either e a
34+runExcept = runIdentity . runExceptT