[GHC] #12422: Add decidable equality class

GHC ghc-devs at haskell.org
Fri Jul 22 02:23:14 UTC 2016


#12422: Add decidable equality class
-------------------------------------+-------------------------------------
           Reporter:  dfeuer         |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Core           |           Version:  8.0.1
  Libraries                          |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Currently, we have a `TestEquality` class

 {{{#!hs
 class TestEquality f where
   testEquality :: f a -> f b -> Maybe (a :~: b)
 }}}

 It would be nice to add a class for fully decidable equality. There are a
 few options, but this one gets to the point rather quickly:

 {{{#!hs
 data EqDec a b where
   NotEqual :: (forall c . a :~: b -> c) -> EqDec a b
   Equal :: EqDec a a

 class DecEq f where
   decEq :: f a -> f b -> EqDec a b
 }}}

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


More information about the ghc-tickets mailing list