Clojure Golf: combinations

unsorted — cgrand, 18 October 2008 @ 15 h 53 min
(defn combinations [& cs]
  (reduce (fn [vs c] 
           (mapcat #(map conj vs (repeat %)) c))
          [[]] cs))

1 Comment »

  1. Nice. Glad to see you back!

    Comment by Rich Hickey — 18 October 2008 @ 18 h 12 min

RSS feed for comments on this post. TrackBack URI

Leave a comment

(c) 2024 Clojure and me | powered by WordPress with Barecity