1. Meikel Brandmeyer
  2. monad


Meikel Brandmeyer  committed c72911f

Added monad-type utility

* monad.clj (monad-type): new function. All callers changed.

  • Participants
  • Parent commits 17915b8
  • Branches default

Comments (0)

Files changed (1)

File src/de/kotka/monad.clj

View file
  • Ignore whitespace
   (m :monad))
+(defn monad-type
+  "Return the type of a blessed object."
+  [m]
+  (m :type))
   "bind makes the value of the given monad available to a function.
   The function may act on the value, but it must return another monad.
   Although this cannot be enforced in Clojure."}
-  bind (fn [m _] (m :type)))
+  bind (fn [m _] (monad-type m)))
 (defmacro let-bind
   "let-bind binds the result of the given monads to the given variables