PureScript

A strongly-typed functional programming language that compiles to JavaScript

Benefits

  • Compile to readable JavaScript and reuse existing JavaScript code easily
  • An extensive collection of libraries for development of web applications, web servers, apps and more
  • Excellent tooling and editor support with instant rebuilds
  • An active community with many learning resources
  • Build real-world applications using functional techniques and expressive types, such as:
    • Algebraic data types and pattern matching
    • Row polymorphism and extensible records
    • Higher kinded types
    • Type classes with functional dependencies
    • Higher-rank polymorphism

Hello, PureScript!

import Prelude
import Control.Monad.Eff.Console (log)

greet :: String -> String
greet name = "Hello, " <> name <> "!"

main = log (greet "World")

Get the compiler

Binaries

Precompiled binaries are available for OSX, Linux, and Windows from the latest release page on GitHub.

npm

npm install -g purescript

(Installation via npm requires Node version 6 or later)

Tools

The recommended build tool for beginners is Pulp, which can be installed using npm:

npm install -g pulp bower

You might like to install some of these additional tools and editor plugins.

Learn more

Libraries

The Pursuit package database hosts searchable documentation for PureScript packages.

Documentation

Visit the documentation repository on GitHub, where you can find articles, tutorials, and more.

Book

The free PureScript By Example book contains several practical projects for PureScript beginners.