Skip to content

Instantly share code, notes, and snippets.

@MayDaniel
Created October 29, 2010 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MayDaniel/ae0d9ebf85e9ba6e2cb3 to your computer and use it in GitHub Desktop.
Save MayDaniel/ae0d9ebf85e9ba6e2cb3 to your computer and use it in GitHub Desktop.
(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