-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add Dimension type to Unit trait #367
Comments
This would possibly be handled by #91, but I'm going to leave open as a separate request for the time being. |
Back in 2019 I had big plans to solidify the current Lines 272 to 275 in 020e421
Besides being really busy, part of the reason I haven't made progress is that the limitation of what is in that branch is that the output type needs to be specified for any multiply or divide operations. I'm also not sure if procedural macros is the appropriate way forward or if some kind of pre-compile codegen is more appropriate. |
Not sure I understand. I tried writing my own similar library that carried a unit along with each value, but ran into a similar limitation. There is no way to know at compile time that |
Yes, Lines 22 to 44 in 7c4b27b
|
Related to #231, but I think it's complementary.
Right now, the generated
Unit
trait makes it difficult to write methods that work generically over different types ofUnit
s. For example:It would be great if some associated types could be added to the
Unit
trait:So that we can write:
The text was updated successfully, but these errors were encountered: