Nov 21, 2017

A function has no side effects we can execute it anytime, it will always return the same result, given the same input.

The reason why side effects are bad is because, if you had them, a function can be unpredictable depending on the state of the system.

Functions do not have side effects. We consider that a function has a side effect if it modifies a mutable data structure or variable, uses IO, throws an exception or halts an error; all of these things are considered side effects.

If a function has side effects we call it a procedure.