1.2.0 permalink Arrow_down_16x16
Monad describing multi-valued computations, like sequence-m,
but returning sets of results instead of sequences of results.

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

(defmonad set-m
   "Monad describing multi-valued computations, like sequence-m,
    but returning sets of results instead of sequences of results."
   [m-result (fn m-result-set [v]
	       #{v})
    m-bind   (fn m-bind-set [mv f]
               (apply clojure.set/union (map f mv)))
    m-zero   #{}
    m-plus   (fn m-plus-set [& mvs]
               (apply clojure.set/union mvs))
    ])
Vars in clojure.contrib.monads/set-m:
Used in 0 other vars

Comments top

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