That's one place where the Haskell version is perhaps clearer, since
Haskell's return x will never evaluate to Nothing... See [1] if you'd
like to read about it.

The behaviour you describe is a quirk of c.c.monads' maybe-m
implementation which does not allow nil as a monadic value, since it's
being used as m-zero instead. You could say that the implicit
universal quantifier binding 'value' in the monadic law you cite has
to be taken, in the context of maybe-m, to be restricted to non-nil
values:

\forall value . (not (nil? value)) => ...

(And for a pure monadic experience, one could argue you should not
even use m-result with a nil argument... The fact that nothing
prevents you from doing so if you want to adds to the flexibility of
maybe-m and so is seen to be ultimately beneficial.)

Hope this helps somewhat,
Michal

[1] http://en.wikipedia.org/wiki/Monad_(functional_programming)

-- 
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

Reply via email to