[GHC] #2600: Bind type variables in RULES

GHC ghc-devs at haskell.org
Sat Oct 27 23:45:13 UTC 2018


#2600: Bind type variables in RULES
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  simonpj
            Type:  feature request   |               Status:  closed
        Priority:  lowest            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  6.8.3
      Resolution:  fixed             |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  rename/should_compile/T2600
      Blocked By:                    |             Blocking:
 Related Tickets:  #2110             |  Differential Rev(s):  Phab:D4894
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mayac):

 It's worth mentioning that this has not been ''completely'' addressed. The
 following is now accepted:
 {{{
 {-# RULES

 "myrule" forall t a. forall f x.
      from (tmap f (to x :: t a)) = map f (from (to x :: t a))
   #-}

 }}}
 but, as per #10595, it does not behave as one would expect – the rules
 `"Class op tmap"` and `"Class op to"` may fire first. See that ticket for
 the appropriate workaround.

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


More information about the ghc-tickets mailing list