Seemingly inappropriate "expecting one more argument" error in polykinded class
Triggered by the following code:
{-# LANGUAGE PolyKinds, GADTs #-}
data Proxy a
class Foo a where
foo :: a ~ f i => Proxy (Foo f)
GHC writes:
test.hs:6:34:
Expecting one more argument to `f'
In the type `a ~ f i => Proxy (Foo f)'
In the class declaration for `Foo'
It seems to me that given Foo :: forall k. k -> Constraint, Proxy :: forall k. k -> *, a :: k, f :: k1 -> k, that Foo in Proxy (Foo f) should be instantiated at k1 -> k, and Proxy at Constraint, and that this should work.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |