[GHC] #9123: Emit quantified Coercible constraints in GeneralizedNewtypeDeriving

GHC ghc-devs at haskell.org
Thu Jun 28 05:01:07 UTC 2018


#9123: Emit quantified Coercible constraints in GeneralizedNewtypeDeriving
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler (Type    |              Version:  7.8.2
  checker)                           |             Keywords:  Roles,
      Resolution:                    |  QuantifiedConstraints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:  quantified-
                                     |  constraints/T9123{,a}
      Blocked By:  15290             |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Perhaps comment:63 is right. Would it be worth special-casing role-related
 quantified constraints in GND? These would be easy to spot -- you just
 look for a type variable used as an argument to another type variable. So
 I claim it's doable, without really inferring the constraint using GHC's
 normal inference mechanism.

 Why do I care? Because it seems putting `join` into `Monad` is a good
 idea, and GND'ing `Monad` is common, and sometimes doing so will require a
 quantified constraint. Not inferring it will cause pain for users who just
 want a `Monad` but don't want to get sucked into the roles swamp.

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


More information about the ghc-tickets mailing list