PolyKinds results in incorrect reporting of type synonym parameter count
The following program is invalid because the declaration of f
doesn't fully apply App
to all of its arguments.
{-# LANGUAGE PolyKinds #-}
type App f a = f a
newtype X f a = X (f a)
f :: f a -> X (App f) a
f = X
However, with the PolyKinds
extension, the error reporting is quite weird:
Type synonym ‘App’ should have 4 arguments, but has been given 3
In the type signature for ‘f’: f :: f a -> X (App f) a
App
has two arguments, and I gave it one! I'm guessing that PolyKinds
makes GHC supply some implicit parameters during expansion of type synonyms, and that's what gets reported in the error message. The behaviour is correct without PolyKinds
.
I've tested this on GHC 7.8.3 (the Haskell Platform version) on my 64-bit OSX Yosemite system.