src/Tools/Metis/src/Ordered.sml
changeset 39348 6f9c9899f99f
child 39349 2d0a4361c3ef
equal deleted inserted replaced
39347:50dec19e682b 39348:6f9c9899f99f
       
     1 (* ========================================================================= *)
       
     2 (* ORDERED TYPES                                                             *)
       
     3 (* Copyright (c) 2004-2006 Joe Hurd, distributed under the GNU GPL version 2 *)
       
     4 (* ========================================================================= *)
       
     5 
       
     6 structure IntOrdered =
       
     7 struct type t = int val compare = Int.compare end;
       
     8 
       
     9 structure IntPairOrdered =
       
    10 struct
       
    11 
       
    12 type t = int * int;
       
    13 
       
    14 fun compare ((i1,j1),(i2,j2)) =
       
    15     case Int.compare (i1,i2) of
       
    16       LESS => LESS
       
    17     | EQUAL => Int.compare (j1,j2)
       
    18     | GREATER => GREATER;
       
    19 
       
    20 end;
       
    21 
       
    22 structure StringOrdered =
       
    23 struct type t = string val compare = String.compare end;