To Elena, and my two boys Quique and Julio, which bring me joy every single day.
Functional programming is gathering momentum. Mainstream languages such as Java and C# are adopting features from this paradigm; and languages such as Haskell, Scala, Rust, Clojure, or OCaml, which embody functional programming from the very beginning, are being used in industry. Haskell is a noise-free, pure functional language with a long history, having a huge number of library contributors and an active community. This makes Haskell a great tool for both learning and applying functional programming.
The rise in functional programming comes from two fronts. Nowadays, most applications are heavily concurrent or need to be parallelized to perform better. Think of any web server that needs to handle thousands of connections at the same time. The way you express the intent of your code using Haskell makes it easier to move from a single-thread application to a multi-threaded one at a negligible cost.
Apart from becoming more concurrent, applications are becoming much larger. You would like your development environment to help you catch bugs and ensure interoperation between all modules of your system. Haskell has a very strong type system, which means that you can express a wide range of invariants in your code, which are checked at compile time. Many of the bugs, which previously would be caught using tests, are now completely forbidden by the compiler. Refactoring becomes easier, as you can ensure that changes in your code do not affect those invariants.
Learning functional programming will put you in a much better position as a developer. Functional thinking will continue permeating through mainstream programming in the near future. You’ll be prepared to develop larger and faster applications that bring satisfaction to your customers.
This book focuses both on the ideas underlying and on the practicalities of Haskell programming. The chapters show you how to apply functional programming concepts in real-world scenarios. They also teach you about the tools and libraries that Haskell provides for each specific task. Newcomers to functional programming will not be the only ones who will benefit from reading this book. Developers of Scala, Clojure, Lisp, or ML will be also able to see what sets Haskell apart from other languages.
The book revolves around the project of building a web-based strorefront. In each of the five parts, the focus is on a subsystem of this store: representing clients and products in-memory, data mining (including parallelization and concurrency), persistent storage, discounts and offers, and the general architecture of the application. The topics have been carefully selected for you to get a glimpse of the whole Haskell ecosystem.
These acknowledgments have been transported almost unchanged from the first to the second edition of the book. It is great to see how the people that supported you on your first writing adventure are still around and even more supportive than the first time.
First of all, I would like to acknowledge the great work of the technical reviewer and the editorial board. Their comments and suggestions have been extremely valuable for making the book better and more helpful. Jean-Philippe Moresmau did a great job in the first edition; this time Germán has taken his witness and the result is even better.
Writing a book is a very rewarding task, but it’s also quite a consuming one. For those times where the mood goes sour, there has not been anything better than the support that Elena brought to me. She was there while I was thinking, refining the examples, and reviewing the text one more time.
My family and my friends have also encouraged me the entire time, so a bit of thanks to all of them too. My parents Carmen and Julián deserve a very special mention: they’ve supported me during every single project, and as crazy as it may sound, throughout my whole life. They bought me the first computer I worked with, which was the computer I started programming in an old Visual Basic environment. It’s fair to say that without their help, you wouldn’t be reading this book.
Being surrounded by people who share your passion is the best way to stay motivated to learn and communicate what you know; my colleagues at Utrecht University are a prime example. Many ideas in this book have their roots in that department, and I feel honored to be part of it.
The entire Haskell community is wonderful. Having great mailing lists and IRC rooms full of (quite clever!) people always willing to help encourages you to be curious and to learn more. Every single library and compiler discussed in this book has been carefuly crafted by this community: they are the reason why Haskell is such a great language.
works as a lecturer and researcher at the Department of Information and Computing Sciences in Utrecht University. He is passionate about functional programming and has been coding in Haskell for personal and professional projects for more than 10 years. His current research focuses on how to increase the usefulness of type systems while decreasing their costs and their learning curve; his PhD dissertation discusses how to enhance error reporting in Haskell.
Alejandro has been very active in promoting functional languages, already since his college years. In addition to his duties as a lecturer, he participates actively in both academic and industry-oriented conferences, such as Lambda World and LambdaConf.
is a polyglot Software Architect/Engineer with more than 20 years in the field, with knowledge in Java(EE), Spring, Haskell, C, Python, and Javascript, among others. He works with web-distributed applications. Germán loves math puzzles (including reading Knuth) and swimming. He has tech-reviewed several books, including an application container book (Weblogic), as well as titles covering various programming languages (Haskell, Typescript, WebAssembly, Math for coders, and regexp). You can find more details at his blog site ( https://devwebcl.blogspot.com/ ) or twitter account ( @devwebcl ).
18.119.111.70