These algorithms are still useful, and make sense, for Dictionary
and Set
, because those types have a defined ordering over multiple passes of the same instance. There are many algorithms that involve walking through a collection, and slicing it up in different ways, for a purpose that makes sense for a Set
or a Dictionary
as much as for anything else, and an implementation might make use of these methods.
There are other examples of a similar nature elsewhere. For example, finding the "minimum" value of a String
doesn't "make sense" (especially given the way ASCII ordering works), but it still has a min
method because Character
is Comparable
. This doesn't mean we need to invent a Minmaxable
protocol out of fear that someone might be confused by the presence of min
and max
on String
.