1.2.0 permalink Arrow_down_16x16
  • (with-monad monad & exprs)
Evaluates an expression after replacing the keywords defining the
monad operations by the functions associated with these keywords
in the monad definition given by name.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/monads.clj:102 top

(defmacro with-monad
   "Evaluates an expression after replacing the keywords defining the
    monad operations by the functions associated with these keywords
    in the monad definition given by name."
   [monad & exprs]
   `(let [name#      ~monad
	  ~'m-bind   (:m-bind name#)
	  ~'m-result (:m-result name#)
	  ~'m-zero   (:m-zero name#)
	  ~'m-plus   (:m-plus name#)]
      (with-symbol-macros ~@exprs)))
Vars in clojure.contrib.monads/with-monad: defmacro apply concat let list seq vector
Used in 0 other vars

Comments top

No comments for with-monad. Log in to add a comment.