[MLton-commit] r4818

Vesa Karvonen vesak at mlton.org
Mon Nov 13 09:26:09 PST 2006


Added a few basic utilities.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig

----------------------------------------------------------------------

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2006-11-13 15:09:54 UTC (rev 4817)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2006-11-13 17:26:06 UTC (rev 4818)
@@ -10,4 +10,10 @@
 structure Bool : BOOL = struct
    open Bool
    type t = bool
+   val equal = op = : bool * bool -> bool
+   val compare = fn (false,  true) => LESS
+                  | (true,  false) => GREATER
+                  | (_,         _) => EQUAL
+   fun isFalse b = b = false
+   fun isTrue b = b = true
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig	2006-11-13 15:09:54 UTC (rev 4817)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig	2006-11-13 17:26:06 UTC (rev 4818)
@@ -4,14 +4,22 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {BOOL} signature.
- *)
+(** Extended {BOOL} signature. *)
 signature BOOL = sig
    include BOOL
 
    type t = bool
-   (**
-    * Convenience alias.
-    *)
+   (** Convenience alias. *)
+
+   val isTrue : t -> t
+   (** {isTrue x = x = true} *)
+
+   val isFalse : t -> t
+   (** {isFalse x = x = false} *)
+
+   val equal : t * t -> t
+   (** Equivalent to {op =}. *)
+
+   val compare : t * t -> order
+   (** An ordering on booleans.  {false} is defined less than {true}. *)
 end




More information about the MLton-commit mailing list