[MLton-user] Extended Basis Library: Partial order concept
Geoffrey Alan Washburn
geoffw at cis.upenn.edu
Thu May 3 12:04:21 PDT 2007
I just spent a couple minutes fiddling with a revision to the
ORDERED concept to introduce partial orders. I do not really care for
the names I am using here, but I was not sure whether it would be
desirable to have types and signatures with names as long as
»partially_ordered« or »TOTALLY_ORDERED_EX«.
Index: ../ext-basis/public/concept/ordered.sig
===================================================================
--- ../ext-basis/public/concept/ordered.sig (revision 5543)
+++ ../ext-basis/public/concept/ordered.sig (working copy)
@@ -21,29 +21,47 @@
*)
end
-signature ORDERED_EX = sig
- type ordered_ex
+(** == POrdered ==
+ *
+ * A pordered type implements a partial order.
+ *)
- val < : ordered_ex BinPr.t
- (** {i < j} returns {true} iff {i} is less than {j}. *)
+signature PORDERED_CORE = sig
+ type pordered
- val <= : ordered_ex BinPr.t
+ val <= : pordered BinPr.t
(** {i <= j} returns {true} iff {i} is less than or equal to {j}. *)
+end
- val > : ordered_ex BinPr.t
+signature PORDERED_EX = sig
+ type pordered_ex
+
+ val < : pordered_ex BinPr.t
+ (** {i < j} returns {true} iff {i} is less than {j}. *)
+
+ val > : pordered_ex BinPr.t
(** {i > j} returns {true} iff {i} is greater than {j}. *)
- val >= : ordered_ex BinPr.t
+ val >= : pordered_ex BinPr.t
(** {i >= j} returns {true} iff {i} is greater than or equal to {j}. *)
+end
- val max : ordered_ex BinOp.t
+signature TORDERED_EX = sig
+ type tordered_ex
+
+ val max : tordered_ex BinOp.t
(** Returns the larger of the arguments. *)
- val min : ordered_ex BinOp.t
+ val min : tordered_ex BinOp.t
(** Returns the smaller of the arguments. *)
end
signature ORDERED = sig
- include ORDERED_CORE EQUALITY ORDERED_EX
- sharing type ordered = equality = ordered_ex
+ include ORDERED_CORE PORDERED_CORE EQUALITY PORDERED_EX TORDERED_EX
+ sharing type ordered = pordered = equality = pordered_ex = tordered_ex
end
+
+signature PORDERED = sig
+ include PORDERED_CORE EQUALITY PORDERED_EX
+ sharing type pordered = equality = pordered_ex
+end
--
[Geoff Washburn|geoffw at cis.upenn.edu|http://www.cis.upenn.edu/~geoffw/]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20070503/de559d7e/attachment.html
More information about the MLton-user
mailing list