-
Notifications
You must be signed in to change notification settings - Fork 68
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
Minimize need for repeated generic arguments. #63
Comments
should input be Yeah this API looks good (if possible). One minor issue is that we have to bound input var is an |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using many gadgets requires repeating type parameters: once for the native version, and once for the constraint version. However, this seems redundant as usually there's only a single gadget for a particular primitive. So, it makes sense to tie the gadget to the native impl. We can do this via an extension trait, as follows:
We can invoke this as
We've reduced the number of type parameters greatly. This works for
Gadget
traits which don't contain variables themselves. What aboutVar
traits, which contain variables? We can still use them, as follows:This would allow us to access the "unique" variable type for a given field element, without introducing multiple type parameters.
Feedback on this idea is very welcome!
The text was updated successfully, but these errors were encountered: