
#9434: GHC.List.reverse does not fuse -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: | Version: 7.9 libraries/base | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Runtime | Blocked By: performance bug | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): Replying to [comment:8 nomeata]:
AT least for `filter p . reverse`, couldn’t you rewrite it to `reverse . filter p` if that is for whatever reason better? Seems to be a nice small optimization (though, like many of them, probably of little practical relevance.)
Unfortunately, that changes semantics. `filter (==1) (reverse [undefined,1,2]) = 1:undefined` but `reverse (filter (==1) [undefined,1,2]) = undefined` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9434#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler