Given a collection I want to iterate through all paris in a collection. Example
(all-pairs seq)
(all-pairs '(a b c d)) => ([a b] [a c] [a d] [b c] [b d] [c d]))
Here is my idea
(defn all-pairs [coll]
(for [ [idx elmt] (indexed coll)
other-elmt (subvec coll (inc idx))]
(vector elmt other-elm)))
But it doesn't feel idiomatic