Mercurial > dylan
view categorical/monad.clj @ 8:4dfeaf1a70c0
typos, gender reassignment
author | Dylan Holmes <ocsenave@gmail.com> |
---|---|
date | Thu, 27 Oct 2011 23:02:59 -0500 |
parents | b4de894a1e2e |
children |
line wrap: on
line source
2 (ns categorical.monad)3 (use 'clojure.contrib.monads)5 (in-ns 'categorical.monad)7 ;; To implement nondeterministic programs, we'll use a lazy seq to represent a value which may be any one of the members of seq.9 (defmonad amb10 [11 m-result (fn[& vals] (cons 'amb vals))12 m-bind (fn[amb-seq f] (cons 'amb (map f (rest amb-seq))))13 ]14 )