Skip to content
  • Simon Peyton Jones's avatar
    Allow associated types to have fresh parameters · d2d6bdae
    Simon Peyton Jones authored
    This patch allows
    
         class C a where
           type T a b :: *
         instance C Int
           type T Int b = b -> b
    
    That is, T has a type index 'b' that is not one of the class
    variables.
    
    On the way I did a good deal of refactoring (as usual), especially in
    TcInstDcls.tcLocalInstDecl1, which checks for consistent instantiation
    of the class instance and the type instance.  Less code, more
    expressiveness.  See Note [Checking consistent instantiation]
    d2d6bdae