RE: RULES map (\x -> x) = id

2013-01-18 Thread Simon Peyton-Jones
glasgow-haskell-users- | boun...@haskell.org] On Behalf Of Joachim Breitner | Sent: 17 January 2013 10:24 | To: glasgow-haskell-users@haskell.org | Subject: RULES map (\x -> x) = id | | Hi, | | I am experimenting with rewrite rules, but found that they do not fire as often as I | wan

RULES map (\x -> x) = id

2013-01-17 Thread Joachim Breitner
Hi, I am experimenting with rewrite rules, but found that they do not fire as often as I wanted them. Here is a small example: module MapId where myMap f [] = [] myMap f (x:xs) = f x : myMap f xs {-# RULES "map id" myMap id = id #-} {-# RU