Typed Clojure
summary
Typed Clojure implements optional static type checking for Clojure as a library that plugs into the Clojure compiler AST, reusing Java type info and a Typed Racket–inspired type system. It provides union/intersection types, occurrence typing, dotted variable-arity polymorphism, heterogeneous map types, and a database of non-nil return assumptions to make Java interop null-safe Java interop and array-covariance safe. Workflow uses check-ns and cf check; it runs against unmodified code with annotations, mostly works, and revealed a few bugs during development.
AI-written summary · about
chapters (22)
- 0:00Intro
- 0:31Verifying Clojure code
- 1:21Why static typing?
- 2:11Goals
- 3:22Existing Work: Typed Racket
- 4:21Typed Clojure
- 5:09Overview
- 6:21Getting started
- 6:42Running the checker
- 7:21What to annotate
- 8:09Annotating vars
- 9:32Annotating functions
- 12:03Union & Intersection types
- 14:30Type aliases
- 15:57Universal Quantification
- 16:14Instantiating type parameters
- 17:12Function types
- 20:00Occurrence Typing
- 24:24Variable-arity
- 32:58Datatypes & Protocols
- 35:19Java Interoperability
- 38:51Static Debugging








