dsimcha/phobos — comment on commit 4c1177cced750d6e16622ffcc5c4b114f9f06808
File:  line 0
By jmdavis:

It's not as clear IMHO. `canFind` is pretty obvious without reading its documentation. I don't think that `any` would be in its place for the overload where you give it more than just a predicate and a range. Already, I'd argue that what most people are looking for is `contains` rather than `canFind` for the other overloads. If it were to be `any`, it would be that much worse. It least with `canFind`, it has a clear relation with `find`.

Now, as an alias, since you have both, it's not as big a deal, but I still wouldn't want to see people doing something like `any([1, 2, 3, 5], x)`, because I think that it reduces code clarity. What I _really_ wouldn't want to see happen is to have all of `canFind`'s overloads renamed to `any`. Much as I want `any` for the case where you just have a predicate and a range, I'd much rather have `canFind` without `any` if it were a question of renaming all of `canFind`'s overloads to `any` or not having `any` at all.

Having `any` for the case where it takes just a predicate and a range makes a lot of sense IMHO, since what you're really asking in that case is whether any of the elements in the range match the predicate, but what you're typically asking when you pass `canFind` an element along with the range rather than the predicate is whether that range contains that element. It's a related but different question IMHO.