Replaces
collection.map(f).flatten(m)
with
collection.flatMap
if possible.