-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convenient name for AlgebraicField & ElementaryFunctions
#100
Comments
It's worth listing what types can actually plausibly conform to such a protocol: The elementary functions generally don't make sense for finite fields, and also don't make sense for anything "below" the reals. At the same time So the set of things that could conform is basically the reals and the complex numbers, plus a giant family of exotic non-Archimedian fields that could conform, but are relatively unlikely to be implemented. |
There could also be an • • • Some ideas for naming the protocol composition:
|
It’s worth noting that in Swift today, one cannot extend a protocol composition. This suggests that either we should make a refining protocol instead of a typealias, or we should push on Swift Evolution to make it possible to extend a composition. |
@NevinBR You can do a constrained extension to accomplish essentially the same thing (which is not to say that we shouldn't make a refining protocol):
|
Right, my point is to make this easy and convenient for users. |
Yup, just wanted to stick it on this thread so anyone searching for a solution to the issue finds it here =) |
The natural place to write many generic algorithms is the protocol composition
AlgebraicField & ElementaryFunctions
, as it provides all the basic arithmetic operations including negation and division, as well as powers, roots, and transcendental functions.To facilitate and encourage this practice, we should provide a convenient name for that composition.
The text was updated successfully, but these errors were encountered: