
2 Nov
2007
2 Nov
'07
1:40 p.m.
Iavor Diatchki wrote:
Hi, I have always wondered about the usefulness of the "withKey" functions because the key is one of the arguments that the programmer is passing anyway, so they already know its value. [...] Does anybody have other uses of the "withKey" functions? -Iavor
The WithKey-variants are used where a new value is computed from an old one and when this function also needs to consider the key. At least filterWithKey and foldWithKey are very useful.
PS: as for the bug, I would just fix it (i.e., send a patch)
Which implementation do you consider buggy? IntMap or Map? (or may just document it as inconsistent) Cheers Christian