Created
October 31, 2012 23:20
-
-
Save michaelsbradleyjr/3990584 to your computer and use it in GitHub Desktop.
plus-maybe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro plus-maybe [mvs] | |
`(let [mvs# (quote ~mvs) | |
mv# (eval (first mvs#)) | |
mvs# (clojure.core/map (fn [mv#] | |
(if (= (class mv#) maybe-monad) | |
mv# | |
(eval mv#))) | |
(rest mvs#))] | |
(monads.core/plus-step mv# mvs#))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment