Small rearrangements
authorPepe Iborra <mnislaih@gmail.com>
Tue, 21 Aug 2007 12:15:16 +0000 (12:15 +0000)
committerPepe Iborra <mnislaih@gmail.com>
Tue, 21 Aug 2007 12:15:16 +0000 (12:15 +0000)
compiler/ghci/InteractiveUI.hs
compiler/main/InteractiveEval.hs

index 5c5e9c1..d7de940 100644 (file)
@@ -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
index 901dd63..3173278 100644 (file)
@@ -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))