JSFoo Chennai 2020

JSFoo Chennai 2020

On component architecture, performance, security for front-end, and emerging trends

Aravind Mallapureddy


Getting started with Purescript

Submitted Mar 3, 2020

Purescript is a Functional programming language with JS runtime and interoperable (using FFI) with JS. Dynamically typed (or, rather, unityped) languages, such as JavaScript or Clojure, do not offer static analysis by design, therefore they cannot offer the same level of confidence in code correctness. At Juspay we use Purescript on a very large scale and it brings the unification in teams with FP concepts and enables us to create frameworks like Purescript-presto, presto-ui.
This workshop intends to give hands-on experience in Purescript. In the first half, we talk about FP concepts and look at some examples using Purescript, whereas in the second half we rewrite an existing Javascript code base to Purescript.


Learning outcomes of this workshop include:

  • Understand the basic concepts of Functional Programming
  • Understand what usecases FP can simpilfy
  • Will complete a game using purescript

Plan of Action

1) Introduction to Purescript (5m)
2) Setting up the environment (10m)
3) Project structure, Types, Functions (15m)
4) Type classes, Functor, Applicative, Monad (20m)
5) Foreign Function Interface (2m) (might be a break after this)
6) Going through web ui based gaming js example and rewrite it in Purescript (105m)
7) How Purescript can help in scale of team, parallelizing the work, other learnings, and common mistakes. (15m)


Download node js env from here: https://nodejs.org/en/download/
npm install -g purescript pulp bower

Speaker bio

I have been working on Purescript, Haskell and trying to understand Category theory. Functional Programming always seems bit hard to understand at the first because of its roots which is Mathematics, but building an intution helped us crossing this. I hope to share my learnings, experience and intution in this session which will provide the enough intution for every JS developer to try out Purescript.



{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}