Typed Clojure, an optional type system for Clojure

Getting started

Clojure

Clojure, with types

Typed Clojure preserves Clojure's strengths, enhancing many of them with the safety of static type checking.

core.typed on Github »


Sponsored by


Safer Host Interop. Keep Java in line.

Protect your Clojure programs from Java by using Typed Clojure to help use external Java libraries correctly.

Watch how Java interop works
Java Horrors

Clojure maps

Idiomatic structural typing. Use plain maps with confidence.

Typed Clojure has great support for checking usages of keyword maps. Useful map operations are understood by the type checker, including keyword lookups, adding/removing keys and merging maps.

Watch a hangout on Heterogeneous Maps

Local flow reasoning. Check regular Clojure code.

Typed Clojure uses simple yet inexpensive and effective inference techniques to reason about local program flow.

Read about occurrence typing
Typed Clojure understands conditionals

Infer let bindings

Local type inference. Simple, predictable.

Typed Clojure supports local type inference similar to Scala. Annotations are required for top-level vars, complicated macros, and loop/function parameters, while many other things can be inferred, like local let bindings, including nested destructuring and function return types.

Read about inference in Typed Clojure

Type checking as a function. Truly à la carte.

Type checking is never run implicitly as part of evaluation. Typed Clojure provides a simple interface of functions to run the type checker: use them at the REPL, in a unit test, at the command line, integrate it with your IDE ... the choice is yours!

See the Typed Clojure Leiningen plugin
Run the type checker when you want