Home

Awesome

core.typed

<a href='https://typedclojure.org'><img src='doc/images/part-of-typed-clojure-project.png'></a>

<p> <a href='https://www.patreon.com/ambrosebs'><img src='doc/images/become_a_patron_button.png'></a> <a href='https://opencollective.com/typedclojure'><img src='doc/images/donate-to-our-collective.png'></a> </p>

Optional typing in Clojure, as a library.

NEW REPO -- core.typed is deprecated as of Clojure 1.11

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.

Usage Overview

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.

Releases and Dependency Information

Latest stable release is 1.0.1.

See modules for specific version coordinates:

Core type system

Library Annotations

Utility libraries

Compatibility

core.typed supports Clojure 1.10.1 and JDK 1.8+.

Mailing List and IRC

Use the core.typed mailing list for core.typed discussion.

Documentation

See wiki.

API Reference

Ambrose's blog

Leiningen Plugin

lein-typed

Vim Plugin

vim-typedclojure

Emacs Mode

typed-clojure-mode

Examples

core.async Rock-paper-scissors

Developer Information

<!--- ## Future work * Equality filters for occurrence typing * Unify AST with ClojureScript * Namespace dependency management * Track changes to Typed Racket * https://github.com/plt/racket/compare/6105ce8b2087...71d6189132ce -->

Contributors

Thanks to the following people for contributing to core.typed:

Sponsors

Thanks to the following companies for their active sponsorship of Typed Clojure's development via OpenCollective.

<div> <div> <a href="https://www.adgoji.com/"> <img src="https://typedclojure.org/images/sponsors/adgoji.png" alt="Adgoji"> </a> </div> </div>

YourKit

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:

License

Copyright © Ambrose Bonnaire-Sergeant, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer.jvm

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).

tools.analyzer.js

Copyright © Nicola Mometto, Rich Hickey & contributors.

Licensed under the EPL (see the file epl-v10.html).