Re:Functional programming languages should be better at muta...
by tome on Wednesday July 31, 2024 @06:16AM
(#41117814)
I wouldn't say that's an accurate description of how Haskell handles side effects. In fact I wouldn't say that Haskell has side effects at all.
[ Parent
| on HN ]
Re:Functional programming languages should be better at muta...
by eru on Thursday August 01, 2024 @12:20AM
(#41126127)
Well, it depends on exactly what you mean by side-effects.
First, obviously you have unsafePerformIO, so that everything can have side-effects.
Second, you have side-effects like using memory or using the CPU. You are not supposed to worry about those. Though a more serious side effect you do have to worry about is non-termination. Haskell doesn't track that in its type system.
You are right that the way input/output is handled can be described not as _side-effects_ but as _effects_ of interpreting values of the IO datatype.