-
-
Save MayDaniel/ae0d9ebf85e9ba6e2cb3 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 all-pairs [coll] | |
(let [x (first coll) xs (next coll)] | |
(when xs | |
(lazy-cat | |
(map (fn [y] [x y]) xs) | |
(all-pairs xs))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment