Skip to content

Instantly share code, notes, and snippets.

@raek raek/gist:1687882
Created Jan 27, 2012

What would you like to do?
(defn rests [coll]
(if (seq coll)
(cons (seq coll) (rests (rest coll)))
(list ()))))
(defn f [xs]
(let [g (fn [x xs]
(for [y (rest xs)]
[x y]))]
(mapcat g xs (rests xs))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.