[Haskell-cafe] Explaining monads

Dan Piponi dpiponi at gmail.com
Tue Aug 14 14:08:36 EDT 2007


On 8/14/07, Lennart Augustsson <lennart at augustsson.net> wrote:
> 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.

Can you spell out exactly what you mean by this?

> 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

When someone uses the phrase "something else" it implies that we are
talking about two things, a "something" and a disjoint "something
else". For example, if x = [1,2,3] what is the "something" and what is
the "something else"? What was the x "before [I] computed it" and how
does it differ from its "value"?

> This is just the terminology people use, not an absolute truth, so you're
> free to think it's wrong. :)

For something like this I prefer to think in terms of "useful" and
"not useful". If you find the term "computation" useful, I might find
it useful too. So I'm jealous as I can't figure out how to use it. :-)
I'm not looking for a formal definition or anything like that. But I
would like a reliable way to distinguish between things that are
computations and things that are not.
--
Dan


More information about the Haskell-Cafe mailing list