Welcome! Please see the About page for a little more info on how this works.
It comes up when I would otherwise use (take-while pred coll), but I need to include the first item for which (pred item) is false.
(take-while pos? [1 2 0 3]) => (1 2)
(take-until zero? [1 2 0 3]) => (1 2 0)
Comment made by: gshayban
I feel like this is superceded by CLJ-1906
And this is definitely superseded by halt-when
Comment made by: alexmiller
It's not lazy but this is one way to write take-until with halt-when:
(defn take-until [p s] (transduce (halt-when p (fn [r h] (conj r h))) conj  s))
Comment made by: firstname.lastname@example.org
I wanted to suggest: (sequence (halt-when p conj) s) but sequence doesn't support stopping short on a reduced value so that won't work.
(sequence (halt-when p conj) s)
Yeah, halt-when is a little tricky to use in transducible contexts other than transduce.