(defn intersection [preds]
(condp = (count preds)
1 (first preds)
2 (let [[f g] preds] #(and (f %) (g %)))
3 (let [[f g h] preds] #(and (f %) (g %) (h %)))
4 (let [[f g h k] preds] #(and (f %) (g %) (h %) (k %)))
(fn [x] (every? #(% x) preds))))
Comments top
No comments for intersection. Log in to add a comment.