add fusion RULES for mapMaybe
|Reported by:||akio||Owned by:||nomeata|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||Blocked By:|
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:
[Note that the subject of the e-mail thread is wrong, it should mention "Data.Maybe.mapMaybe", not "Data.Map.mapMaybe"]