[Haskell-cafe] Re: philosophy of Haskell

Ertugrul Soeylemez es at ertes.de
Sun Aug 15 15:30:19 EDT 2010


Brandon S Allbery KF8NH <allbery at ece.cmu.edu> wrote:

> On 8/15/10 11:40 , Tillmann Rendel wrote:
> > But in a world passing interpretation of IO, print is supposed to be
> > a pure Haskell function. So the value world2 can only depend on the
> > values of print and world1, but not on the actions of some
> > concurrent thread.
> >
> > If print is not restricted to be a pure Haskell function, we don't
> > need the world passing in the first place.
>
> I am confused by this discussion.  I originally thought some time back
> that IO was about "world passing", but in fact it's just handing off a
> baton to insure that a particular sequence of IO functions is executed
> in the specified sequence and not reordered.  Nothing in the "baton"
> is intended to represent the actual "state of the world", nor is
> anything said about concurrent actions either in another thread of the
> current program or elsewhere outside the program; only ordering of
> calls in the *current* thread of execution.  (Which, hmm, implies that
> unsafePerformIO and unsafeInterleaveIO are conceptually similar to
> forkIO.)

IO is just a simple language to express impure operations.  What we
discuss is how to /interpret/ IO, or more specifically how to translate
IO computations into pure ones mentally.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/




More information about the Haskell-Cafe mailing list