Introduction

Pure functional languages don't have the notion of mutable values and therefore don't have any variable assignment. You only have values and expressions, you can give them names, but you can't change the underlying value for a name.

// you get this behaviour in swift, when using let
let n = 42  
n = 7 // immutable value, reassignment is not allowed  

At first this can be cumbersome, because you can't use many familiar structures that you are used to in imperative languages. One of these structures are loops. Think about a for-loop, you need to increment or decrement a control variable to jump out of the loop at one time. Or take a while-loop, you have to change some state so that the boolean expression evaluates to false and you jump out of the while-loop.

But to implement every computable algorithm you need a form of iteration in the language. So how