[commit: packages/haskeline] ghc-head: Avoid shadowing `handlers` variable in `catches` (495b00b)

git at git.haskell.org git at git.haskell.org
Sat Aug 31 10:43:21 CEST 2013


Repository : ssh://git@git.haskell.org/haskeline

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/haskeline.git;a=commit;h=495b00b4f125c0b4e7f1e966cd961eae89cffdc0

>---------------------------------------------------------------

commit 495b00b4f125c0b4e7f1e966cd961eae89cffdc0
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Aug 31 10:31:52 2013 +0200

    Avoid shadowing `handlers` variable in `catches`


>---------------------------------------------------------------

495b00b4f125c0b4e7f1e966cd961eae89cffdc0
 System/Console/Haskeline/MonadException.hs |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/System/Console/Haskeline/MonadException.hs b/System/Console/Haskeline/MonadException.hs
index 31f1e1a..372557d 100644
--- a/System/Console/Haskeline/MonadException.hs
+++ b/System/Console/Haskeline/MonadException.hs
@@ -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)
 





More information about the ghc-commits mailing list