Optional typing in Clojure, as a library.
core.typed supports up to Clojure 1.10. Clojure 1.11 introduced new destructuring expansion that is only supported by typedclojure.
Further feature development has been moved to the typedclojure repository
which was forked from this repository at core.typed 1.0.1
.
See here for upgrading instructions.
core.typed 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.clojure.typed/runtime.jvm {:mvn/version "1.0.1"}}
:aliases {:dev {:extra-deps {org.clojure.typed/checker.jvm {:mvn/version "1.0.1"}}}}}
You can then start a dev repl with clj -A:dev
.
In Leiningen's project.clj
, something like this:
(defproject a-project "0.0.1-SNAPSHOT"
:dependencies [[org.clojure.typed/runtime.jvm "1.0.1"]]
:profiles {:dev {:dependencies [[org.clojure.typed/checker.jvm "1.0.1"]]}})
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.0.1.
See modules for specific version coordinates:
- checker.jvm: The JVM type checker
- runtime.jvm: JVM Runtime dependencies
- analyzer.jvm: Analyzer for JVM Clojure
- analyzer.js: Analyzer for JS Clojure (unreleased)
- checker.js: The JS type checker (unreleased)
- analyzer.common: Implementation-agnostic base for Clojure analyzers
- lib.clojure: Base type annotations
- lib.core.async: Annotations for core.async
- annotator.jvm: Automatic annotator
- lang.jvm: Extensible languages
core.typed
supports Clojure 1.10.1 and JDK 1.8+.
Use the core.typed mailing list for core.typed discussion.
See wiki.
core.async Rock-paper-scissors
- Typed Clojure Contributor Code of Conduct
- Contributing guidelines
- GitHub Project
- Bug Tracker
- Continuous Integration
- Compatibility Test Matrix
Thanks to the following people for contributing to core.typed:
- Stephen Compall (S11001001)
- Andrew Brehaut (brehaut)
- Christopher Spencer (cspencer)
- Reid McKenzie (arrdem)
- Di Xu (xudifsd)
- Nicola Mometto (Bronsa)
- Chas Emerick (cemerick)
- Jake Goulding (shepmaster)
- Andy Fingerhut
- Aravind K N (arav93)
- Allen Rohner (arohner)
- Minori Yamashita (ympbyc)
- Kyle Kingsbury (aphyr)
- Nathan Sorenson
- Tobias Kortkamp (t6)
- Alejandro Gomez (dialelo)
- Piotr Jarzemski (kazuhiro)
Thanks to the following companies for their active sponsorship of Typed Clojure's development via OpenCollective.
YourKit is kindly supporting core.typed and other open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of innovative and intelligent tools for profiling Java and .NET applications. Take a look at YourKit's leading software products:
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).