-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 allequal
#43353
Comments
I think the idiom to use isn't |
Interesting! I wonder why that's faster... I suspect that beginners are more likely to try |
That's fair, I personally don't like this getting it's own name, but make a PR and triage can decide. |
Yeah, I wouldn't necessarily argue for it getting its own name, but since we already have |
We would want It would be nice if there was an [1] imagine a definition like |
Yeah, I just did the simple thing in my PR and made it allequal(itr) = isempty(itr) ? true : all(isequal(first(itr)), itr) |
Like some other functions, e.g.
|
@GregPlowman That might be nice. Want to open a new issue for that? |
Since we already have
allunique
, it might make sense to also addallequal
. One reason to addallequal
is that a proper implementation is much faster than the naivelength(unique(itr)) == 1
.The text was updated successfully, but these errors were encountered: