SlideShare a Scribd company logo
Getting Started with
PureScript
John A. De Goes
Agenda
• Introduction
• What is PureScript
• Syntax & Semantics
• Who Uses PureScript
• Why PureScript
• Ecosystem
• Getting Started
• Node.js
• NPM
• Bower
• PureScript
• Pulp
• Hello World
What is PureScript?
PureScript is a strongly-typed, purely-functional programming
language that compiles to Javascript1
, and is written in and
inspired by Haskell.
1
And C++!
Syntax
import Control.Apply
import Graphics.Canvas.Free
scene =
filled $ closed do
moveTo 0 0
lineTo 50 0
lineTo 25 50
where
closed path = beginPath *> path <* closePath
filled shape = shape <* fill
Semantics
• Type Inference
• Higher-Kinded Polymorphism
• Support for basic Javascript types
• Extensible records
• Extensible effects
• Optimizer rules for generation of efficient Javascript
• Pattern matching
• Simple FFI
• Modules
• Rank N Types
• Do Notation
• Tail-call elimination
• Type Classes
Who Uses PureScript?2
• SlamData
• Xamarin
• DICOM Grid
• Middlebury Interactive Languages
• DICE.fm
• McGraw Hill Financial
2
Cobbled together from various online sources.*
Why PureScript?
Motivation
• You want to or are forced to do front-end or node.js
• You like static typing
• You like functional programming, of the pure variety
• You prefer expressive power over no-frills, opinionated simplicity
• You want to crush Javascript/CoffeeScript/TypeScript/Scala3
beneath your
heel... BWAHAHA!
3
OK, not quite yet.
Why PureScript?
..instead of GHCJS?
• "Haskell in hindsight"
• Strict versus lazy
• Zero runtime
• Clean, easy FFI
• Great re-use of third-party JS
• Simpler language than GHC's quadrillion dialects of Haskell
Ecosystem
Ecosystem
UI Libraries
• purescript-halogen
• purescript-react
• purescript-angular
• purescript-rx
• purescript-flare
• purescript-pux
• purescript-optic-ui
• purescript-behaviors
• purescript-signal
• purescript-thermite
• purescript-frp-rabbit
• purescript-sigment
• purescript-ufi
And even more!
Ecosystem
Testing Libraries
• purescript-test-unit
• purescript-quickcheck
• purescript-quickcheck-laws
• purescript-strongcheck
• purescript-benchotron
• purescript-spec
• purescript-assert
Ecosystem
Preludes4
• purescript-prelude
• purescript-preface
• purescript-batteries
4
Yes, there are multiple!
Ecosystem
Build Tooling
• pulp
• grunt-purescript
• gulp-purescript
• purescript-psa
Ecosystem
Editor / IDE Support
• Atom
• purescript-contrib/atom-language-purescript
• nwolverson/atom-ide-purescript
• Emacs
• dysinger/purescript-mode
• emacs-pe/purescript-mode
• ardumont/psci-mode
• spion/purscheck
• emacs-pe/flycheck-purescript
• epost/psc-ide-emacs
• Sublime Text 2 - PureScript package
• Vim
• purescript-vim
• FrigoEU/psc-ide-vim
• IntelliJ IDEA - ikarienator/pure-idea
• Visual Studio - nwolverson/vscode-ide-purescript
• General
• kRITZCREEK/psc-ide
• To generate TAGS files, use psc-docs --format etags (or --format ctags)
Ecosystem
Library Search
Pursuit
Getting Started
Prerequisites
1. Node.js
2. NPM
3. Bower
4. PureScript
5. Pulp
Getting Started
Prerequisites: Node.js
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript
engine. Node.js uses an event-driven, non-blocking I/O model
that makes it lightweight and efficient. Node.js' package
ecosystem, npm, is the largest ecosystem of open source libraries
in the world.
Node.js allows full-featured, browser-less Javascript
programs.
Getting Started
Prerequisites: Node.js
• Many Javascript dev tools are written in Javascript and run
on Node.js
• PureScript dev tools are written in PureScript, compiled to
JavaScript
• Bottom Line: You can't live without it (even if you want to!).
Getting Started
Prerequisites: Node.js
• Installers
https://nodejs.org/en/download/
• Homebrew
brew install node
• MacPorts
port install nodejs
• pkgsrc
pkgin -y install nodejs
• Debian / Ubunutu (4.x)
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
• Debian / Ubuntu (6.x)
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Getting Started
Prerequisites: NPM
• NPM = Node Package Manager
• Used by Node to manage packages
• Many tools and libraries are distributed through NPM
• Bottom Line: Another thing you can't live without...
Getting Started
Prerequisites: NPM
• NPM comes pre-installed with Node.js but version may be
old
• Self-Updating NPM:
sudo npm install npm -g
Getting Started
Prerequisites: Bower
• A package manager for the web
• Maintains global registry of name -> URL
• Supports repositories & tags
• Supports all types of dependencies (binary, PureScript, etc.)
• Dependencies specified in bower.json file
• Bottom Line: Almost all PureScript libraries are registered with bower,
and almost all PureScript projects maintain dependencies with bower!
Getting Started
Prerequisites: Bower
{
"name": "purescript-library",
"description": "A PureScript library",
"authors": [
"John A. De Goes <john@degoes.net>"
],
"license": "Apache 2",
"version": "0.1.0",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"output"
],
"dependencies": {
"purescript-profunctor-lenses": "^1.0.0-rc.1",
"purescript-free": "^1.0.0-rc.1",
"purescript-console": "^v1.0.0-rc.1",
"purescript-either": "^v1.0.0-rc.1",
"purescript-maybe": "^1.0.0-rc.1",
"purescript-foldable-traversable": "^1.0.0-rc.1",
"purescript-monoid": "^1.0.0-rc.2",
"purescript-bifunctors": "^1.0.0-rc.1",
"purescript-invariant": "^1.0.0-rc.1",
"purescript-prelude": "^1.0.0-rc.4",
"purescript-control": "^1.0.0-rc.1",
"purescript-transformers": "^1.0.0-rc.1"
}
}
Getting Started
Prerequisites: Bower
• Install with NPM
npm install -g bower
Getting Started
Prerequisites: PureScript Compiler
• psc — PureScript compiler
• psc-docs — PureScript documentation generator
• psc-bundle — Bundler & dead-code eliminator
• psci — PureScript Read-Eval-Print-Loop (REPL)
• psc-ide-server — IDE Server
• psc-ide-client — IDE Client
Getting Started
Prerequisites: PureScript Compiler
• Installers
https://github.com/purescript/purescript/releases/latest
• Install with NPM
npm install -g purescript
Getting Started
Prerequisites: Pulp
• Pulp: Popular build tool for PureScript projects
• Knows how to perform magical incantations of psc & related
tools
• Bottom Line: If you can use it to build your project, then do
it!
Getting Started
Prerequisites: Pulp
• Install with NPM
npm install -g pulp
Getting Started
Hello World
1. Create Directory Structure
2. Create Bower File
3. Install Bower Dependencies
4. Write PureScript Main
5. Build & Run
Getting Started
Hello World: Create Directory Structure
bower.json
/src/
/Main.purs
Getting Started
Hello World: Create Bower File
{
"name": "hello world",
"dependencies": {
"purescript-console": "^0.1.1",
"purescript-eff": "^0.1.2",
"purescript-prelude": "^0.1.5"
}
}
Getting Started
Hello World: Install Bower Dependencies
bower install
Getting Started
Hello World: Write PureScript Main
module Main where
import Prelude(Unit)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
main :: forall e. Eff (console :: CONSOLE | e) Unit
main = do
log "Hello World!"
Getting Started
Hello World: Build & Run
pulp build
pulp run
Congratulations, You've Started Your Journey Into The
World of PureScript!
Don't Forget the Easy Peasy PureScript Workshop at LambdaConf 2016!
More Resources: http://purescript.org
THE END

