Advertisement
Guest User

Clojure do-notation

a guest
Feb 6th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; lame
  2. (then
  3.     (get-promise)
  4.     (fn [promise]
  5.         (then
  6.             (process promise)
  7.             (fn [bla]
  8.                 (println bla)))))
  9.  
  10. ; cool
  11. (>>=
  12.     (<- promise (get-promise))
  13.     (<- bla (process promise))
  14.     (println bla))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement