[Haskell-cafe] On the purity of Haskell

Gregg Reynolds dev at mobileink.com
Thu Dec 29 18:55:05 CET 2011


On Dec 29, 2011, at 11:29 AM, Antoine Latter wrote:

> On Thu, Dec 29, 2011 at 11:14 AM, Gregg Reynolds <dev at mobileink.com> wrote:
>> 
>> On Dec 29, 2011, at 11:01 AM, Iustin Pop wrote:
>> 
>>> And to clarify better my original email: yes, (bar x) always gives you
>>> back the same IO action;
>> 
>> More precisely: the same *type*.
>> 
> 
> I'm confused - what do you mean by "type"? I don't think that Iustin's
> statement needs any sort of qualifier - (bar x) always returns the
> same IO action when called with the same value for x, no matter how
> many times you call it.

Maybe it doesn't need qualification, but my guess is that most people read "IO Int" to mean something like "IO action of type int".  But computation does not involve "action".  Action is just an explanatory device - a kind of macguffin - to help explain what's going on with IO, which is non-computational.  But it is a type, and in Haskell it's all about the types.  "IO Int" is a type designator, not an action designator.  A minor point maybe, but germane to the original post (I hope).

-Gregg


More information about the Haskell-Cafe mailing list