[GHC] #12422: Add decidable equality class

GHC ghc-devs at haskell.org
Fri Jul 22 14:50:57 UTC 2016


#12422: Add decidable equality class
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  8.0.1
      Resolution:                    |             Keywords:
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 Iceland_jack):

 Quick thought, is it possible to create a heterogeneous version of
 `TestEquality` that supports

 {{{#!hs
 eqTyCon :: forall (k1 k2 :: *).
            forall (a :: k1) (b :: k2).
            TTyCon <k1> a -> TTyCon <k2> b -> Maybe (a :~~: b)
 }}}

 Replacing `Maybe (a :~: b)` with `Maybe (a :~~: b)` would still constraint
 the kinds, would we need

 {{{#!hs
 class HTestEquality f1 f2 where
   htestEquality :: f1 a -> f2 b -> Maybe (a :~~: b)
 }}}

 ----

 Discussed on `#ghc`, what would break if we made `:~:` heterogeneous?

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


More information about the ghc-tickets mailing list