Skip to content

kylehovey/a-tour-of-haskell

Repository files navigation

A Tour of Haskell

dithered-image

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.

Setting Up Your Environment

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 with stack build or simply run it with stack run.
  • cabal - Haskell's library manager, which stack uses behind the scenes.
  • ghc - The Haskell compiler, which also comes with a repl ghci 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.

Setting Up This Project

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.

Intended Order of Modules

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:

  1. src/ADT.hs
  2. src/Pattern.hs
  3. src/Typeclass.hs
  4. src/Functor.hs
  5. src/Applicative.hs
  6. src/Monad.hs
  7. Main.hs
  8. Reader.hs

Running the Presentation

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.

External Resources

Philisophical Posts

  • 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

Learning Resources

Academic Stuff

About

Slides and resources for my talk on Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published