In this article, I go through the of by showing the different steps of the refactoring of a method . This article also permits to see we can go with . base concepts functional programming from imperative programming to functional where Kotlin as a FP language Concepts : Side Effect Pure function Function as a First-Class Citizen Higher-Order Function Closed Parameter and Closure Curryfication / Partial Application Lambda expression Base method From Procedural to Functional : Side Effect appearance of a : a or is said to have a side effect if it modifies some outside its local environment. — Side effect function expression state wikipedia With FP, we do not want to have as we want to have isolated processes to enable parallelization. A function that has no side effect (and do return the same value for same arguments) is called a . side effects pure function : has the following properties: Pure function * Its is the same for the same (no variation with local , , mutable or input streams from ). return value arguments static variables non-local variables reference arguments I/O devices * Its evaluation has no side effects (no mutation of local static variables, non-local variables, mutable reference arguments or I/O streams). — wikipedia Moving up the Side Effect With this step, we start to use a function like a variable (passed as an argument to other functions, returned by another function or assigned as a value to a variable). This usage is called functions as a first-class citizen A function which takes an other function as argument is called a . higher-order function uses a parameter, , which is not passed as an argument. This parameter is called a and the method The parameter is said closed because not modifiable by argument, by opposition to an open parameter like those passed as standard method argument. add() results closed parameter a closure. Removing the Side Effect Finally, the side effect is completely removed by using the operator which returns another list with the additional movie. plus First Currying : technique of translating the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single argument — Currying wikipedia enables which you will probably never use in standard apps but also permits to reduce functions to less complex ones which may already exist in your SDK and then reduce your code. Currying lambda calculus is a similar concept without the 1-argument requirement. Partial application : refers to the process of fixing a number of arguments to a function, producing another function of smaller arity. — Partial application wikipedia (Removing Movie duplicate) From anonymous to Lambda expression and last currying : anonymous function with simplified notation Lambda expression Using lambda is supposed to help us write more concise code, we see here that, with Kotlin, it is less obvious... JavaScript, for example, permits to remove curly braces and types to arrive to a very clean pipe. An alternative exists int Kotlin with typed variable notation (see the end of the article). Code reduction by replacing to a base function : Collection.Filter Final form The code is now an expression of very basic functions, the business is clearly separated from the rest ( and We obtain a true functional program. findByTitle() matches()). Appendix : with typed variable notation The type can be removed from the pipe to the variable. With long pipes, it is still not friendly and can also lead to type errors. The code is on github with unit tests to ensure the code is working between steps. _Kotlin version of the Devoxx 2018 conf "Tout ce que vous avez toujours voulus savoir sur la programmation fonctionnelle…_github.com jacquesgiraudel/IntroPgmFonct This article is inspired by this live coding talk (in french), I have adapted the code to Kotlin. An english version (with some little differences) can be found here .