-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement std::iter::Sum #300
Comments
It turns out that it already is implemented. I got confused because I failed to spot the lone On the tangential issue of the orphan rule in general: using some of the macros that From the documentation, it's not clear to me whether |
I just realized that I had a reply typed up and never posted it a couple days ago! Was the I had a bunch of comments about the orphan rule and will see if I can type them up again later this weekend. |
It was. Essentially I did Chucking in a
Thanks! |
#38 will eventually remove the need to I've attempted to reproduce my thoughts on the orphan rule and your specific situation below. Probably not as comprehensive as the initial post I wrote and somehow lost.
As an aside from this issue, I can't put as much time into |
That's what I've done so far. But, as you say, it involves busy work and leaves scope for errors. Whilst we're on the topic, here's another trait where I'm having to do something similar: https://docs.rs/nalgebra/latest/nalgebra/trait.ComplexField.html. I suspect that this one is of more general interest than
I really appreciate it when you reply promptly, but please don't feel under any pressure to do so.
I think you should prioritize what you find most interesting and satisfying to work on, or what would most benefit the project as a whole in your opinion, rather than catering for my needs, or my perception of priorities, which changes relatively quickly depending on what problem I happen to be trying to solve at any given time. If anything, maybe provide some high-level documentation of the structure of the project, and some of the more important design choices or principles. This might enable me (and others) to answer more of my own questions, or find solutions more quickly, or even be able to submit more interesting PRs for more involved issues. In terms of coding, I can hack my way around most of the issues I've raised, with more or less ugly/cumbersome/error-prone workarounds. But the lack of a clean way to define or refer to ad-hoc derived units (such as reciprocal-length) is probably the most irksome. If we could get something like |
Some initial discussion about I'm going to work through some of the open PRs then I'll see about taking a look at improving ergonomics for ad-hoc quantities. |
The orphan rule is really getting me down. At every step I come across third-party traits that I would like to have implemented for
uom
quantities, and there's nothing much that can be done. Wrappinguom
types in newtypes seems too expensive. Any words of wisdom?In the case of
std::iter::Sum
, I would argue that it should be implemented inuom
itself. I'd be happy to contribute a PR if you agree.If so, do you have any hints, pointers, warnings?
[Another trait that I'll be missing sorely fairly soon, is
hdf5::H5Type
but the case for including it inuom
is not as strong.]The text was updated successfully, but these errors were encountered: