git.iko.soy/typeable/pandoc
on master help sign in
Except Compat: Updated to export more module functions
commitb57e554b59236eab7c9298b4b5bf6d32e5d7cda8 authorMatthew Pickering <matthewtpickering@gmail.com> dateWed 30 Jul 2014, 00:48 (12 years ago) parent089745a
1 file changed+11−1
src/Text/Pandoc/Compat/Except.hs+11−1
src/Text/Pandoc/Compat/Except.hs+11−1
@@ -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