[GHC] #8595: add fusion RULES for mapMaybe

GHC ghc-devs at haskell.org
Wed Dec 4 10:29:17 UTC 2013


#8595: add fusion RULES for mapMaybe
------------------------------------+-------------------------------------
       Reporter:  akio              |             Owner:
           Type:  feature request   |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  libraries/base    |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Currently mapMaybe does not fuse at all. The attached patch implements
 necessary rules for fold/build fusion in both sides (the result and the
 second argument) to happen. When fusion does not happen, the function
 should behave exactly the same as before.

 This proposal has gone through a discussion in the libraries mailing list:

 http://www.haskell.org/pipermail/libraries/2013-November/021640.html

 [Note that the subject of the e-mail thread is wrong, it should mention
 "Data.Maybe.mapMaybe", not "Data.Map.mapMaybe"]

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8595>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list