C# Roles/IMonoid<T> #4278
-
I'm not sure if this is the correct place to put this. I did a search here and it came up with some meeting notes on roles which is why I'm asking here. I watched an NDC Video - 43:51 of Mads Torgersen discussing the future implementation of Roles/IMonoid/Extension methods. I do not agree with the proposed implementation/use of IMonoid. I feel it is unnecessarily limiting in capabilities or maybe I'm just misunderstanding. Let's start with the example given:
Now this is where I may be misunderstanding but my take away from this is:
One of the ways I would want to use this is as follows:
I would need the "*" and "-" role/monoids to be active at the same time. Am I missing something? If not, I think an approach like what F# uses would be better.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The discussion is not about an implementation of |
Beta Was this translation helpful? Give feedback.
The discussion is not about an implementation of
IMonoid<T>
, it's about the language and runtime features to enable the implementation ofIMonoid<T>
and any other flavor of type class or shape. The features would almost certainly enable a "numeric" shape as you've described to enable generic math functions.See: #1711 and #164