1.2.0 permalink Arrow_down_16x16
Monad describing plain computations. This monad does in fact nothing
at all. It is useful for testing, for combination with monad
transformers, and for code that is parameterized with a monad.

1 Example top

  • (domonad identity-m
       [a 1
        b (inc a)
        c (* a b)]
        (+ a b c))
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/monads.clj:286 top

(defmonad identity-m
   "Monad describing plain computations. This monad does in fact nothing
    at all. It is useful for testing, for combination with monad
    transformers, and for code that is parameterized with a monad."
  [m-result identity
   m-bind   (fn m-result-id [mv f]
	      (f mv))
  ])
Vars in clojure.contrib.monads/identity-m:
Used in 0 other vars

Comments top

No comments for identity-m. Log in to add a comment.