Commits

Anonymous committed 626c7e1

+tnum

  • Participants
  • Parent commits 6d8369c

Comments (0)

Files changed (2)

File src/cd_All.ml

   (module Int : TFULL with type t = int);
 value tstring = Typeinfo.tfull_of_tmod_full
   (module Strings.TCommon : TFULL with type t = string);
+value tnum = Typeinfo.tfull_of_tmod_full
+  (module Num : TFULL with type t = Num.t);
 
 module Cd = Cadastr;

File src/cd_Num.ml

 
     include Num;
 
+    type t = num;
+
     value zero = num_of_int 0;
 
+
+
+    open Cd_Typeinfo;
+    open Cdt;
+
+    value show = string_of_num;
+    value hash = Typeinfo.perv_hash;
+    value eq = eq_num;
+    value cmp a b =
+      match compare_num a b with
+      [ 0 -> EQ
+      | x when x < 0 -> LT
+      | _ (* when _ > 0 *) -> GT
+      ];
+    value opt_show = show;
+    value opt_hash = hash;
+    value opt_eq = eq;
+    value opt_cmp = cmp;
+
   end
 ;