~/talk

Total Type Classes

Talkat Haskell 2025 · 2025-10-16..10-17· [functional-programming]
links:none on file
linkedin:nicolasgwu
slides:none on file

Identifies a pattern where type classes over data kinds are provably total and implements a GHC plugin that (1) verifies totality by doing exhaustiveness, termination, precondition checks, (2) injects placeholder evidence during typechecking, and (3) rewrites the typechecked program to add real constraint parameters and propagate them across calls and module boundaries. Demonstrates the rewrite for sing/Vector-style examples and effect-list catalogs, reports sound but incomplete checking (undecidable in general) and limitations with higher-rank types and some mutually recursive instance patterns.

AI-written summary · about

  1. 0:00Introduction
  2. 1:49Why total type classes matter
  3. 3:36Type-level naturals and vector length
  4. 5:20Formalizing total constraints
  5. 8:07Syntax and GHC plugin
  6. 9:13Checking totality
  7. 13:29Exhaustiveness and termination
  8. 16:37Rewriting with constraints
  9. 19:23Real-world applications
  10. 21:54Summary
  11. 22:15Question and answer session
~/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.