It\'s a real shame that in .Net there is no polymorphism for numbers, i.e. no INumeric interface that unifies the different kinds of numerical types such as bool, byte, uint
The csharp language team is already looking into this. If you want a view onto the future of type classes in C# start reading at
https://github.com/dotnet/csharplang/issues/164
It seems to have the support of Mads Torgesson so it's not just a random post by a wandering Haskell fanboy.
The example given of a typeclass or shape in C# land is
public shape SGroup
{
static T operator +(T t1, T t2);
static T Zero { get; }
}
notice this is not like an interface. It is declaring static method that belong to SGroup. Read on for more details and discussion.