[GHC] #9858: Typeable instances should be kind-aware

GHC ghc-devs at haskell.org
Fri Feb 6 15:52:43 UTC 2015


#9858: Typeable instances should be kind-aware
-------------------------------------+-------------------------------------
        Reporter:  dreixel           |                   Owner:  dreixel
            Type:  bug               |                  Status:  new
        Priority:  highest           |               Milestone:  7.10.1
       Component:  Compiler          |                 Version:  7.9
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by oerjan):

 Replying to [comment:55 goldfire]:
 > Again, I don't see the ambiguity, and I think GHC would be able to infer
 this type without trouble... I don't see how this is a special case,
 really.

 With that example, I've mostly been convinced that constraints separating
 out kinds aren't necessary.

 I still think it would help backwards compatibility if kinds in `Typeable`
 contexts defaulted to `*` in situations exactly analogous to when types
 with numerical contexts do.

 Once again, int-e's test case is illustrative:

 {{{
 main :: IO ()
 main = print (typeRep (Proxy :: Proxy Proxy))
 }}}

 As far as I understand, without the type signature a solver would infer a
 type of

 {{{
 main :: Typeable (Proxy :: k -> *) => IO ()
 }}}

 and by defaulting `k` to `*` the code would still work, and probably do
 what was originally intended.  Without defaulting it seems to me that it
 cannot work either with or without a signature.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9858#comment:57>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list