Motivation for this series
Navigating your way
If you're new to FP or you haven't tackled Brian's course, then I highly recommend that you do that first (I certainly did, and it helped me a lot). Then, once you understand the basic abstractions, come back and I'll show you them in PureScript. I've done my best to explain the concepts, but Brian is a master at teaching them. Also, these tutorials are not a replacement for a good old fashioned PureScript primer. So take the time to learn a little PureScript syntax before diving head first into these tutorials.
I’ve created a github repository with the markdown versions of these stories (i.e., README.md) together with the code samples. You can clone it here and fetch upstream for future updates.
Each tutorial has been placed in a separate folder named 'tut##', where ## is a number (e.g., 'tut01') that corresponds to video## from Brian's course. I have set up the folders so that you can run the PureScript code samples for the first time with
bower update && pulp run, then
pulp run from then on (explained below). You will also find the accompanying tutorial markdown (e.g., tut01/README.md) which illustrates the abstraction from Brian's corresponding video (e.g. video1) and how to implement it in PureScript.
Get up and running in PureScript
You can skip this section if you've already installed and are using PureScript on your computer.
Install PureScript and its supporting actorsSee Getting Started with PureScript
Seriously? Don't you have 10-minutes to review the career changing Getting Started with PureScript? Well then I wash my hands or (as Japanese would have it, my feet) of all responsibility for the results. All kidding aside:
npm install -g purescript pulp bower
Run your first PureScript program
Assuming you've installed PureScript, Pulp, and Bower, then it doesn't get any easier than this to start your adventure in functional programming with PureScript:
Pulp is an excellent build tool with plenty of helper options; such as watching for source file updates and re-compiling them automatically. As you add more library dependencies to your program, you can install them with
$ mkdir purescript-hello $ cd purescript-hello $ pulp init $ pulp run
bower install purescript-lists –save)
My Favorite PureScript tools & references
- PureScript by Example by Phil Freeman the author of the PureScript language
- Pursuit is the home of PureScript documentation; soon to become your best friend
- Try PureScript allows you to try key examples of PureScript in the browser. You can also create your own.
- psc-ide (distributed with the compiler) provides editor support, including atom, emacs, vim, and visual studio
> Tutorial 1
I'll add additional links as I write the tutorials. But If you would like to look ahead, then the majority of the code samples from Brian's videos are available on Github. But I may amend them as I write the accompanying tutorial markdown.
Originally published on github.com