[commit: ghc] master: Improve the desugaring of RULE left-hand-sides (fixes Trac #8848) (41ba7cc)

git at git.haskell.org git at git.haskell.org
Tue Mar 25 14:17:00 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/41ba7ccb742278de0abf32cb7571c71b150997a3/ghc

>---------------------------------------------------------------

commit 41ba7ccb742278de0abf32cb7571c71b150997a3
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Mar 25 14:12:59 2014 +0000

    Improve the desugaring of RULE left-hand-sides (fixes Trac #8848)
    
    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


>---------------------------------------------------------------

41ba7ccb742278de0abf32cb7571c71b150997a3
 compiler/deSugar/DsBinds.lhs                       |  149 +++++++++++++-------
 .../tests/simplCore/should_compile/simpl016.stderr |    2 +-
 2 files changed, 98 insertions(+), 53 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 41ba7ccb742278de0abf32cb7571c71b150997a3


More information about the ghc-commits mailing list