Skip to content

Instantly share code, notes, and snippets.

@marick
Created March 30, 2011 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marick/895525 to your computer and use it in GitHub Desktop.
Save marick/895525 to your computer and use it in GitHub Desktop.
; 1 - monadic value is named 'step-value'. A better name would be 'step-fn'
(defn logging-decider [step-value rest-fn]
(fn [log]
; 2 - here's why it's a better name: we call it to get a base value.
(let [{step-value :value, updated-log :log} (step-fn log)]
; (3) - here, we pass the base value to the rest of the computation.
( (rest-fn step-value) updated-log))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment