Oddity with ConstraintKinds and TypeFamilies
|Reported by:||illissius||Owned by:|
|Component:||Compiler (Type checker)||Version:||7.3|
|Operating System:||Linux||Architecture:||x86_64 (amd64)|
|Type of failure:||GHC rejects valid program||Test Case:||typecheck/should_compile/T5655|
|Related Tickets:||Differential Rev(s):|
See the attached program (not sure how to reduce it further - I don't know whether the relevant interaction is really with TypeFamilies, Rank2Types, or what).
When compiled with -DWORKAROUND, it compiles, when without, it doesn't. The difference:
#ifndef WORKAROUND ap :: (forall a. C e a => a -> r) -> e -> r #else ap :: c ~ C e => (forall a. c a => a -> r) -> e -> r #endif
(Where 'C e' is an associated type of 'e' of kind * -> Constraint.)
I sort of assumed that 'Some Type' and 'a ~ Some Type => a' would always be equivalent, but maybe I'm wrong. Feel free to mark as invalid if I am.