'Executes' the monadic values in ms and returns a sequence of the
basic values contained in them.
(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)))
Comments top
No comments for m-seq. Log in to add a comment.