More Related Content

What's hot (18)

ODP
RSYSLOG v8 improvements and how to write plugins in any language.
Rainer Gerhards
 
PDF
Philly Tech Week Introduction to NodeJS
Ross Kukulinski
 
PDF
Dive into sentry
Leo Zhou
 
ODP
Lisp Meet Up #31, Clake: a GNU make-like build utility in Common Lisp
masayukitakagi
 
PPTX
Node.js Workshop - Sela SDP 2015
Nir Noy
 
PPT
Initiation à Ruby on Rails
Microsoft Technet France
 
PPTX
Create Rest API in Nodejs
Irfan Maulana
 
PDF
Nodejs vatsal shah
Vatsal N Shah
 
ODP
Testing Wi-Fi with OSS Tools
All Things Open
 
PPTX
Introduction to node.js
Arun Kumar Arjunan
 
PDF
Dockercon Swarm Updated
Docker, Inc.
 
KEY
自分をClojure化する方法
fukamachi
 
PDF
Mobile Analytics mit Elasticsearch und Kibana
inovex GmbH
 
PPT
Don’t turn your logs into cuneiform
Andrey Rebrov
 
PPTX
Ansible+docker (highload++2015)
Pavel Alexeev
 
PDF
vert.x 3.1 - be reactive on the JVM but not only in Java
Clément Escoffier
 
