You don't normally call x::Int a computation of an Int because there's
nothing that distinguishes the value of the x from what it was before you
computed it.  So I prefer to regard x as a value (in a domain, of course).
But for x :: (Monad m) => m Int there is something else happening, so the
word computation makes sense.
This is just the terminology people use, not an absolute truth, so you're
free to think it's wrong. :)
BTW, if you regard non-termination as an effect then even x :: Int is a
computation.

  -- Lennart

On 8/14/07, Dan Piponi <[EMAIL PROTECTED]> wrote:
>
> On 8/14/07, Jeff Polakow <[EMAIL PROTECTED]> wrote:
> > One general intuition about monads is that they represent computations
> > rather than simple (already computed) values:
>
> >     x :: Int               -- x is an Int
> >     x :: Monad m => m Int  -- x is a computation of an Int
>
> What's a "computation"? It seems to me that in a lazy language, x::Int
> represents a computation of an int, not an "already computed" value.
> x::[Int] is a computation that returns multiple values. x::(Int,Int)
> is a computation that returns a pair of values. x::() is a computation
> that returns nothing. x::Map a b is a computation that gives a way to
> associate values of type a with values of type b. Some of these are
> monads, some are not. What's the difference between them? Why are you
> calling certain values "computations"?
> --
> Dan
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to