A short presentation on the PureScript language
To install PureScript use npm i -g purescript
Pulp and Bower are the default build tools for PureScript projects. To install those run npm i -g pulp bower
The pulp build tool has commands that allow you to build a simple application in a matter seconds. To create a PureScript application in your current directory run pulp init
.
The pulp init
scaffolds out an application for you but you also have to build it before it can run. To do this run pulp build
.
Now that you have an application and it’s build you can now run it. To do this run pulp run
. If you have not done anything else to the scaffolded project then you should see Hello, sailor!
in the console.
Because PureScript is universal you can build a project that works in the browser as well. To do this run pulp build -O --to main.js
to create a bundle.
To learn about types open up the file src/Data/Types.purs
.
To learn about pattern matching open up the file src/Data/PatternMatching.purs
.
To learn about FFI open up the file src/Data/FFI.purs
.
To learn about Records open up the file src/Data/Records.purs
.