added datatype order;
authorwenzelm
Mon, 13 Jan 1997 18:20:35 +0100
changeset 2506 965127966331
parent 2505 50abca9d4043
child 2507 d290b91e76b8
added datatype order;
src/Pure/library.ML
--- a/src/Pure/library.ML	Mon Jan 13 13:20:32 1997 +0100
+++ b/src/Pure/library.ML	Mon Jan 13 18:20:35 1997 +0100
@@ -5,7 +5,7 @@
 
 Basic library: functions, options, pairs, booleans, lists, integers,
 strings, lists as sets, association lists, generic tables, balanced trees,
-input / output, timing, filenames, misc functions.
+orders, input / output, timing, filenames, misc functions.
 *)
 
 infix |> ~~ \ \\ orelf ins ins_string ins_int orf andf prefix upto downto
@@ -689,6 +689,22 @@
 
 
 
+(** orders **)
+
+datatype order = LESS | EQUAL | GREATER;
+
+fun intord (i, j: int) =
+  if i < j then LESS
+  else if i = j then EQUAL
+  else GREATER;
+
+fun stringord (a, b: string) =
+  if a < b then LESS
+  else if a = b then EQUAL
+  else GREATER;
+
+
+
 (** input / output **)
 
 val cd = OS.FileSys.chDir;