[GHC] #14279: Type families interfere with specialisation rewrite rules

GHC ghc-devs at haskell.org
Thu Oct 5 15:42:06 UTC 2017


#14279: Type families interfere with specialisation rewrite rules
-------------------------------------+-------------------------------------
        Reporter:  IvanTimokhin      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Ah yes. The unreduced type family is in the ''target'', not the rule. I
 was skimming too quickly.

 In agreement with comment:2, I argue this is very much like my new
 `flatten_args` (see Phab:D3848). GHC's flattener is a component of its
 constraint solver that essentially implements a strongly-typed rewrite
 system, where the equations of the rewrite system are 1) type family
 equations, 2) assumed equalities (e.g., from GADTs), and 3) filled-in
 metavariables. Of course, a RULE is just an equation to be used in a
 rewrite system, just the same. The problem is that the two rewrite system
 implementations are utterly distinct within GHC, where it seems like they
 should be combined somehow. And, following on from comment:2, the new
 logic in my Phab:D3848 patch would need to be applied here, too.

 Interesting. I think this is doable, but I don't think it's done lightly
 (unlike Simon's conclusion above).

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


More information about the ghc-tickets mailing list