[GHC] #5462: Deriving clause for arbitrary classes

GHC ghc-devs at haskell.org
Fri Sep 26 14:55:07 UTC 2014


#5462: Deriving clause for arbitrary classes
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:  dreixel
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  ⊥
              Priority:  normal      |          Version:  7.2.1
             Component:  Compiler    |         Keywords:  Generics
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  #7346
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Well, I was imagining that you would simply reduce the constraints using
 whatever instances are in scope, just like when inferring the type of a
 top-level definition.

 However, now I see that this falls apart in the presence of non-uniform
 recursion. Quite annoying... but in this case there seems to potentially
 be a genuine choice involved, so it might be sensible to just reject
 "deriving" then and require the user to write their own instance head.

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


More information about the ghc-tickets mailing list