From 8284fd0f929d6be825756cb3dd90a90f008004ad Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 15 Feb 2005 12:41:26 +0000 Subject: [PATCH] [project @ 2005-02-15 12:41:26 by simonmar] omit the initial foralls for :type, unless -fglasgow-exts is on --- ghc/compiler/compMan/CompManager.lhs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index c48784e..5bb0a98 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -78,10 +78,11 @@ import ErrUtils ( showPass ) import SysTools ( cleanTempFilesExcept ) import BasicTypes ( SuccessFlag(..), succeeded ) import StringBuffer ( hGetStringBuffer ) +import Type ( dropForAlls ) import Util import Outputable import Panic -import CmdLineOpts ( DynFlags(..) ) +import CmdLineOpts ( DynFlags(..), dopt ) import Maybes ( expectJust, orElse, mapCatMaybes ) import FiniteMap @@ -409,12 +410,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 -- 1.7.10.4