Skip to content
  • Simon Peyton Jones's avatar
    Improve the desugaring of RULE left-hand-sides (fixes Trac #8848) · 41ba7ccb
    Simon Peyton Jones authored
    I've added detailed comments with
      Note [Decomposing the left-hand side of a RULE]
    
    The result is a noticeable improvement.  Previously
    
     * we rejected a perfectly decent SPECIALISE (Trac #8848)
    
     * and for something like
          f :: (Eq a) => b -> a -> a
          {-# SPECIALISE f :: b -> [Int] -> [Int] #-}
       we ended up with
          RULE  f ($fdEqList $dfEqInt) = f_spec
       whereas we wanted
          RULES forall (d:Eq [Int]). f d = f_spec
    41ba7ccb