Macro
Monad comprehension. Takes the name of a monad, a vector of steps given as binding-form/monadic-expression pairs, and a result value specified by expr. The monadic-expression terms can use the binding variables of the previous steps. If the monad contains a definition of m-zero, the step list can also contain conditions of the form :when p, where the predicate p can contain the binding variables from all previous steps. A clause of the form :let [binding-form expr ...], where the bindings are given as a vector as for the use in let, establishes additional bindings that can be used in the following steps.
; clojure/contrib/monads.clj:114 (defmacro domonad ([steps expr] (monad-expr steps expr)) ([name steps expr] (let [mexpr (monad-expr steps expr)] `(with-monad ~name ~mexpr))))
Copyright (c) Rich Hickey. All rights reserved.
The use and distribution terms for this software are covered by the Eclipse Public License 1.0, which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.