PPTX
Kubernetes #4 volume &amp; stateful set
Terry Cho
 
PDF
vert.x 소개 및 개발 실습
John Kim
 
RSYSLOG v8 improvements and how to write plugins in any language.
Rainer Gerhards
 
Philly Tech Week Introduction to NodeJS
Ross Kukulinski
 
Dive into sentry
Leo Zhou
 
Lisp Meet Up #31, Clake: a GNU make-like build utility in Common Lisp
masayukitakagi
 
Node.js Workshop - Sela SDP 2015
Nir Noy
 
Initiation à Ruby on Rails
Microsoft Technet France
 
Create Rest API in Nodejs
Irfan Maulana
 
Nodejs vatsal shah
Vatsal N Shah
 
Testing Wi-Fi with OSS Tools
All Things Open
 
Introduction to node.js
Arun Kumar Arjunan
 
Dockercon Swarm Updated
Docker, Inc.
 
自分をClojure化する方法
fukamachi
 
Mobile Analytics mit Elasticsearch und Kibana
inovex GmbH
 
Don’t turn your logs into cuneiform
Andrey Rebrov
 
Ansible+docker (highload++2015)
Pavel Alexeev
 
vert.x 3.1 - be reactive on the JVM but not only in Java
Clément Escoffier
 
Kubernetes #4 volume &amp; stateful set
Terry Cho
 
vert.x 소개 및 개발 실습
John Kim
 

Similar to Getting Started with PureScript (20)

PDF
PureScript Tutorial 1
Ray Shih
 
PDF
An Intro to Js & Node.js
Premchand Kumar
 
PDF
ES2015 workflows
Jarrod Overson
 
PDF
Javascript do jeito certo
Alexandre Gomes
 
PDF
JavaScript in 2015
Igor Laborie
 
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
PDF
System webpack-jspm
Jesse Warden
 
KEY
Javascript do jeito certo
Alexandre Gomes
 
PPTX
Api NodeJS con PureScript
Belatrix Software
 
PDF
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
PDF
Angular Part 3 (Basic knowledge)
Rohit Singh
 
PPTX
Using Javascript in today's world
Sudar Muthu
 
PDF
The Parenscript Common Lisp to JavaScript compiler
Vladimir Sedach
 
PDF
Clojurescript slides
elliando dias
 
PPTX
Overview of Node JS
Jacob Nelson
 
PPTX
Functional node.js
Carob Cherub
 
PDF
CLJS Presentation
Žilvinas Urbonas
 
PDF
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
Horacio Gonzalez
 
PDF
Node.js, toy or power tool?
Ovidiu Dimulescu
 
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PureScript Tutorial 1
Ray Shih
 
An Intro to Js & Node.js
Premchand Kumar
 
ES2015 workflows
Jarrod Overson
 
Javascript do jeito certo
Alexandre Gomes
 
JavaScript in 2015
Igor Laborie
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
System webpack-jspm
Jesse Warden
 
Javascript do jeito certo
Alexandre Gomes
 
Api NodeJS con PureScript
Belatrix Software
 
DownTheRabbitHole.js – How to Stay Sane in an Insane Ecosystem
FITC
 
Angular Part 3 (Basic knowledge)
Rohit Singh
 
Using Javascript in today's world
Sudar Muthu
 
The Parenscript Common Lisp to JavaScript compiler
Vladimir Sedach
 
Clojurescript slides
elliando dias
 
Overview of Node JS
Jacob Nelson
 
Functional node.js
Carob Cherub
 
CLJS Presentation
Žilvinas Urbonas
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
Horacio Gonzalez
 
Node.js, toy or power tool?
Ovidiu Dimulescu
 
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Ad

More from John De Goes (20)

PDF
Refactoring Functional Type Classes
John De Goes
 
PDF
One Monad to Rule Them All
John De Goes
 
PDF
Error Management: Future vs ZIO
John De Goes
 
PDF
Atomically { Delete Your Actors }
John De Goes
 
PDF
The Death of Final Tagless
John De Goes
 
PDF
Scalaz Stream: Rebirth
John De Goes
 
PDF
Scalaz Stream: Rebirth
John De Goes
 
PDF
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional Programming
John De Goes
 
PDF
ZIO Queue
John De Goes
 
PDF
Blazing Fast, Pure Effects without Monads — LambdaConf 2018
John De Goes
 
PDF
Scalaz 8: A Whole New Game
John De Goes
 
PDF
Scalaz 8 vs Akka Actors
John De Goes
 
PDF
Orthogonal Functional Architecture
John De Goes
 
PDF
The Design of the Scalaz 8 Effect System
John De Goes
 
PDF
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
John De Goes
 
PDF
Post-Free: Life After Free Monads
John De Goes
 
PDF
Streams for (Co)Free!
John De Goes
 
PDF
MTL Versus Free
John De Goes
 
PDF
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
John De Goes
 
PDF
Halogen: Past, Present, and Future
John De Goes
 
Refactoring Functional Type Classes
John De Goes
 
One Monad to Rule Them All
John De Goes
 
Error Management: Future vs ZIO
John De Goes
 
Atomically { Delete Your Actors }
John De Goes
 
The Death of Final Tagless
John De Goes
 
Scalaz Stream: Rebirth
John De Goes
 
Scalaz Stream: Rebirth
John De Goes
 
ZIO Schedule: Conquering Flakiness & Recurrence with Pure Functional Programming
John De Goes
 
ZIO Queue
John De Goes
 
Blazing Fast, Pure Effects without Monads — LambdaConf 2018
John De Goes
 
Scalaz 8: A Whole New Game
John De Goes
 
Scalaz 8 vs Akka Actors
John De Goes
 
Orthogonal Functional Architecture
John De Goes
 
The Design of the Scalaz 8 Effect System
John De Goes
 
Quark: A Purely-Functional Scala DSL for Data Processing & Analytics
John De Goes
 
Post-Free: Life After Free Monads
John De Goes
 
Streams for (Co)Free!
John De Goes
 
MTL Versus Free
John De Goes
 
The Easy-Peasy-Lemon-Squeezy, Statically-Typed, Purely Functional Programming...
John De Goes
 
