[commit: ghc] master: Refactored by Simon Marlow's suggestion (415f0d6)
git at git.haskell.org
git at git.haskell.org
Thu Dec 5 04:00:13 UTC 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/415f0d6cb716b68318dad1af4e9ab6ec13844136/ghc
>---------------------------------------------------------------
commit 415f0d6cb716b68318dad1af4e9ab6ec13844136
Author: Evan Hauck <khyperia at live.com>
Date: Thu Nov 28 11:58:50 2013 -0500
Refactored by Simon Marlow's suggestion
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
415f0d6cb716b68318dad1af4e9ab6ec13844136
ghc/InteractiveUI.hs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 024aa2d..be97bc0 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -694,10 +694,8 @@ runCommands' eh sourceErrorHandler gCmd = do
case b of
Nothing -> return ()
Just success -> do
- let nextCommand = runCommands' eh sourceErrorHandler gCmd
- case sourceErrorHandler of
- Just handler | success == False -> lift handler >> nextCommand
- _ -> nextCommand
+ when (not success) $ maybe (return ()) lift sourceErrorHandler
+ runCommands' eh sourceErrorHandler gCmd
-- | Evaluate a single line of user input (either :<command> or Haskell code)
runOneCommand :: (SomeException -> GHCi Bool) -> InputT GHCi (Maybe String)
More information about the ghc-commits
mailing list