diff --git a/Control/Monad/Error/Class.hs b/Control/Monad/Error/Class.hs index 93e3af3..956d90c 100644 --- a/Control/Monad/Error/Class.hs +++ b/Control/Monad/Error/Class.hs @@ -218,7 +218,7 @@ tryError action = (Right <$> action) `catchError` (pure . Left) -- -- @since 2.3 withError :: MonadError e m => (e -> e) -> m a -> m a -withError f action = tryError action >>= either (throwError . f) pure +withError f = handleError (throwError . f) -- | As 'handle' is flipped 'Control.Exception.catch', 'handleError' -- is flipped 'catchError'.