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

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: