[GHC] #9123: Need for higher kinded roles

GHC ghc-devs at haskell.org
Wed Jan 31 18:10:33 UTC 2018


#9123: Need for higher kinded roles
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       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:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I wonder if you stumbled on the solution there: perhaps processing a
 quantified constraint ''should'' proactively spit out superclass
 constraints. That is, we can imagine that `forall p q. Coercible p q =>
 Coercible (m p) (m q)` proactively produces `forall p q. Coercible p q =>
 m p ~R# m q`, based on the superclass constraint to `Coercible`.

 Note that this works nicely in general. If you have `forall x. D x => Ord
 x` and find yourself needing `Eq t`, then we can use the quantified
 constraint and reduce `Eq t` to `D t`.

 This more general solution would solve this problem here nicely, I think.
 And it just seems Right.

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


More information about the ghc-tickets mailing list