#if __GLASGOW_HASKELL__ < 710
#endif
module Control.Monad.Ether.Except.Class
( MonadExcept(..)
) where
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, e ~ e') => MonadExcept tag e (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)