The Core type-matcher should look through PredTypes
authorsimonpj@microsoft.com <unknown>
Wed, 16 Jan 2008 14:59:39 +0000 (14:59 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 16 Jan 2008 14:59:39 +0000 (14:59 +0000)
commit366e402db492b57c193b8d1173bdafa7e350438d
tree8666d5711dbefa777c0ff3623401481f6c1783e5
parentdecb48fcf5d82c1abeb8b729dc9c955d0051194a
The Core type-matcher should look through PredTypes

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.
compiler/types/Unify.lhs