#if __GLASGOW_HASKELL__ < 710
#endif
module Control.Monad.Ether.Except.Class
( MonadExcept(..)
) where
#if __GLASGOW_HASKELL__ < 710
import Data.Monoid
#endif
import Control.Monad.Trans.Ether.Except hiding (throw, catch)
import qualified Control.Monad.Trans.Ether.Except as E
import qualified Control.Monad.Trans.Lift.Catch as Lift
class Monad m => MonadExcept tag e m | m tag -> e where
throw :: proxy tag -> e -> m a
catch :: proxy tag -> m a -> (e -> m a) -> m a
instance Monad m => MonadExcept tag e (ExceptT tag e m) where
throw = E.throw
catch = E.catch
instance ( Lift.LiftCatch t
, Monad (t m)
, MonadExcept tag e m
) => MonadExcept tag e (t m) where
throw t = Lift.lift . throw t
catch t = Lift.liftCatch (catch t)