src/Tools/Metis/src/Ordered.sml
author blanchet
Mon, 13 Sep 2010 21:11:59 +0200
changeset 39349 2d0a4361c3ef
parent 39348 6f9c9899f99f
child 39353 7f11d833d65b
permissions -rw-r--r--
change license, with Joe Hurd's permission
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
39348
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     1
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     2
(* ORDERED TYPES                                                             *)
39349
2d0a4361c3ef change license, with Joe Hurd's permission
blanchet
parents: 39348
diff changeset
     3
(* Copyright (c) 2004-2006 Joe Hurd, distributed under the BSD License       *)
39348
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     4
(* ========================================================================= *)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     5
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     6
structure IntOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     7
struct type t = int val compare = Int.compare end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     8
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
     9
structure IntPairOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    10
struct
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    11
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    12
type t = int * int;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    13
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    14
fun compare ((i1,j1),(i2,j2)) =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    15
    case Int.compare (i1,i2) of
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    16
      LESS => LESS
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    17
    | EQUAL => Int.compare (j1,j2)
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    18
    | GREATER => GREATER;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    19
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    20
end;
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    21
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    22
structure StringOrdered =
6f9c9899f99f new version of the Metis files
blanchet
parents:
diff changeset
    23
struct type t = string val compare = String.compare end;