I personally would use your approach with a custom reduction function, but here are a few alternatives:
(let [[x] (into [] (comp (map inc) (filter even?) (take 1)) [0 1])]
x)
Use of destruction: /
Or:
(first (eduction (map inc) (filter even?) [0 1])
This is where you save the call compthat is being made for you. Although this is not super lazy. It implements up to 32 elements, so it can be wasteful. Fixed with (take 1):
(first (eduction (map inc) (filter even?) (take 1) [0 1]))
:
(transduce (comp (map inc) (filter even?) (take 1)) (completing
, , , , , transduce, xform, coll . , , . comp, eduction:
(defn single-xf
"Returns the first item of transducing the xforms over collection"
{:arglists '([xform* coll])}
[& xforms]
(transduce (apply comp (butlast xforms)) (completing
:
(single-xf (map inc) (filter even?) [0 1])