|
|
|
|
|
by seanmcdirmid
4141 days ago
|
|
I remember a quote by SPJ but am unable to find a reference to it right now. It goes something like: "a program without I/O is merely heating space." Pure Haskell programs have no side effects, where "side effect" is defined as an effect that occurs implicitly outside of the function's signature. They can definitely have non-side effects; they just have to be explicit about it (the same with IO). For some reason, "side effect" have come to mean effects in general... Parent's observation probably relates to the fact that doing IO in Haskell is "harder" than say in Python. There is some truth to that. |
|
To expound, Haskell pure functions do not run code. They produce code to be run at a future date. The infamous IO monad is essentially a wrapper around this code which contains information on when the runtime is supposed to actually execute the code. The execution is always dependent on IO.
So, as the parent said, a Haskell program without IO is literally nothing.