We need a mechanism to enhance a given type.
The solution is to be able
- to define the monoid of non-negative integers
we need the type MONOID and
- to define the exponentiation
when defining monoids, we need the set of non-negative integers
to be defined already.
- to define first the set of non-negative integers
without viewing it as a MONOID,
- then to define the interface MONOID
- and finally to enhance the concrete class of non-negative integers
by adding to it the property of being a MONOID.
Marc Moreno Maza