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

GHC ghc-devs at haskell.org
Wed Oct 4 09:38:38 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 simonpj):

 But the LHS of the rule does ''not'' mention a type family, so comment:3
 is irrelevant to this particular ticket.  Here is the rule:
 {{{
 ==================== Tidy Core rules ====================
 "vinr/0"
     forall (@ (as :: [*])).
       vinr @ '[] @ as
       = (vinr0 @ as)
         `cast` (<Length '[]>_R
                 ->_R <VSum as>_R
                 ->_R (VSum (Sym (D:R:++[0] <as>_N)))_R
                 :: Coercible
                      (Length '[] -> VSum as -> VSum as)
                      (Length '[] -> VSum as -> VSum ('[] ++ as)))
 }}}
 The trouble is that type family appears in the term we are matching the
 rule against.  And it appears in the form `Remove 'Z '[Int]`.  We can
 reduce that to `'[]`, which matches the rule.  But we don't: hence my
 suggestions in comment:2.

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


More information about the ghc-tickets mailing list