[GHC] #15507: Deriving with QuantifiedConstraints is unable to penetrate type families

GHC ghc-devs at haskell.org
Sun Aug 12 11:12:57 UTC 2018


#15507: Deriving with QuantifiedConstraints is unable to penetrate type families
-------------------------------------+-------------------------------------
        Reporter:  isovector         |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:
      Resolution:  duplicate         |             Keywords:
                                     |  QuantifiedConstraints
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14860            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * status:  new => closed
 * resolution:   => duplicate
 * related:   => #14860


Comment:

 Alas, this is expected behavior. See #14860.

 On GHC HEAD, you'll get a more informative error message, at least:

 {{{
 GHCi, version 8.7.20180806: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling QuantifiedConstraints ( Bug.hs, interpreted )

 Bug.hs:20:19: error:
     • Illegal type synonym family application in instance: HKD f a
     • In the quantified constraint ‘forall a. Eq a => Eq (HKD f a)’
       In the stand-alone deriving instance for
         ‘(forall a. Eq a => Eq (HKD f a)) => Eq (Foo f)’
    |
 20 | deriving instance (forall a. Eq a => Eq (HKD f a)) => Eq (Foo f)
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list