Scala pure functions

Pure functions are one of the important features or principles of FP.

Pure functions are functions whose result (or return value) depends only on its inputs (function parameters). Irrespective of how many times we call that function with the same inputs, we will receive the same result. Take a look at the following diagram:

Get Scala Reactive Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.