Functional programming has been gaining lot of momentum recently. We are seeing different paradigms of functional programming creeping into imperative languages such as C++, C#, and Python. There are languages such as Scala that try to offer best of both worlds, that is, object-oriented programming and functional programming.
As Haskell is a pure and non-strict language, and strictly separates pureness from effect-full computations, it really stands out among these languages. Its strong theoretical basis, such as an elaborate type system, combined with concise and expressive syntax, gives Haskell a unique flavor. It really helps in programming declaratively by specifying what rather than how! In this book, we will focus on practical aspects of the language.
Haskell Cookbook is meant for programmers who have a programming background. Most of the readers should be acquainted with an imperative language, such as Java/Python or C++.
This cookbook can be logically divided into two parts, the first five chapters serve as building blocks for programming in Haskell. These chapters cover syntactical and semantic details of the language by describing how to use and define functions and data types. In these chapters, we also cover type classes and the Functor, Applicative, and Monads concepts.
The last seven chapters will introduce you to the practical aspects of usage of Haskell and its rich set of libraries. These chapters will take you through containers in Haskell and backend development (developing with database) to frontend development (web framework). The last three chapters focus on advanced concepts, such as doing parallel and distributed programming in Haskell.
Each recipe is self-sufficient, and, wherever possible, the recipe will try to build a concept (such as Monad) from scratch, before moving on to a recipe that will use the concept from the existing library. This is especially true in the first five chapters.
Use this book to dive into Haskell and Functional Programming in general. Start building small toy programs by using recipes, and move on to bigger programs to create your own web application or a distributed system. Even if you are not planning to use Haskell in your day-to-day work, I can assure you that it will change the way you look at programming, even when programming with other languages.
This book is not possible without encouragements from my family and the constant pursuance and perseverance of the staff at Packt. These people believed in me even when I was delayed or transgressed.