[MLton-user] Extended Basis Library: Partial order concept
Vesa Karvonen
vesa.a.j.k at gmail.com
Tue May 8 08:43:31 PDT 2007
On 5/8/07, Geoffrey Alan Washburn <geoffw at cis.upenn.edu> wrote:
[...]
> While shorter is usually better, I'm not sure I agree in this case. At
> least I hypothesize that most times that someone would want to define a
> partial order, they would find it more natural to define it in terms of a
> reflexive, transitive, anti-symmetric relation, rather than a transitive,
> anti-symmetric relation. For example, in one of my several structures that
> admits a partial order (but not a total order) is an ordering based upon
> subset inclusion. Therefore, I could define
>
> val op <= = Set.isSubset
>
> instead of
>
> fun x < y = Set.isSubset (x, y) andalso not (Set.==(x, y))
>
> furthermore in some cases equality will be defined in terms of <= and
> therefore writing something like the above may be a little awkward.
Those are good points and I have to agree that <= is probably the better
alternative for the partial order concept. Indeed, the table in my previous
message doesn't apply to this case. I apparently made it under the
assumption of a total order.
-Vesa Karvonen
More information about the MLton-user
mailing list