[Haskell-cafe] Alternative name for return

Jerzy Karczmarczuk jerzy.karczmarczuk at unicaen.fr
Thu Aug 8 01:19:27 CEST 2013


Bardur Arantsson comments the comment of Joe Quinn:
>> >On 8/7/2013 11:00 AM, David Thomas wrote:
>>> >>twice :: IO () -> IO ()
>>> >>twice x = x >> x
>>> >>
>>> >>I would call that evaluating x twice (incidentally creating two
>>> >>separate evaluations of one pure action description), but I'd like to
>>> >>better see your perspective here.
>> >
>> >x is only evaluated once, but/executed/  twice. For IO, that means
>> >magic. For other types, it means different things. For Identity, twice =
>> >id!
>> >
> Your point being? x is the same thing regardless of how many times you
> run it.

What do you mean by "the same thing"? You cannot compare 'them' in any 
reasonable sense.

This, the impossibility to check putStr "c" == putStr "c", is btw, a 
refutation of the claim by Tom Ellis that you can do even less with (). 
The void object is an instance of the Eq and Ord classes. And of Show as 
well.

You make the distinction between "evaluate", and  "execute" or "run", 
etc. This is not functional. Your program doesn't "run" anything, it 
applies (>>=) (or equivalent) to an IO (...) object. This is the only 
"practical evaluation" of it, otherwise it can  be passed (or duplicated 
as above). But you cannot apply "bind" twice to the same instance of it 
(in fact, as I said above, "the same instance"  is a bit suspicious 
concept...).

The "running" or "execution" takes place outside of your program. In 
such a way Richard O'Keefe and I converge... That's why I say that the 
concept of purity is meaningless in the discussed context. It is a kind 
of counterfeit notion, inherited from "pure functions" to something 
which belongs to two different worlds.

Jerzy Karczmarczuk

PS. I believe that some impure remarks about the familiarity of X or Y 
with English do not belong to this forum.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130808/576bd2b8/attachment.htm>


More information about the Haskell-Cafe mailing list