To my >> People say, that the transformations like x - x -> 0 :: Integer >> are hardly ever applicable, because x may occur `undefined'. Fergus Henderson <[EMAIL PROTECTED]> writes > This issue was already resolved -- someone already mentioned the solution. > But obviously you missed it, so let me restate the answer: instead of > using the transformation > > x - x ==> 0 > > you should use the transformation > > x - x ==> x `seq` 0 >> Probably, the compiler can prove "defined" very often. > Indeed. It can then simplify things further, using the rule > > x `seq` e ==> e if x is not _|_ How nice. Thank you. To my mind, this consideration shows the wide applicability of rewrite rules in compiling of functional programs. Just what i tried to prove. ------------------ Sergey Mechveliani [EMAIL PROTECTED]
