[GHC] #15052: DeriveAnyClass instances may skip TypeError constraints

GHC ghc-devs at haskell.org
Wed Apr 18 14:18:29 UTC 2018


#15052: DeriveAnyClass instances may skip TypeError constraints
-------------------------------------+-------------------------------------
        Reporter:  jcpetruzza        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:
                                     |  CustomTypeErrors
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 jcpetruzza):

 I'm not sure I see why this would be a breaking change. In this last
 example (which is the important one, the original was an
 oversimplification, we can disregard it), why would these two be any
 different:
 {{{#!haskell
 data TS = TSL | TSR  deriving (Gen.Generic, C)
 }}}

 vs

 {{{#!haskell
 data TS = TSL | TSR  deriving (Gen.Generic)
 instance C TS
 }}}

 The latter fails, IIUC, because we are trying to see if the default
 signature of `f` in `C` applies to `TS`, and this forces the reduction of
 `GC (Rep TS)`, that eventually leads to the `TypeError`. This is the
 standard behaviour.

 Am I mistaken in thinking that these two declarations should be
 equivalent?

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


More information about the ghc-tickets mailing list