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