[GHC] #14840: QuantifiedConstraints: Can't define class alias

GHC ghc-devs at haskell.org
Sat Feb 24 00:40:14 UTC 2018


#14840: QuantifiedConstraints: Can't define class alias
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.5
      Resolution:  fixed             |             Keywords:
                                     |  QuantifiedConstraints wipT2893
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by Iceland_jack):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 Thanks! And comment:1 works with tricks but probably isn't much use once
 defined

 {{{#!hs
 class    (a => b) => (a |- b)
 instance (a => b) => (a |- b)

 class    (forall xx. f xx |- g xx) => f |~ g
 instance (forall xx. f xx |- g xx) => f |~ g

 class    (forall xx. f xx |- exists) => Exists1 f exists
 instance (forall xx. f xx |- exists) => Exists1 f exists

 class    exists => Exists2 f exists
 instance exists => Exists2 f exists

 class    (Exists1 f |~ Exists2 f) => Exists (f::k -> Constraint) where
 instance (Exists1 f |~ Exists2 f) => Exists (f::k -> Constraint) where
 }}}

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


More information about the ghc-tickets mailing list