[GHC] #12708: RFC: Representation polymorphic Num

GHC ghc-devs at haskell.org
Fri Oct 14 23:31:02 UTC 2016


#12708: RFC: Representation polymorphic Num
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                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):

 {{{#!hs
 instance Eq (MutVar# s a) where
   (==) :: MutVar# s a -> MutVar# s a -> Bool
   a == b = isTrue# (sameMutVar# a b)

 instance Eq (MVar# s a) where
   (==) :: MVar# s a -> MVar# s a -> Bool
   a == b = isTrue# (sameMVar# a b)

 instance Eq (TVar# s a) where
   (==) :: TVar# s a -> TVar# s a -> Bool
   a == b = isTrue# (sameTVar# a b)

 instance Eq (StableName# a) where
   (==) :: StableName# a -> StableName# a -> Bool
   a == b = isTrue# (eqStableName# a b)
 }}}

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


More information about the ghc-tickets mailing list