jstolarek / ghc

Mirror of ghc repository. DO NOT SUBMIT PULL REQUESTS HERE
http://www.haskell.org/ghc/
Other
0 stars 0 forks source link

Type family not injective in a RHS type variable #93

Closed jstolarek closed 9 years ago

jstolarek commented 9 years ago

What happens if I say:

type family F a b = r | r -> a where
    F Int b = b

? Here b is not declared as injective but is mentioned in the RHS.

jstolarek commented 9 years ago

Ok, I think if a user does not claim injectivity in an argument we should not allow it in the RHS.

jstolarek commented 9 years ago

Fix should go to unusedInjTvsInRHS - it should calculate both kinds of tyvars at the same time and return two sets.

jstolarek commented 9 years ago

Need to update Note [Injectivity check....]

jstolarek commented 9 years ago

I think this is unnecessary.