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

GHC ghc-devs at haskell.org
Thu Feb 5 16:45:12 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):

 I agree with int-e that this might break some code, like his

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

 The problem is that in the old system, the `Typeable` instance is inferred
 with no need to consider the kind at all, so it becomes completely known
 at compile time.  In the new system there will be an ambiguity.  If my
 test with my mock implementation is any guide, GHC currently (well, 7.8.3)
 refuses to resolve such ambiguities.

 As I suggested in private, a case like the above might be fixed backwards-
 compatibly by making kinds in need of unavailable `Kindable` evidence
 default to `*` in a very similar way to numerical defaulting.  I suspect
 that if a user isn't providing an explicit kind signature that is the most
 likely result they want anyway.

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


More information about the ghc-tickets mailing list