Skip to content

Labs

Labs are in-class, hands-on sessions — mostly working directly in ghci, with the occasional file to edit. They're meant to be done live, ideally with a partner or grutor nearby to ask questions.

  • Lab 1: Getting Connected and Running Haskell — connect to the CS 131 server from a terminal and through VS Code, open a terminal on the server, start ghci, and create and load your first .hs file.
  • Lab 2: GHCi Basics — your first real time in ghci: run expressions, read what Haskell tells you, and practice predicting an output before you run it. Uses functions from Module 02.1 and 02.2 plus a few new ones (filter, reverse, show, sort).
  • Lab 3: Tuples, Stacks, and Currying — a ghci session on pairs, list-based stacks, and currying/uncurrying — mostly comparing multiple correct implementations of the same idea.
  • Lab 4: Boolean Expressions — completing eval and prettyPrint functions for a small boolean-expression datatype, the same evaluator/formatter pattern that shows up again in Module 04.1/04.2.

Coming soon

Labs will be posted here as the semester develops. Each one will be linked from the schedule on the day it runs.