Optional typing in Clojure, as a library.
tldr; see the minimal example project for Typed Clojure setup.
Typed Clojure is separated into modules. You'll want the full type checker at development time, and the runtime dependencies in production.
In Clojure CLI's deps.edn, this will look something like this:
{:deps {org.typedclojure/typed.clj.runtime {:mvn/version "1.3.0"}}
:aliases {:dev {:extra-deps {org.typedclojure/typed.clj.checker {:mvn/version "1.3.0"}}}}}
You can then start a dev repl with clj -A:dev.
In Leiningen's project.clj, it will look something like this:
(defproject com.my-domain/a-project "1.0.0-SNAPSHOT"
:dependencies [[org.typedclojure/typed.clj.runtime "1.3.0"]]
:profiles {:dev {:dependencies [[org.typedclojure/typed.clj.checker "1.3.0"]]}})
Then, lein repl will automatically activate the :dev profile. Verify the type
checker is not included in uberjars with lein with-profile uberjar deps :tree.
Latest stable release is 1.3.0.
See modules for specific version coordinates:
Typed Clojure supports Clojure 1.12.3 and JDK 21+.
Use the core.typed mailing list for Typed Clojure discussion.
#core-typed on Clojurians Slack
See wiki.
Thanks to the following people for contributing to core.typed:
Copyright © Ambrose Bonnaire-Sergeant, Rich Hickey & contributors.
Licensed under the EPL (see the file epl-v10.html).
Copyright © Nicola Mometto, Rich Hickey & contributors.
Licensed under the EPL (see the file epl-v10.html).
Copyright © Nicola Mometto, Rich Hickey & contributors.
Licensed under the EPL (see the file epl-v10.html).
Copyright © Nicola Mometto, Rich Hickey & contributors.
Licensed under the EPL (see the file epl-v10.html).
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |