diff options
author | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-05-10 15:30:04 +0000 |
---|---|---|
committer | Konrad Hinsen <konrad.hinsen@laposte.net> | 2009-05-10 15:30:04 +0000 |
commit | 4886392ce03d6bc1dcb3897afe44113ae0a62ba6 (patch) | |
tree | 25a76ba93f51e0509e1c2774bcc2da64a0eec0f3 /src/clojure/contrib/monads.clj | |
parent | 4c1bd15f0bc1764b68ca9ceb16201b7fcadca56b (diff) |
monads: symbol macros for m-result, m-bind, m-zero, m-plus
Diffstat (limited to 'src/clojure/contrib/monads.clj')
-rw-r--r-- | src/clojure/contrib/monads.clj | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/clojure/contrib/monads.clj b/src/clojure/contrib/monads.clj index b2300863..476e649e 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 May 6, 2009 +;; last updated May 10, 2009 ;; Copyright (c) Konrad Hinsen, 2009. All rights reserved. The use ;; and distribution terms for this software are covered by the Eclipse @@ -169,6 +169,14 @@ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Define the four basic monad operations as symbol macros that +; expand to their unqualified symbol equivalents. This makes it possible +; to use them inside macro templates without having to quote them. +(defsymbolmacro m-result m-result) +(defsymbolmacro m-bind m-bind) +(defsymbolmacro m-zero m-zero) +(defsymbolmacro m-plus m-plus) + (defmacro m-lift "Converts a function f of n arguments into a function of n monadic arguments returning a monadic value." |