Commits

Dmitry Grebeniuk  committed 60b896c

+ Bool + tbool

  • Participants
  • Parent commits 57a20c8

Comments (0)

Files changed (5)

   Path:       src
   BuildTools: ocamlbuild
   BuildDepends: num
-  Modules:    Cadastr, Monoid, Cd_All, Cd_Int, Cd_List, Cd_Ops, Cd_Byte, Cd_Bytes, Cd_Chars, Cd_Strings, Cd_Array, Cd_Typeinfo, Cdt, Cd_Types, Cd_Option, Cd_Num, Cd_Tuples
+  Modules:    Cadastr, Monoid, Cd_All, Cd_Int, Cd_List, Cd_Ops, Cd_Byte, Cd_Bytes, Cd_Chars, Cd_Strings, Cd_Array, Cd_Typeinfo, Cdt, Cd_Types, Cd_Option, Cd_Num, Cd_Tuples, Cd_Bool
 
 Executable tests
   Path:       test
 (* setup.ml generated for the first time by OASIS v0.2.1~alpha1 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 5d6b1d3192cb6c3d2e7a6cd1766fad83) *)
+(* DO NOT EDIT (digest: 5bb6db20dc826ac6d349df0135f5437c) *)
 (*
    Regenerated by OASIS v0.2.1~alpha1
    Visit http://oasis.forge.ocamlcore.org for more information and
                            "Cd_Types";
                            "Cd_Option";
                            "Cd_Num";
-                           "Cd_Tuples"
+                           "Cd_Tuples";
+                           "Cd_Bool"
                         ];
                       lib_internal_modules = [];
                       lib_findlib_parent = None;

File src/cadastr.mllib

 # OASIS_START
-# DO NOT EDIT (digest: c8b74514ad972dea912da42fc7f04cd1)
+# DO NOT EDIT (digest: 5457f9b62e6982fd87096d6215b6073e)
 Cadastr
 Monoid
 Cd_All
 Cd_Option
 Cd_Num
 Cd_Tuples
+Cd_Bool
 # OASIS_STOP

File src/cd_All.ml

 module Array = Cd_Array.Array;
 module Typeinfo = Cd_Typeinfo.Typeinfo;
 module Num = Cd_Num.Num;
+module Bool = Cd_Bool.Bool;
 include Cd_Tuples;
 
 include Cd_Ops;
   (module Strings.TCommon : TFULL with type t = string);
 value tnum = Typeinfo.tfull_of_tmod_full
   (module Num : TFULL with type t = Num.t);
+value tbool = Typeinfo.tfull_of_tmod_full
+  (module Bool : TFULL with type t = Bool.t);
 
 module Cd = Cadastr;

File src/cd_Bool.ml

+module Bool
+ =
+  struct
+
+    type t = bool;
+
+
+    open Cdt;
+
+    value cmp a b =
+      match (a, b) with
+      [ (False, False) | (True, True) -> EQ
+      | (False, True) -> LT
+      | (True, False) -> GT
+      ]
+    ;
+
+    value eq a b =
+      match (a, b) with
+      [ (False, False) | (True, True) -> True
+      | (False, True) | (True, False) -> False
+      ]
+    ;
+
+    value hash a = if a then 1 else 0
+    ;
+
+    value show = fun [ True -> "True" | False -> "False" ]
+    ;
+
+    value opt_cmp = cmp
+      and opt_eq = eq
+      and opt_hash = hash
+      and opt_show = show
+    ;
+
+
+    value monoid_or = new Monoid.t False ( || )
+    ;
+
+    value monoid_and = new Monoid.t True ( && )
+    ;
+
+  end
+;