Commit 415f0d6c authored by Evan Hauck's avatar Evan Hauck Committed by Austin Seipp

Refactored by Simon Marlow's suggestion

Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 47024b63
......@@ -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)
......
Markdown is supported
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