X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FInteractiveUI.hs;h=143fb6afd99523efd2b10d1e53d24ced193bad75;hb=a271ad7e6d2b92779a63ab1cc88bc95dc17d6981;hp=a686e436904ce1dd6ae5b62ca9d3a578f3ae849e;hpb=8e67f5502e2e316245806ee3735a2f41a844b611;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index a686e43..143fb6a 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,6 +1,6 @@ {-# OPTIONS -#include "Linker.h" #-} ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.191 2005/02/25 13:07:10 simonpj Exp $ +-- $Id: InteractiveUI.hs,v 1.193 2005/03/08 09:47:43 simonpj Exp $ -- -- GHC Interactive User Interface -- @@ -18,7 +18,7 @@ import CompManager import HscTypes ( GhciMode(..) ) import IfaceSyn ( IfaceDecl(..), IfaceClassOp(..), IfaceConDecls(..), IfaceConDecl(..), IfaceType, - IfaceInst(..), pprIfaceDeclHead, pprParendIfaceType, + pprIfaceDeclHead, pprParendIfaceType, pprIfaceForAllPart, pprIfaceType ) import FunDeps ( pprFundeps ) import DriverFlags @@ -509,7 +509,7 @@ info s = do { let names = words s vcat (intersperse (text "") (map (showThing exts) stuff)))) } showThing :: Bool -> GetInfoResult -> SDoc -showThing exts (wanted_str, (thing, fixity, src_loc, insts)) +showThing exts (wanted_str, thing, fixity, src_loc, insts) = vcat [ showWithLoc src_loc (showDecl exts want_name thing), show_fixity fixity, vcat (map show_inst insts)] @@ -520,8 +520,8 @@ showThing exts (wanted_str, (thing, fixity, src_loc, insts)) | fix == defaultFixity = empty | otherwise = ppr fix <+> text wanted_str - show_inst (iface_inst, loc) - = showWithLoc loc (ptext SLIT("instance") <+> ppr (ifInstHead iface_inst)) + show_inst (inst_ty, loc) + = showWithLoc loc (ptext SLIT("instance") <+> ppr inst_ty) showWithLoc :: SrcLoc -> SDoc -> SDoc showWithLoc loc doc @@ -598,9 +598,11 @@ showDecl exts want_name (IfaceData {ifName = tycon, showDecl exts want_name (IfaceClass {ifCtxt = context, ifName = clas, ifTyVars = tyvars, ifFDs = fds, ifSigs = sigs}) = hang (ptext SLIT("class") <+> pprIfaceDeclHead context clas tyvars - <+> pprFundeps fds <+> ptext SLIT("where")) + <+> pprFundeps fds <+> opt_where) 2 (vcat (ppr_trim show_op sigs)) where + opt_where | null sigs = empty + | otherwise = ptext SLIT("where") show_op (IfaceClassOp op dm ty) | want_name clas || want_name op = Just (ppr_bndr op <+> dcolon <+> showType exts ty)