[GHC] #9858: Typeable instances should be kind-aware
GHC
ghc-devs at haskell.org
Wed Jan 28 17:17:45 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:30 simonpj]:
> * And the kinds would have to be included in the fingerprint of the
`TyCon` generated by the standalone derived instance.
Once you have the mechanism for getting a kind representation to put in
the fingerprint, how much harder is it to just make it work
polymorphically while you're at it?
I'm not a GHC developer by any means, but I still had the hunch that this
could be a main stumbling block to getting the proper solution working.
> The "right" solution is, I think, at the bottom of comment:20. But NB
that solution will mean that all these standalone derived instances would
become illegal, so there is a backward compatibility cost. The drastic
solution does not have this problem.
If *all* types later become `Typeable` automatically, then wouldn't it be
safe and backward compatible to just ignore the explicit instances with a
redundancy warning?
(I've occasionally been thinking that multiple derived instances for the
same type and class should often be safely compatible with each other. If
made by the same mechanism, they're guaranteed to have the same code,
after all. Although I guess standalone deriving with explicit restricted
type signature could complicate that.)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9858#comment:32>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list