Closed ToBeReplaced closed 10 years ago
I'm a touch undecided on find-first
as well. However, it's been included in flatland's useful library and the original clojure-contrib library back before Clojure 1.3.0. Not all functions need to be as involved as map-keys
to be useful, and I find myself using it often enough that the shortcut is handy.
I'm wondering if
find-first
belongs in this library.I would argue against its inclusion because it is simple enough for anyone to write and is not any more clear than explicitly typing
(first (filter pred coll))
. Moreover, the simpler, composable method allows forfind-last
orremove-first
and the like.Contrast this with the difficulty of writing a performant version of
map-keys
.