module Control.Monad.Ether.Except
(
MonadExcept(..)
, Except
, runExcept
, ExceptT
, exceptT
, runExceptT
, handleT
, handle
) where
import Control.Monad.Ether.Except.Class
import Control.Monad.Trans.Ether.Except hiding (throw, catch)
import Data.Functor.Identity (Identity(..))
handle :: proxy tag -> (e -> a) -> Except tag e a -> a
handle t h m = runIdentity (handleT t h m)
handleT :: Functor m => proxy tag -> (e -> a) -> ExceptT tag e m a -> m a
handleT t h m = fmap (either h id) (runExceptT t m)