~/talk

Types as Program Specifications: A Intro to Type-Level Programming in Haskell

Talkat LambdaConf 2019 · 2019-06-05..06-07· [typescript]
links:none on file
slides:none on file

Argues that types serve as executable specifications and shows how to embed invariants in GHC using language extensions: GADTs, DataKinds, TypeFamilies (plus KindSignatures, multi‑param type classes, phantom types). Builds a typed AST evaluator that cannot express ill‑formed programs, length‑indexed lists with append and head/tail, and Peano naturals with type‑level add/multiply; many exercises (1–5) guide the steps. Compilation and reductions happen at compile time, some solutions need UndecidableInstances and careful kind polymorphism to avoid gnarly type errors.

AI-written summary · about

  1. 0:00Start
  2. 3:24Overview
  3. 4:05First Class Type Families
  4. 4:35What Is the Specification
  5. 5:11What Is the Type
  6. 5:51Values Types and Kinds
  7. 7:08Prerequisite Knowledge
  8. 7:20Static versus Dynamic Type Systems
  9. 8:11What Haskell Is
  10. 9:13Language Extensions
  11. 13:16Type Constructors
  12. 16:26Kind Signatures
  13. 20:47A Phantom Type
  14. 24:39Conversion Function
  15. 27:46Type Signature
  16. 30:13Generalized Algebraic Data Types
  17. 30:30Algebraic Data Types
  18. 36:51Motivation for Generalized Andrei Data Types
  19. 1:01:10Solution
  20. 1:05:34Type Families
  21. 1:10:49Or Type Family
  22. 1:17:54Kind Inference
  23. 1:26:17Peano Axioms
  24. 1:27:14Type Level Natural Numbers
  25. 1:37:37Type Operators
  26. 1:45:45Length Index Lists
  27. 1:46:44Live Coding
  28. 1:48:13Base Case
  29. 1:50:07Append Two Lists
  30. 1:52:16Append To List
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.