1.2.0 permalink Arrow_down_16x16
Monad describing stream computations. The monadic values can be
of any type handled by stream-next.

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/stream_utils.clj:135 top

(defmonad stream-m
  "Monad describing stream computations. The monadic values can be
   of any type handled by stream-next."
  [m-result  (fn m-result-stream [v]
	       (fn [s] [v s]))
   m-bind    (fn m-bind-stream [mv f]
	       (fn [s]
		 (let [[v ss :as r] (mv s)]
		   (if (or (nil? ss) (stream-skip? v))
		     r
		     ((f v) ss)))))
   m-zero     (fn [s] [stream-skip s])
   ])
Vars in clojure.contrib.stream-utils/stream-m:
Used in 0 other vars

Comments top

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