Return the distribution that results from rejecting the values from
dist that do not satisfy predicate p.
(defn reject
"Return the distribution that results from rejecting the values from
dist that do not satisfy predicate p."
[p dist]
(fn [rs]
(let [[r nrs] (dist rs)]
(if (p r)
(recur nrs)
[r nrs]))))
Comments top
No comments for reject. Log in to add a comment.