diff options
author | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-03-03 09:28:53 +0000 |
---|---|---|
committer | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-03-03 09:28:53 +0000 |
commit | 6f6415ce4f2f20581331f7f13e2e87ad131fce13 (patch) | |
tree | f2b604f60fc91d31b9f6c95093c2c32bd7d7cf28 /src/clojure/contrib/monads.clj | |
parent | f62460e60cdef2d69e5a76997708a8e25055b010 (diff) |
monads: simplified condition handling
Diffstat (limited to 'src/clojure/contrib/monads.clj')
-rw-r--r-- | src/clojure/contrib/monads.clj | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/clojure/contrib/monads.clj b/src/clojure/contrib/monads.clj index b27edb46..3d746acf 100644 --- a/src/clojure/contrib/monads.clj +++ b/src/clojure/contrib/monads.clj @@ -1,7 +1,7 @@ ;; Monads in Clojure ;; by Konrad Hinsen -;; last updated March 2, 2009 +;; last updated March 3, 2009 ;; Copyright (c) Konrad Hinsen, 2009. All rights reserved. The use ;; and distribution terms for this software are covered by the Eclipse @@ -60,8 +60,7 @@ [mexpr step] (let [[bform expr] step] (if (identical? bform :when) - (list 'm-bind `(if ~expr (~'m-result ::any) ~'m-zero) - (list 'fn ['_] mexpr)) + `(if ~expr ~mexpr ~'m-zero) (list 'm-bind expr (list 'fn [bform] mexpr))))) (defn- monad-expr |