Commit 9c1c54c6 authored by POTTIER Francois's avatar POTTIER Francois

Defined [VisitorsRuntime.addition_monoid].

parent 4b1a673b
......@@ -15,8 +15,18 @@ let fail () =
(* A virtual base class for monoids. *)
class virtual ['z] monoid = object
method private virtual zero: 'z
method private virtual plus: 'z -> 'z -> 'z
method virtual zero: 'z
method virtual plus: 'z -> 'z -> 'z
end
(* -------------------------------------------------------------------------- *)
(* Common monoids. *)
class ['z] addition_monoid = object
inherit ['z] monoid
method zero = 0
method plus = (+)
end
(* -------------------------------------------------------------------------- *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment