
On Sun, Mar 1, 2009 at 4:28 AM, Will Ness
wrote: Michael Easter
writes: ... After all, we can have a definition of such a value, and have it run multiple times for us, so _as definition_ it's no different than any other definition in Haskell. It's just that _its value_ can cause the system to actually perform these IO actions in some circumstances. But it isn't a definition. "Reference" would be better; "getChar" is a term
Gregg Reynolds
As for terminology: we've got to have some special name for functions that are chainable by bind. Calling them actions confuses them with the real world actions performed by IO.
What I seek here is to demystify the monad, any monad, and IO monad in particular, and for that a clear and consisent terminology must be employed. We should be able to name things, in English, that we talk about - in English.
Correction: special name for IO "functions" (actually "IO terms" would be better).
The monad just organizes stuff, so the IO monad, as monad, is no different
Why? They are just fuctions, of type (Monad m => a -> m b). What I'm saying, they are of special type, chainable by the M monad, so it seems logical to have a special name for such M-chainable functions, e.g. "M-action functions" (whatever the M). The monad M is chaining and combining something. It is M-action functions, of type (a -> M b), that get chained by its bind, and their hidden data combined by it, behind the curtain. Usually when we have a name for some concept, it becomes clearer. And vice versa. than any other monad.
May be to call them "action functions"?
This was a big problem for me; I find terms
like "action", "computation", "function" completely misleading for IO terms/values. Why? A function of type (a -> M b) is a function that returns a value, (:: M b), tagged with some monadic hidden data. In case of IO, it is a promise to perform some actual I/O that's passed around, hidden. But the M-action function itself is just a regular Haskell function. It can be defined elsewhere, anywhere. IO values themselves are no mystery too. They just carry along with them a log of promised I/O activity as specified at time of their creation (definition).
You might find ["Computation" considered harmful. "Value" not so hot either] useful; see also the comment "Another try at the key sentence". There are a few other articles on the blog that address this terminology problem.
Thank you. Will do.