December 2015
Intermediate to advanced
298 pages
5h 30m
English
Functional programming includes a lot about functions. There are different kinds of functions in programming, for example, pure functions. A pure function depends only on its input to compute the output. Let's try the following example to make use of functions:
scala> val addThem = (x: Int, y: Int) => x + y + 1 addThem: (Int, Int) => Int = <function2> scala> addThem(3,4) res2: Int = 8
As long as the function lives, it will always give the result 8 given the input (3,4).Take a look at the following example of a pure function:

Figure 1.1: Pure functions
The functions worked on the input and produced the output, without changing any state. ...
Read now
Unlock full access