GHC unexpectedly refines explicit kind signatures
The following program should be rejected by the type checker:
{-# LANGUAGE PolyKinds, FunctionalDependencies, MultiParamTypeClasses #-}
class MonoidalCCC (f :: x -> y) (d :: y -> y -> *) | f -> d where
ret :: d a (f a)
Instead it is accepted, but the kind variables specified above are 'corrected' during typechecking to:
>>> :browse
class MonoidalCCC (f :: x -> x) (d :: x -> x -> *) | f -> d where
ret :: d a (f a)
This may be similar in root cause to issue #9200 (closed), but there a valid program is rejected, and here an invalid program is accepted, so the fixes may be quite different.
It seems these kind variables are just being allowed to unify rather than being checked for subsumption.
Trac metadata
Trac field | Value |
---|---|
Version | 7.8.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | ekmett |
Operating system | |
Architecture |