[GHC] #15810: Kind inference error in classes
GHC
ghc-devs at haskell.org
Fri Nov 23 16:26:16 UTC 2018
#15810: Kind inference error in classes
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5305
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Hmph. Given
{{{
class C a where
meth :: Proxy (a :: k)
}}}
where is the implicit forall for that `k`? Currently it's quantifed at
the `::`, thus:
{{{
class C a where
meth :: forall k. Proxy (a :: k)
}}}
And indeed that is ill-typed, and elicits
{{{
T15810.hs:9:18: error:
• Expected kind ‘k’, but ‘a’ has kind ‘k0’
• In the first argument of ‘Proxy’, namely ‘(a :: k)’
In the type signature: meth :: Proxy (a :: k)
}}}
If you brought `k` into scope further out it'd be fine
{{{
class C a where
meth :: Proxy (a :: k)
}}}
In short I say this is not a bug. Do you disagree?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15810#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list