There’s a ticket about this, SI-4776 (by YT).
The commit that introduces it has this to say:
Following a suggestion of jrudolph, made
filterKeys
andmapValues
transform abstract maps, and duplicated functionality for immutable
maps. Movedtransform
andfilterNot
from immutable to general maps.
Review by phaller.
I have not been able to find the original suggestion by jrudolph, but I assume it was done to make mapValues
more efficient. Give the question, that may come as a surprise, but mapValues
is more efficient if you are not likely to iterate over the values more than once.
As a work-around, one can do mapValues(...).view.force
to produce a new Map
.