Introduction To Purescript
The Presto framework is built using functional programming concepts and is written in a language called Purescript.
This is a short guide on the building blocks of purescript and functional programming.
Types
Types are a way of categorizing sets of values. The type Bool is a two element set containing True and False. Purescript has String, Bool, Int, Number etc as primitive types. You can define your own types.
-- Sum Type
data TransactionStatus = SUCCESS | FAILURE
-- Product Type
data Point = Point Number Number
Functions
Function is a building block using which you can represent any concept in functional programming. A function is just a mapping of values to values. Let's see some functions :-
addTwo :: Int -> Int
addTwo a = a + 2
This can be read as addTwo function takes an Int and returns an Int.
Finding type of a function
>:t toUpperCase
String -> String
Further Reading
We recommended you complete atleast first five chapters of this book.
Refer this to install and setup purescript.