-
Notifications
You must be signed in to change notification settings - Fork 125
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
Field Trait API UX #41
Comments
leveraging |
I wouldn't suffice but it would make things simpler. Let's create an issue to migrate to core. |
Regarding the complexity around We could leverage Despite the extra work, it's better in the long term if we ever decide to layer traits. For example, let's say we want to define a pub trait Hash2Curve {
type Field: Field + Add<Rhs = Self::Field> + ...;
...
} We could not define those trait bounds on the trait, but then type inference within the compiler or specific use cases would deny the usage of those traits. This means we could leverage the |
I think that for the
Field
trait, rather than defining methods likeadd
,sub
,mult
,inv
, etc., they should leverage thecore::ops::Add
and others.If a trait for a method does not exist, it should be defined in a similar style to one from
core::ops
.NOTE:
The use of
core
instead ofstd
here, and I would recommend using core for all things where possible as it would make supportingno_std
easier.They point to the same implementations, but
core
is specifically forno_std
environments.The text was updated successfully, but these errors were encountered: