In a few lines:
Monads are a common framework to represent any sequential computation.
What is a sequential computation?
- either no computation at all.
   return :: a -> m a
   does that.
- or I have already a computation and want to go on with my computation.
  But then, I need to be able to look at the result of the first part
of the computation
  to now what to do next:
  bind :: m a -> (a -> m b) -> m b
  This tells: If I have a computation returning a value of type a, and
when I will know a, I will be
   able to create a computation returning some b, then I can sequence
those and make a computation
  returning some b. When I want to run it, I will run the first and
use the result to construct the second
   and then run it. *

What is interesting is that you have a representation of sequential
computations and can use a common libraries of
functions to work with any kind of sequential things. And there are a
lot of things that corresponds to this:
side-effects, logic programming, parsing...

Nicolas.

* The monadic notion of sequential computation allows to look at
intermediate results to determine what to do next.
  You obtain other notion of computations like Arrows or Applicative
functors if you restrict this right.

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