Let's start by looking at the requirements for a pure FPÂ language. A pure FP language must include support for things like:
- First-class functions
- Tail-call optimization (TCO)
- High-order functions
- Pure functions
- Immutable Data
In order to accomplish pure FP, a language must treat functions as it does any other variable type. How can an immutable language have variables that vary? The way we accomplish this in an FP way is by creating new variables, rather than modifying existing ones. We will see how to accomplish this later in the chapter, when we look at the Map function.
Go is a multidimensional language that supports imperative, object-oriented, and FP styles. We could write a purely imperative or functional program in Go. It is our choice of programming style that dictates this. This is one of the great things about Go and FP. It&apos...