Created
September 19, 2012 13:46
-
-
Save aib/3749769 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn coll-eq | |
"Recursively applies a binary predicate to two colls (of colls etc.) and returns the AND of the result." | |
[eq-fn x y] | |
(let [all (partial every? identity) | |
all-eq (comp all (partial map (partial coll-eq eq-fn)))] | |
(if (and (coll? x) (coll? y)) | |
(all-eq x y) | |
(eq-fn x y)))) | |
(def vec== (partial coll-eq ==)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment