Konrad Hinsen <konrad.hin...@fastmail.net> writes: > Exactly. The result of m-bind must be a continuation-accepting > function again.
Yes, and invoking 'mv' yields such a function. > That's the role of the outer layer (fn [c] ...). That one adds /another/ layer, but the inner function returned by 'mv' has the same "signature", right? > It is indeed a value of the right type, but it is not right value that > represents the composite computation. Ah, now we're getting somewhere. > This version of m-bind would not return the composite computation, but > rather execute it immediately. This is best seen by the position of > mv. In your m-bind, mv is called when m-bind is called. That's not the > desired behaviour. I'm interested in what you mean by "composite computation", because I think it's hinting at some concept for monads that I missed. If, as you say, executing the function immediately is not acceptable behavior, then I infer that the goal is to delay evaluation of the monadic function 'f' until someone finally passes in a "real" continuation as, say, by the `run-cont' function. Is that right? If so, is it the case with all or most monads that the bind operator is not meant to actually perform computation on the spot, but rather to compose a delayed computation, or is this delaying particular to the continuation monad? -- Steven E. Harris
-- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en