[GHC] #7688: :kind should do kind generalisation
GHC
cvs-ghc at haskell.org
Thu Feb 14 12:01:17 CET 2013
#7688: :kind should do kind generalisation
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Suppose you load this into GHCi:
{{{
{-# LANGUAGE PolyKinds #-}
module Test where
data Proxy (t::k) = Proxy
}}}
Now you use `:kind` to see the kind of `Proxy`:
{{{
ghci> :k Proxy
Proxy :: * -> *
}}}
It is true that `Proxy` has that kind but it has a more polymorphic kind,
and that's the one we'd like to see.
The trouble is this. `Proxy` really does have a polymorphic kind.
However, `:kind` takes a '''type''' (not a type constructor) as its
argument, so you can say
{{{
:kind (Maybe Int)
}}}
for example. So as usual we instantiate `Proxy` with fresh kind variables
-- '''BUT''' `:kind` does not do kind generalisation, so we get a
monomorphic instance. (And we default unbound kind variables to `*`.
Conclusion: `:kind` should do kind-generalisation.
See also #7586
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7688>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list