The idea is to allow symbolic prefix (unary) and infix (binary) operators to be overloaded on user-defined types, besides built-in types. So for example one could define a type for matrices and use + to add them.
Part of the motivation (also previously discussed) is to turn the group type and operations, currently built-in, into a library. There may be in fact different groups of interest that Leo code may want to manipulate, beyond the one that is currently supported. (This is orthogonal to support for different curves: given one curve, there may be multiple groups of interest, such as subgroups for different generators, as well as the group for the whole curve.) For library group operations, it would be nice to use the same operators used now for built-in group operations.
💥 Proposal
This has been brought up in the past.
The idea is to allow symbolic prefix (unary) and infix (binary) operators to be overloaded on user-defined types, besides built-in types. So for example one could define a type for matrices and use
+
to add them.Part of the motivation (also previously discussed) is to turn the
group
type and operations, currently built-in, into a library. There may be in fact different groups of interest that Leo code may want to manipulate, beyond the one that is currently supported. (This is orthogonal to support for different curves: given one curve, there may be multiple groups of interest, such as subgroups for different generators, as well as the group for the whole curve.) For library group operations, it would be nice to use the same operators used now for built-in group operations.