[GHC] #5462: Deriving clause for arbitrary classes

GHC ghc-devs at haskell.org
Thu Oct 16 14:03:56 UTC 2014


#5462: Deriving clause for arbitrary classes
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:  dreixel
                  Type:  feature     |           Status:  new
  request                            |        Milestone:  7.10.1
              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 sjoerd_visscher):

 From the wiki page: "We could try to figure this out in a clever way from
 the definition of the class being derived, but this is very hard in
 general." Why is this very hard in general? If I leave out the context in
 `instance MyClass (MyDatatype a)` then GHC will complain that it is
 missing `MyClass a`. So can't we use the type checker to give us the
 required context?

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


More information about the ghc-tickets mailing list