[GHC] #10335: Failure to construct superclasses in instance

GHC ghc-devs at haskell.org
Tue Apr 21 12:32:20 UTC 2015


#10335: Failure to construct superclasses in instance
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.1
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Consider
 {{{
 {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, ConstraintKinds #-}

 module Foo where

 class Eq a => C a b

 type X a = (Eq a, Show a)

 instance X a => C a [b]
 }}}
 HEAD gives
 {{{
 Foo.hs:8:10:
     Could not deduce (Eq a)
       arising from the superclasses of an instance declaration
     from the context: X a
       bound by the instance declaration at Foo.hs:8:10-23
     Possible fix: add (Eq a) to the context of the instance declaration
     In the instance declaration for ‘C a [b]’
 }}}
 This is fall-out from refactoring the silent-superclass story.  Patch
 coming.

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


More information about the ghc-tickets mailing list