X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FcompMan%2FCompManager.lhs;h=829664d2a74fa4ec57820253c9476b710061a977;hb=8e67f5502e2e316245806ee3735a2f41a844b611;hp=c48784ec951f42526e45cae31e6ceeb1960c255d;hpb=7c49d9d44e742ac8f6c22b504b46d127193d7e1a;p=ghc-hetmet.git diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index c48784e..829664d 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -61,8 +61,7 @@ import HscMain ( newHscEnv ) import DriverState ( v_Output_file, v_NoHsMain, v_MainModIs ) import DriverPhases ( HscSource(..), isHsBoot, hscSourceString, isHaskellSrcFilename ) import Finder ( findModule, findLinkable, addHomeModuleToFinder, - flushFinderCache, findPackageModule, - mkHomeModLocation, FindResult(..), cantFindError ) + flushFinderCache, mkHomeModLocation, FindResult(..), cantFindError ) import HscTypes ( ModSummary(..), HomeModInfo(..), ModIface(..), msHsFilePath, HscEnv(..), GhciMode(..), InteractiveContext(..), emptyInteractiveContext, @@ -88,6 +87,7 @@ import FiniteMap import DATA_IOREF ( readIORef ) #ifdef GHCI +import Finder ( findPackageModule ) import HscMain ( hscGetInfo, GetInfoResult, hscStmt, hscTcExpr, hscKcType ) import HscTypes ( TyThing(..), icPrintUnqual, showModMsg ) import TcRnDriver ( mkExportEnv, getModuleContents ) @@ -96,13 +96,13 @@ import RdrName ( GlobalRdrEnv, plusGlobalRdrEnv ) import Name ( Name ) import NameEnv import Id ( idType ) -import Type ( tidyType ) +import Type ( tidyType, dropForAlls ) import VarEnv ( emptyTidyEnv ) import Linker ( HValue, unload, extendLinkEnv ) import GHC.Exts ( unsafeCoerce# ) import Foreign import Control.Exception as Exception ( Exception, try ) -import CmdLineOpts ( DynFlag(..), dopt_unset ) +import CmdLineOpts ( DynFlag(..), dopt_unset, dopt ) #endif import EXCEPTION ( throwDyn ) @@ -409,12 +409,17 @@ cmTypeOfExpr cmstate expr case maybe_stuff of Nothing -> return Nothing - Just ty -> return (Just res_str) + Just ty -> return (Just (showSDocForUser unqual doc)) where - res_str = showSDocForUser unqual (text expr <+> dcolon <+> ppr tidy_ty) + doc = text expr <+> dcolon <+> ppr final_ty unqual = icPrintUnqual (cm_ic cmstate) tidy_ty = tidyType emptyTidyEnv ty - + dflags = hsc_dflags (cm_hsc cmstate) + -- if -fglasgow-exts is on we show the foralls, otherwise + -- we don't. + final_ty + | dopt Opt_GlasgowExts dflags = tidy_ty + | otherwise = dropForAlls tidy_ty ----------------------------------------------------------------------------- -- cmKindOfType: returns a string representing the kind of a type