Hello World

This folder will document everything necessary to create a simple console-based program in Purescript. It will explain:

  • The philosophical foundations of FP programming
  • The Prelude library (including Functor, Apply, Applicative, Bind, and Monad explanations)
  • A simple "Hello World" program and other Effects
  • Custom Compiler Warnings/Errors
  • The difference between Local Mutable State vs Global Mutable State
  • How to test code
  • How to benchmark / profile code
  • How to structure an FP application
  • An overview of various type-level programming libraries
  • A few console-based games written in Purescript (putting it all together)

While you may not be at the top of this Haskell Competency Matrix by the end of this repo, you will have taken a significant step towards that direction. This repo will not explain how to write algorithms in a performant way using an FP language. Consider reading Algorithm Design with Haskell which does teach algorithms using an FP language.

In pursuing these goals, it will overview the following libraries:

  • Basic
    • Prelude
    • Prim.TypeError
  • Effects
    • Effect
    • Console
    • Random
    • Aff
  • State
    • ST
    • Refs
  • Testing
    • Spec
    • Quick Check
    • Quick Check Laws
  • Benchmarking
    • Benchotron
  • Advanced
    • Variant/VariantF
    • MTL
    • Free
    • Run
  • UIs
    • Node ReadLine
    • Halogen

Other Learning Resources

Besides this repo, we have a few choices in terms of understanding functional programming. These are not necessarily "either X or Y or Z" choices but could be "X supplemented by Y with a little bit of Z")

Purescript

  • The Purescript By Example book. (See ROOT_FOLDER/Getting Started/Other Important Info.md for links and clarifications around it)
  • Purescript Resources - Justin Woo's Read the Docs (RTD) work

JavaScript

Make the Leap from JavaScript to PureScript

Haskell

Since Purescript is heavily inspired by and very similar to Haskell, one can learn a lot about Purescript by learning from these Haskell learning resources. Note: the Haskell names and type classes do not always correspond to the Purescript versions.

ActionProsCons
Read the documentation and source code for a type class and a few data types' implementations of said type classesFreeTakes a lot of time; requires intuition to understand type class' usefulness / relation to others.
Read through the articles on or pay for training from FP Complete's opinionated Haskell websiteFree / Paid(Haven't done it so I don't know)
Read through the intermediate-level Haskell articles in the Applied Haskell 2018 GitHub RepoFree(Haven't done it so I don't know)
Read through some of the free course materials taught by someone well informed about Haskell here (you'll need to scroll towards the bottom)Free; more principled explanationsLooking at just slides without hearing someone teach using them is not usually as clear as when someone does teach using them or reading through a textbook on the same matter.
Read through the extremely lengthy "What I wish I knew when learning Haskell" siteFree; provides a better overview of basic to advanced topicsVery long; not necessarily deep and clear in its explanations
Read and do the exercises from The Haskell BookThe "standard" for teaching Haskell and FP concepts in general: good explanations; good exercises; teaches "programming in the small"Costs money; costs time; the exercises will stretch you
Read and do the exercises from Haskell Cookbook, and then its follow up book Haskell Cookbook 2Free/Cheap; simpler than the Haskell book; gets to ideas faster; teaches "programming in the large"May be harder for a new beginner (I haven't read it yet)
Watch the Intro to FP course on edX.org hereFree (or paid)(Haven't done it so I don't know)
Read the relevant chapters from Learn You a Haskell for Great GoodFreeI read elsewhere that it's "outdated". See this Reddit comment's warning about learning from LYAHH