Halogen: Past, Present, and Future
John De Goes
 
Ad

Recently uploaded (20)

PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 

Getting Started with PureScript

  • 2. Agenda • Introduction • What is PureScript • Syntax & Semantics • Who Uses PureScript • Why PureScript • Ecosystem • Getting Started • Node.js • NPM • Bower • PureScript • Pulp • Hello World
  • 3. What is PureScript? PureScript is a strongly-typed, purely-functional programming language that compiles to Javascript1 , and is written in and inspired by Haskell. 1 And C++!
  • 4. Syntax import Control.Apply import Graphics.Canvas.Free scene = filled $ closed do moveTo 0 0 lineTo 50 0 lineTo 25 50 where closed path = beginPath *> path <* closePath filled shape = shape <* fill
  • 5. Semantics • Type Inference • Higher-Kinded Polymorphism • Support for basic Javascript types • Extensible records • Extensible effects • Optimizer rules for generation of efficient Javascript • Pattern matching • Simple FFI • Modules • Rank N Types • Do Notation • Tail-call elimination • Type Classes
  • 6. Who Uses PureScript?2 • SlamData • Xamarin • DICOM Grid • Middlebury Interactive Languages • DICE.fm • McGraw Hill Financial 2 Cobbled together from various online sources.*
  • 7. Why PureScript? Motivation • You want to or are forced to do front-end or node.js • You like static typing • You like functional programming, of the pure variety • You prefer expressive power over no-frills, opinionated simplicity • You want to crush Javascript/CoffeeScript/TypeScript/Scala3 beneath your heel... BWAHAHA! 3 OK, not quite yet.
  • 8. Why PureScript? ..instead of GHCJS? • "Haskell in hindsight" • Strict versus lazy • Zero runtime • Clean, easy FFI • Great re-use of third-party JS • Simpler language than GHC's quadrillion dialects of Haskell
  • 10. Ecosystem UI Libraries • purescript-halogen • purescript-react • purescript-angular • purescript-rx • purescript-flare • purescript-pux • purescript-optic-ui • purescript-behaviors • purescript-signal • purescript-thermite • purescript-frp-rabbit • purescript-sigment • purescript-ufi And even more!
  • 11. Ecosystem Testing Libraries • purescript-test-unit • purescript-quickcheck • purescript-quickcheck-laws • purescript-strongcheck • purescript-benchotron • purescript-spec • purescript-assert
  • 12. Ecosystem Preludes4 • purescript-prelude • purescript-preface • purescript-batteries 4 Yes, there are multiple!
  • 13. Ecosystem Build Tooling • pulp • grunt-purescript • gulp-purescript • purescript-psa
  • 14. Ecosystem Editor / IDE Support • Atom • purescript-contrib/atom-language-purescript • nwolverson/atom-ide-purescript • Emacs • dysinger/purescript-mode • emacs-pe/purescript-mode • ardumont/psci-mode • spion/purscheck • emacs-pe/flycheck-purescript • epost/psc-ide-emacs • Sublime Text 2 - PureScript package • Vim • purescript-vim • FrigoEU/psc-ide-vim • IntelliJ IDEA - ikarienator/pure-idea • Visual Studio - nwolverson/vscode-ide-purescript • General • kRITZCREEK/psc-ide • To generate TAGS files, use psc-docs --format etags (or --format ctags)
  • 16. Getting Started Prerequisites 1. Node.js 2. NPM 3. Bower 4. PureScript 5. Pulp
  • 17. Getting Started Prerequisites: Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Node.js allows full-featured, browser-less Javascript programs.
  • 18. Getting Started Prerequisites: Node.js • Many Javascript dev tools are written in Javascript and run on Node.js • PureScript dev tools are written in PureScript, compiled to JavaScript • Bottom Line: You can't live without it (even if you want to!).
  • 19. Getting Started Prerequisites: Node.js • Installers https://nodejs.org/en/download/ • Homebrew brew install node • MacPorts port install nodejs • pkgsrc pkgin -y install nodejs • Debian / Ubunutu (4.x) curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs • Debian / Ubuntu (6.x) curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
  • 20. Getting Started Prerequisites: NPM • NPM = Node Package Manager • Used by Node to manage packages • Many tools and libraries are distributed through NPM • Bottom Line: Another thing you can't live without...
  • 21. Getting Started Prerequisites: NPM • NPM comes pre-installed with Node.js but version may be old • Self-Updating NPM: sudo npm install npm -g
  • 22. Getting Started Prerequisites: Bower • A package manager for the web • Maintains global registry of name -> URL • Supports repositories & tags • Supports all types of dependencies (binary, PureScript, etc.) • Dependencies specified in bower.json file • Bottom Line: Almost all PureScript libraries are registered with bower, and almost all PureScript projects maintain dependencies with bower!
  • 23. Getting Started Prerequisites: Bower { "name": "purescript-library", "description": "A PureScript library", "authors": [ "John A. De Goes <[email protected]>" ], "license": "Apache 2", "version": "0.1.0", "ignore": [ "**/.*", "node_modules", "bower_components", "output" ], "dependencies": { "purescript-profunctor-lenses": "^1.0.0-rc.1", "purescript-free": "^1.0.0-rc.1", "purescript-console": "^v1.0.0-rc.1", "purescript-either": "^v1.0.0-rc.1", "purescript-maybe": "^1.0.0-rc.1", "purescript-foldable-traversable": "^1.0.0-rc.1", "purescript-monoid": "^1.0.0-rc.2", "purescript-bifunctors": "^1.0.0-rc.1", "purescript-invariant": "^1.0.0-rc.1", "purescript-prelude": "^1.0.0-rc.4", "purescript-control": "^1.0.0-rc.1", "purescript-transformers": "^1.0.0-rc.1" } }
  • 24. Getting Started Prerequisites: Bower • Install with NPM npm install -g bower
  • 25. Getting Started Prerequisites: PureScript Compiler • psc — PureScript compiler • psc-docs — PureScript documentation generator • psc-bundle — Bundler & dead-code eliminator • psci — PureScript Read-Eval-Print-Loop (REPL) • psc-ide-server — IDE Server • psc-ide-client — IDE Client
  • 26. Getting Started Prerequisites: PureScript Compiler • Installers https://github.com/purescript/purescript/releases/latest • Install with NPM npm install -g purescript
  • 27. Getting Started Prerequisites: Pulp • Pulp: Popular build tool for PureScript projects • Knows how to perform magical incantations of psc & related tools • Bottom Line: If you can use it to build your project, then do it!
  • 28. Getting Started Prerequisites: Pulp • Install with NPM npm install -g pulp
  • 29. Getting Started Hello World 1. Create Directory Structure 2. Create Bower File 3. Install Bower Dependencies 4. Write PureScript Main 5. Build & Run
  • 30. Getting Started Hello World: Create Directory Structure bower.json /src/ /Main.purs
  • 31. Getting Started Hello World: Create Bower File { "name": "hello world", "dependencies": { "purescript-console": "^0.1.1", "purescript-eff": "^0.1.2", "purescript-prelude": "^0.1.5" } }
  • 32. Getting Started Hello World: Install Bower Dependencies bower install
  • 33. Getting Started Hello World: Write PureScript Main module Main where import Prelude(Unit) import Control.Monad.Eff (Eff) import Control.Monad.Eff.Console (CONSOLE, log) main :: forall e. Eff (console :: CONSOLE | e) Unit main = do log "Hello World!"
  • 34. Getting Started Hello World: Build & Run pulp build pulp run
  • 35. Congratulations, You've Started Your Journey Into The World of PureScript! Don't Forget the Easy Peasy PureScript Workshop at LambdaConf 2016! More Resources: http://purescript.org