Functions
While FP has been around for many decades, its following has only been growing rapidly in recent years. More programmers are picking up functional programming languages or are programming in a functional style in non-functional languages than ever before. At the same time, existing non-functional programming languages are adopting a growing number of FP features and libraries.
In these ongoing developments, Haskell stands out as a reference for all. As a purely FP language, it embodies the ideal of FP. As a trailblazer for new (functional) programming language developments, it sets the bar for other languages to follow in its tracks.
Before diving into practical FP, this chapter gives a brief overview of what FP is and how Haskell fits in. Then, we start with our first Haskell functions. We learn how to define and call functions. This includes an explanation of all the syntactic elements (types, type signature, function body, and so on) and their role. Along the way...