
#7611: Rewrite rules application prevented by type variable application (map id vs. map (\x -> x)) -----------------------------+---------------------------------------------- Reporter: nomeata | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.1 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- 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. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7611 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler