Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2002-04-03 09:45:14 by simonpj] · f2f40c0f
    Simon Peyton Jones authored
    -----------------------------
    	Put existential tyvars second
    	[fixes ParsecPerm lint error]
    	-----------------------------
    
    In an existential data constr:
    
    	data Eq a => T a = forall b. Ord b => MkT a [b]
    
    the type of MkT is
    
    	MkT :: forall a b . Ord b => a -> [b] -> MkT a
    
    Note that the existential tyvars (b in this case) come *after*
    the "ordinary" tyvars.
    
    I had switched this around earlier in the week, but I'm putting
    it back (and fixing a bug) because I found it really works better second.
    
    Reason: in a case expression we may find:
    	case (e :: T t) of { MkT b (d:Ord b) (x:t) (xs:[b]) -> ... }
    It's convenient to apply the rep-type of MkT to 't', to get
    	forall b. Ord b => ...
    and use that to check the pattern.  Mind you, this is really only
    use in CoreLint.
    f2f40c0f