patch applied (ghc): Define and use PprTyThing.pprTypeForUser

Simon Peyton Jones simonpj at microsoft.com
Thu Sep 13 11:25:45 EDT 2007


Tue Sep 11 01:51:23 PDT 2007  simonpj at microsoft.com
  * Define and use PprTyThing.pprTypeForUser
  
  When printing types for the user, the interactive UI often wants to
  leave foralls implicit.  But then (as Claus points out) we need to be
  careful about name capture. For example with this source program
  
  	class C a b where
  	  op :: forall a. a -> b
  
  we were erroneously displaying the class in GHCi (with suppressed
  foralls) thus:
  
  	class C a b where
  	  op :: a -> b
  
  which is utterly wrong. 
  
  This patch fixes the problem, removes GHC.dropForAlls (which is dangerous),
  and instead supplies PprTyThing.pprTypeForUser, which does the right thing.
  
  

    M ./compiler/ghci/InteractiveUI.hs -28 +15
    M ./compiler/main/GHC.hs -2 +2
    M ./compiler/main/PprTyThing.hs -18 +43



More information about the Cvs-ghc mailing list