From 006bb4c15e01c1521f10d1e74cea70c82363b502 Mon Sep 17 00:00:00 2001 From: "iavor.diatchki@gmail.com" Date: Fri, 25 May 2007 16:43:08 +0000 Subject: [PATCH] refactor: combine repeated code in file reloading --- compiler/ghci/InteractiveUI.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 74133dd..98baccd 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -868,17 +868,12 @@ checkModule m = do afterLoad (successIf (isJust result)) session reloadModule :: String -> GHCi () -reloadModule "" = do - io (revertCAFs) -- always revert CAFs on reload. - discardActiveBreakPoints - session <- getSession - doLoad session LoadAllTargets - return () reloadModule m = do io (revertCAFs) -- always revert CAFs on reload. discardActiveBreakPoints session <- getSession - doLoad session (LoadUpTo (GHC.mkModuleName m)) + doLoad session $ if null m then LoadAllTargets + else LoadUpTo (GHC.mkModuleName m) return () doLoad session howmuch = do -- 1.7.10.4