Proposal: add fusion RULES for Data.Map.mapMaybe

Akio Takano tkn.akio at
Wed Nov 20 07:40:53 UTC 2013


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.

I ran some benchmarks, testing cases where fusion does and does not happen:

The benchmark code is:

Discussion period: 2 weeks.

Thank you,
Takano Akio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-fusion-RULES-for-mapMaybe.patch
Type: text/x-patch
Size: 922 bytes
Desc: not available
URL: <>

More information about the Libraries mailing list