1. Dmitry Grebeniuk
  2. cadastr

Commits

Dmitry Grebeniuk  committed ace8611

+ Monoid.ext

  • Participants
  • Parent commits 952c979
  • Branches default

Comments (0)

Files changed (1)

File src/monoid.ml

View file
  • Ignore whitespace
    (see Cd_String.String.monoid_concat for example).
  *)
 
+open Cd_Ops;
+
 class t ['a] z p =
   object
     method zero : 'a = z;
     method plus : 'a -> 'a -> 'a = p;
   end
 ;
+
+class ext ['i, 'a, 'o] inj z p proj =
+  object
+    inherit t ['a] z p;
+    method inj : 'i -> 'a = inj;
+    method proj : 'a -> 'o = proj;
+  end
+;
+
+class id_extend ['a] (mon : t 'a) =
+  ext ['a, 'a, 'a] identity mon#zero mon#plus identity
+;