Skip to content
  • Simon Peyton Jones's avatar
    The Core type-matcher should look through PredTypes · 366e402d
    Simon Peyton Jones authored
    The core type-matcher Unify.match was previouly using tcView to expand
    types, because it must treat newtypes as distinct from their representation.
    But that meant that it also treated the PredType {C Int} as distinct from
    its representation type (:TC Int).  And that in turn was causing a rule
    not to fire, because the argument types didn't match up.
    
    For this to happen we need to get a situation where we have
    
      a = :DC blah blah	-- Dictionary
      ....(f a).....
    
    Now a has type (:TC Int), bu the RULE for f expects an argument 
    of type {C Int}.  Roman found that just this was happening.
    
    
    
    366e402d