204 karma · joined April 27, 2014
Why couldn't they?
Indeed, but having more data might be able to solve that? The whole problem seems to be that benign conditions sometimes look scary because we're currently not able to predict well enough whether it's something that will eventually cause problems.
Computationally it's trivial to detect illegal moves, so it's nothing like filtering out incorrect medical advice.
Presumably entering such an orbit is only possible due to forces from other celestial bodies in the first place, since otherwise if you reversed time it would spontaneously leave its orbit. In other words, the act of the earth "capturing" the object is ultimately performed by external forces?
Another notable advantage of Brent's algorithm is that it automatically finds the cycle length, rather than (in Floyd's case) any multiple of the cycle length.
https://en.wikipedia.org/wiki/Cycle_detection#Brent's_algori...
There's no way for me to know for sure, but it seems as though Klabnik was exaggerating here.
And the author clearly acknowledges this:
>it’s best to think of Int as modeling the infinite set of all integers
So perhaps the best we can do is Optional.matching as defined in the post, combined with turning a non-optional into an optional using Optional(...) in case we want to "filter" non-optional values using a predicate.
And perhaps in some places this will cause the problem to disappear. I think it will be fine.
Citation needed.