Commit 1fb6f880 authored by judah's avatar judah
Browse files

Avoid shadowing `handlers` variable in `catches`

Manual merge from git.haskell.org/packages/haskeline.git
Original patch by Herbert Valerio Riedel <hvr@gnu.org>
parent 0ef9364f
......@@ -106,12 +106,12 @@ handle = flip catch
catches :: (MonadException m) => m a -> [Handler m a] -> m a
catches act handlers = controlIO $ \(RunIO run) ->
let catchesHandler handlers e = foldr tryHandler (E.throw e) handlers
let catchesHandler e = foldr tryHandler (E.throw e) handlers
where tryHandler (Handler handler) res =
case E.fromException e of
Just e' -> run $ handler e'
Nothing -> res
in E.catch (run act) (catchesHandler handlers)
in E.catch (run act) catchesHandler
data Handler m a = forall e . Exception e => Handler (e -> m a)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment