From 022fc24719ba4b98b8d9f19bfe7f75dd0f19d585 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Tue, 21 Aug 2007 12:15:16 +0000 Subject: [PATCH] Small rearrangements --- compiler/ghci/InteractiveUI.hs | 2 +- compiler/main/InteractiveEval.hs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 5c5e9c1..d7de940 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -667,7 +667,7 @@ getCurrentBreakModule = do (r:rs) -> do let ix = GHC.resumeHistoryIx r if ix == 0 - then return (GHC.breakInfo_module `fmap` GHC.resumeBreakInfo r) + then return (GHC.breakInfo_module `liftM` GHC.resumeBreakInfo r) else do let hist = GHC.resumeHistory r !! (ix-1) return $ Just $ GHC.getHistoryModule hist diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 901dd63..3173278 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -132,7 +132,7 @@ data History historyApStack :: HValue, historyBreakInfo :: BreakInfo, historyEnclosingDecl :: Name - -- ^^ A cache of the enclosing declaration, for convenience + -- ^^ A cache of the enclosing top level declaration, for convenience } mkHistory :: HscEnv -> HValue -> BreakInfo -> History @@ -153,9 +153,10 @@ getHistorySpan hsc_env hist = Just hmi -> modBreaks_locs (md_modBreaks (hm_details hmi)) ! num _ -> panic "getHistorySpan" +-- | Finds the enclosing top level function name findEnclosingDecl :: HscEnv -> Module -> SrcSpan -> Name findEnclosingDecl hsc_env mod span = - case lookupUFM (hsc_HPT hsc_env) (moduleName mod) of + case lookupUFM (hsc_HPT hsc_env) (moduleName mod) of Nothing -> panic "findEnclosingDecl" Just hmi -> let globals = typeEnvIds (md_types (hm_details hmi)) -- 1.7.10.4