I want to map a function that returns a boolean over a collection and exit with true on the first true match... how would I do that?
(map #(true? %) [false false true false])
returns
=> (false false true false)
How would I simply get true?
I want to map a function that returns a boolean over a collection and exit with true on the first true match... how would I do that?
(map #(true? %) [false false true false])
returns
=> (false false true false)
How would I simply get true?
(some pred coll) returns the first truthy (pred x) for x in coll, or nil if no such truthy value is found. Note that in Clojure, all values are truthy except nil and false. For your example:
(some identity [false false true false])
=> true