Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a bit odd that people often call these side-effects. They're just "effects". Side effects are things you don't want to happen, i.e. accidental/incidental effects... which is exactly what a pure language like Haskell aims to prevent.


That's not how the term is used in programming. Side effects may be intentional.

"Effects" (without the "side") usually means the effect is modeled as a type/value that is returned by the function.


That's not what "side effect" means in this context.

Side effects are the opposite of pure functions. A function with side effects will mutate global state, a function without side effects will not (it will simply return a value).

https://en.m.wikipedia.org/wiki/Side_effect_(computer_scienc...


This is true and correct, but I would add that sometimes in FP books and papers you do see authors merely writing "effects" as well. I think either would be acceptable.


"Effects" in an FP context generally refer to effects explicitly modeled as values in the program, whereas "side effects" are implicit. `Either` is an effect, throwing an exception is a side effect.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: