@@ -1,7 +1,10 @@
11{-# LANGUAGE CPP #-}
22module Text.Pandoc.Compat.Except ( ExceptT
3+ , Except
34 , Error(..)
45 , runExceptT
6+ , runExcept
7+ , MonadError
58 , throwError
69 , catchError )
710 where
@@ -18,10 +21,17 @@ class Error a where
1821
1922#else
2023import Control.Monad.Error
24+import Control.Monad.Identity (Identity, runIdentity)
25+
2126type ExceptT = ErrorT
2227
23−runExceptT :: ExceptT e m a -> m (Either e a)
28+type Except s a = ErrorT s Identity a
29+
30+runExceptT :: ExceptT e m a -> m (Either e a)
2431runExceptT = runErrorT
32+
33+runExcept :: ExceptT e Identity a -> Either e a
34+runExcept = runIdentity . runExceptT
2535#endif
2636
2737