Not so relevant for map
s, but for fold
s note that using a signature such as:
val fold : 'val t -> 'acc -> f:(key -> 'val -> 'acc -> 'acc) -> 'acc
yields stronger type-based disambiguation power for the the definition of f
if it is written as a lambda, as compared to:
val fold : (key -> 'val -> 'acc -> 'acc) -> 'val t -> 'acc -> 'acc
So labeling f
and placing it as the last argument gives stronger disambiguation power from the type-checker and allows reordering the arguments at call sites to either enable piping, or to put the lambda last which is generally more readable in cases where it is long compared to the other arguments.
Related questions come up not and again, see e.g. here.