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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.