We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 577aecb + 6cde979 commit f3bb5d7Copy full SHA for f3bb5d7
Control/Monad/Error/Class.hs
@@ -218,7 +218,7 @@ tryError action = (Right <$> action) `catchError` (pure . Left)
218
--
219
-- @since 2.3
220
withError :: MonadError e m => (e -> e) -> m a -> m a
221
-withError f action = tryError action >>= either (throwError . f) pure
+withError f = handleError (throwError . f)
222
223
-- | As 'handle' is flipped 'Control.Exception.catch', 'handleError'
224
-- is flipped 'catchError'.
0 commit comments