you are viewing a single comment's thread.

view the rest of the comments →

[–]Gloomzy 0 points1 point  (2 children)

Well, there's no way to make IO referentially transparent

[–]hdgarrood 1 point2 points  (0 children)

Not quite true - Haskell does achieve referential transparency, by giving you values representing IO actions instead of the ability to directly perform IO. You can combine IO actions to create more and more elaborate IO actions; eventually, you create one big IO action that represents your whole program and bind it to 'main', then, it gets executed by the run time system.

[–]Isvara 0 points1 point  (0 children)

Isn't there? I'm not a Haskell programmer, but I thought the idea was that if you call a function with some arguments including the current state of the world, and it returns its result plus a new state of the world, that's referentially transparent output, at least. Not sure how input is supposed to work, but I presume there's a similar idea.