[Haskell-cafe] Theoretical question: are side effects necessary?

Donn Cave donn at avvanta.com
Sat Mar 17 12:41:37 CET 2012

Quoth Jeff Shaw <shawjef3 at msu.edu>,
> I'm thinking that side effects are really only necessary because Haskell 
> programs expect to mutate the state of a computer outside of the haskell 
> program.

I'm not a computer scientist, but in English, "side effect" is an
effect that accompanies some other effect.  E.g., you may take
an antihistamine to relieve hay fever, and experience a side effect
of drowsiness.

Let's call the first an `intended effect'?  Then in the matter of
the computer outside the Haskell program - which is intended effect,
and which is side effect?

I'd have said, side effects would be like memory paging, deferred
resource access for other processes, etc.?  Some programs might
leave behind temporary files ...

I hope the answer is not that in computer science we regard all
effects as side effects because the ideal computer program simply
exists without consequence.


More information about the Haskell-Cafe mailing list