Commits

Anonymous committed a622105

monoid instances for int

Comments (0)

Files changed (1)

     value compare = Pervasives.compare;
   end
 ;
+
+
+value monoid_plus : Monoid.t int =
+  object
+    method zero = 0;
+    method plus = ( + );
+  end
+;
+
+value monoid_mult : Monoid.t int =
+  object
+    method zero = 1;
+    method plus = ( * );
+  end
+;
+
+value monoid_mult : Monoid.t int =
+  object
+    method zero = 1;
+    method plus = ( * );
+  end
+;
+
+value monoid_land : Monoid.t int =
+  object
+    method zero = -1;  (* all 1 bits *)
+    method plus = ( land );
+  end
+;
+
+value monoid_lor : Monoid.t int =
+  object
+    method zero = 0;
+    method plus = ( lor );
+  end
+;