On Fri, Dec 9, 2022 at 1:57 PM Marc Nieper-Wißkirchen <marc.nie...@gmail.com>
wrote:

> \



>
> I agree that the perfect terminology hasn't been found.
>

There is no such thing as perfect terminology: it is all arbitrary or
imprecise or both.  "The price of infinite precision is infinite verbosity."

> one for setoids, one for totally ordered setoids, and one for setoids
> with a hash function (with forgetful functors from the latter two to
> the first).
>

I think this is the wrong analysis.  If there is no equality predicate,
then there is no meaningful comparator at all: it makes no sense to ask
"Does electron A come before electron B?" given that electrons lack
identity.  So we have two properties and therefore four cases: neither
orderable nor hashable, orderable   but not hashable, hashable but
not orderable, and both hashable and orderable.

The reason for setting up the Comparator typeclass as I did is that most
Scheme objects are both orderable and hashable (with the usual exceptions
of procedures, ports, etc), although the order is not necessarily a
semantically meaningful order.  In many cases, such as B-trees, it doesn't
matter what the order is as long as there is one.  The same is true of hash
functions mutatis mutandis.  So all the cases except "orderable and
hashable" are more or less degenerate.  So ather than burdening users with
the necessity of specifying an ordering predicate and/or a hash function
that aren't going to be useful in their particular use cases, I allow them
to specify simply #f and then throw an error if that is inadequate.

I hope this is helpful.

Reply via email to