Rewrite rules application prevented by type variable application (map id vs. map (\x -> x))
|Reported by:||nomeata||Owned by:|
|Type of failure:||Runtime performance bug||Test Case:|
|Related Tickets:||Differential Revisions:|
I’m moving the discussion from http://www.haskell.org/pipermail/glasgow-haskell-users/2013-January/023522.html (with reply at http://www.haskell.org/pipermail/glasgow-haskell-users/2013-January/023531.html) here, as a reminder for myself to work on it someday:
Short summary: a rule "map (\x -> x) = id" will not match "map id" because the latter has (in Core) an application of a type variable, despite the matcher looking through the definition of id. Doing beta-reduction (of type applications) in the matcher could fix this.
I’ll attach a test case.
Change History (8)
Changed 3 years ago by nomeata
comment:4 Changed 3 years ago by liyang
- Type of failure changed from None/Unknown to Runtime performance bug
- Version changed from 7.6.1 to 7.6.2