diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-08-04 07:36:18 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-08-04 07:36:18 -0700 |
commit | 4630cff2a6c116f1d474f459e6e759f5ce7f2003 (patch) | |
tree | 5c52982b8f0615fadb69a0a105af9e1e60d51f25 /src/Text/Pandoc/Compat/Except.hs | |
parent | 81335df9a51740631e75614c1279634f937d650a (diff) | |
parent | cd9a5d90cbf93925db5bb9e9060ef40d05b4bfc8 (diff) | |
download | pandoc-4630cff2a6c116f1d474f459e6e759f5ce7f2003.tar.gz |
Merge branch 'epubend' of https://github.com/mpickering/pandoc into mpickering-epubend
Conflicts:
pandoc.cabal
Diffstat (limited to 'src/Text/Pandoc/Compat/Except.hs')
-rw-r--r-- | src/Text/Pandoc/Compat/Except.hs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Compat/Except.hs b/src/Text/Pandoc/Compat/Except.hs index 7f5648e7a..9ce7c0d36 100644 --- a/src/Text/Pandoc/Compat/Except.hs +++ b/src/Text/Pandoc/Compat/Except.hs @@ -1,7 +1,10 @@ {-# LANGUAGE CPP #-} module Text.Pandoc.Compat.Except ( ExceptT + , Except , Error(..) , runExceptT + , runExcept + , MonadError , throwError , catchError ) where @@ -18,10 +21,17 @@ class Error a where #else import Control.Monad.Error +import Control.Monad.Identity (Identity, runIdentity) + type ExceptT = ErrorT -runExceptT :: ExceptT e m a -> m (Either e a) +type Except s a = ErrorT s Identity a + +runExceptT :: ExceptT e m a -> m (Either e a) runExceptT = runErrorT + +runExcept :: ExceptT e Identity a -> Either e a +runExcept = runIdentity . runExceptT #endif |