PureScript by Example

This repository contains a community fork of PureScript by Example by Phil Freeman, also known as "the PureScript book". This version differs from the original in that it has been updated so that the code and exercises work with up-to-date versions of the compiler, libraries, and tools.

If you enjoyed the book or found it useful, please consider buying a copy of the original on Leanpub.

Status

This book is being continuously updated as the language evolves, so please report any issues you notice with the material. The following chapters are still being updated for purescript 0.13:

  • Chapter 12

Unit tests are also being added for the exercises in each chapter. See #79 for the latest status on tests.

About the Book

PureScript is a small strongly, statically typed programming language with expressive types, written in and inspired by Haskell, and compiling to Javascript.

Functional programming in JavaScript has seen quite a lot of popularity recently, but large-scale application development is hindered by the lack of a disciplined environment in which to write code. PureScript aims to solve that problem by bringing the power of strongly-typed functional programming to the world of JavaScript development.

This book will show you how to get started with the PureScript programming language, from the basics (setting up a development environment) to the advanced.

Each chapter will be motivated by a particular problem, and in the course of solving that problem, new functional programming tools and techniques will be introduced. Here are some examples of problems that will be solved in this book:

  • Transforming data structures with maps and folds
  • Form field validation using applicative functors
  • Testing code with QuickCheck
  • Using the canvas
  • Domain specific language implementation
  • Working with the DOM
  • JavaScript interoperability
  • Dealing with callback hell

License

Copyright (c) 2014-2017 Phil Freeman.

The text of this book is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License: https://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US.

The exercises are licensed under the MIT license.