Preface - Developing Web Apps with Haskell and Yesod, Second Edition (2015)

Developing Web Apps with Haskell and Yesod, Second Edition (2015)

Preface

It’s fair to say that dynamic languages currently dominate the web development scene. Ruby, Python, and PHP are common choices for quickly creating a powerful web application. They provide a much faster and more comfortable development setting than standard static languages in the C family, like Java.

But some of us are looking for a bit more in our development toolbox. We want a language that gives us guarantees that our code is doing what it should. Instead of writing up a unit test to cover every bit of functionality in our application, wouldn’t it be wonderful if the compiler couldautomatically ensure that our code is correct? And as an added bonus, wouldn’t it be nice if our code ran quickly too?

These are the goals of Yesod. Yesod is a web framework bringing the strengths of the Haskell programming language to the web development world. Yesod not only uses a pure language to interact with an impure world, but allows safe interactions with the outside world by automatically sanitizing incoming and outgoing data. It helps us avoid basic mistakes such as mixing up integers and strings, and even allows us to statically prevent many cases of security holes like cross-site scripting (XSS) attacks.

Who This Book Is For

In general, there are two groups of people coming to Yesod. The first group is comprised of longtime Haskell users—already convinced of the advantages of Haskell—who are looking for a powerful framework for creating web applications. The second consists of web developers who either are dissatisfied with their existing tools or are looking to expand their horizons into the functional world.

This book assumes a basic familiarity with both web development and Haskell. We don’t use many complicated Haskell concepts, and those we do use are introduced separately. For the most part, understanding the basics of the syntax of the language should be sufficient.

If you want to come up to speed on Haskell, I recommend another wonderful O’Reilly book: Real World Haskell by Bryan O’Sullivan, John Goerzen, and Donald Bruce Stewart.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, commands, libraries, packages, tools, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

NOTE

This icon signifies a tip, suggestion, or general note.