(rontolisp) docs
← Seqs

keep

(keep f coll) / (keep f)

Answers the non-nil results of f over coll's seq view, in order; false is kept, only nil drops. A function that signals on a member signals, like the oracle -- (keep inc [1 nil 2]) throws instead of skipping. A lazy input answers a lazy seq, a strict one a strict list. As a value a two-argument lambda.

(keep f) is its transducer, as a value too.