'Executes' the monadic values in ms and returns a sequence of the
basic values contained in them.

0 Examples top

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:200 top

(defmonadfn m-seq
  "'Executes' the monadic values in ms and returns a sequence of the
   basic values contained in them."
  [ms]
  (reduce (fn [q p]
	    (m-bind p (fn [x]
			(m-bind q (fn [y]
				    (m-result (cons x y)))) )))
	  (m-result '())
	  (reverse ms)))
Vars in clojure.contrib.monads/m-seq: cons fn reduce reverse
Used in 0 other vars

Comments top

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