Add builtin rule to eliminate unnecessary casts in seq
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 4 Nov 2009 23:30:14 +0000 (23:30 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 4 Nov 2009 23:30:14 +0000 (23:30 +0000)
commitad9239172c453e4244de8eccc172e2c679766ea5
treeddf34fed2b27487af39266146456a0ab03dcc1ce
parentc01e472e205f09e6cdadc1c878263998f637bc8d
Add builtin rule to eliminate unnecessary casts in seq

The patch adds this rule:

  seq (x `cast` co) y = seq x y

This is subject to the usual treatment of seq rules. It also makes them
match more often: it will rewrite

  seq (f x `cast` co) y = seq (f x) y

and allow a seq rule for f to match.
compiler/basicTypes/MkId.lhs
compiler/simplCore/Simplify.lhs