
#10978: Anonymous type instances -------------------------------------+------------------------------------- Reporter: benjamin.hodgson | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.8.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): Replying to [comment:3 nomeata]:
Because type families are not injective and generative, you cannot specify a type family in a class instance head.
Would it be possible to allow type families in instance heads if they reduce to something that is allowed, akin to `TypeSynonymInstances`?
This has been suggested before but was discarded as a bad idea. There's some useful conversation on the ticket... but I can't find the ticket! Short story: this would be akin to allowing term-level function definitions like `foo (not True) = 5`. If we reduce `not True`, we'll get `False`, and this definition is perfectly sound. But it's terrible, nonetheless. If you could find the ticket, I'd be grateful. But I really did try. :( -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10978#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler