Closed viboes closed 9 years ago
Well, the point of that deriving mechanism was convenience, so that a user could easily get a monoid instance for a custom type without having to implement anything in addition (assuming their type has the correct operator and identity element as default constructor).
There might indeed be an argument for the abstraction you describe too, but I have no plans to introduce it right now. Perhaps if my interest in this project is sparked anew at some point.
No problem. It was just a suggestion.
I wonder if 0 and operator+() is the appropriated abstraction. What about an
Additive
concept that defineszero<M>() -> M
and 'add(M, M) -> M'?