This repo contains resources that I use in my "A Tour of Haskell" talk. I use the files in here to give a live demonstration of how we use Haskell to encode our intents when we write code, and how we can work with the compiler to help us evolve our code safely. As a companion to this repo, I made a blog post going over everything I mention in the talk.
To set up a Haskell Environment to follow along, install ghcup using your package manager of choice. I personally recommend using ghcup tui
to get an interactive UI for installing:
stack
- Your Haskell project management tool. Use this to build your project withstack build
or simply run it withstack run
.cabal
- Haskell's library manager, whichstack
uses behind the scenes.ghc
- The Haskell compiler, which also comes with a replghci
or "GHC Interactive".hls
- Haskell's language server which integrates with modern IDE's to give you live errors, type hints, and documentation.
Make sure you not only install (i
) the versions recommended by ghcup tui
but also set (s
) them as the default.
Assuming you have set up your enviroment with ghcup
, you should be able to stack build
this project. Your IDE should also show you type hints if HLS is properly configured for your IDE.
In the live coding demo I go through the contents of the modules in this project to build an intuition for Haskell. The order I go through these modules is:
src/ADT.hs
src/Pattern.hs
src/Typeclass.hs
src/Functor.hs
src/Applicative.hs
src/Monad.hs
Main.hs
Reader.hs
The presentation is built using Marp and exists both as raw markdown source in presentation.md
and as a slide deck in presentation.html
. Unless you want to view the raw text, I recommend opening the HTML presentation in your browser after cloning this repo.
- Parse, Don't Validate - A post on how to think about type-driven development and encode your intent in your type system
- Pit of Success - One of my favorite analogies when thinking about language design and setting up projects for large teams
- Effective Haskell - A pragmatic approach to using Haskell productively by Rebecca Skinner
- Production Haskell - A wonderful guide to managing Haskell and using it for production web backends by Matt Parsons
- Learn You a Haskell for Great Good! - My favorite guide to learning Haskell that does not take itself too seriously
- Algorithm W Step by Step - A short guide on how to build Haskell's type system
- Types and Programming Languages - A great introduction to type systems