[GHC] #13733: Simplify constraints on RULES LHS

GHC ghc-devs at haskell.org
Mon May 22 22:00:00 UTC 2017


#13733: Simplify constraints on RULES LHS
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.3
      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 simonpj):

 > user cannot even specify the desired rule,

 Certainly you can!
 {{{
 isntance Eq T where
   (==) = eqT

 eqT :: T -> T -> T
 {-# NOINLINE [1] eqT #-}
 {-# RULES eqT x x = True #-}
 }}}
 All fine!

 I have no clear understanding of what you are proposing.  Perhaps you can
 lay it out? What's wrong with the approach I suggest?  It seems simple and
 direct.  Really the only thing that's tricky here is that the "class-op
 rules" are built-in so you can't control their competition with rules you
 want to write.

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


More information about the ghc-tickets mailing list