

Transformation Priority Premise Applied - Adrock
http://blog.8thlight.com/micah-martin/2012/11/17/transformation-priority-premise-applied.html

======
Adrock
The author walks through the iterative construction of the following Clojure
code for figuring out how to make a specified amount out of coin
denominations:

    
    
      (defn change-for [amount]
      (let [denominations [25 10 5 1]
            amounts (reductions #(rem %1 %2) amount denominations)
            coins (map #(int (/ %1 %2)) amounts denominations)]
        (mapcat #(take %1 (repeat %2)) coins denominations)))
    

He does it while trying to minimize the "cost" of the code, which is defined
in an interesting way for anyone who mostly writes imperative code.

