How to Better Iterate over State in Clojure (monad?)
问题 I just wrote this code: (defn parameters [transform-factory state] (lazy-seq (let [[r1 state] (uniform state) [r2 state] (uniform state) [t state] (transform-factory state)] (cons [t [r1 r2]] (parameters transform-factory state))))) (defn repeated-transform [mosaic n transform-factory state] (reduce transform-square mosaic (take n (parameters transform-factory state)))) the parameters function generates a lazy sequence of values generated from the state , which are used to parameterise a