API for clojure.core.typed - Gradual Typing 0.2.45 (in development)


Full namespace name: clojure.core.typed

Overview





Public Variables and Functions



*collect-on-eval*

dynamic var

    
If a true value, global annotations are collected by the
type checker when their respective forms are evaluated (eg. ann).
Deprecated since Gradual Typing version true
Source


*verbose-forms*

dynamic var

    
If true, print complete forms in error messages. Bind
around a type checking form like cf or check-ns.

eg.
(binding [*verbose-forms* true]
  (cf ['deep ['deep ['deep ['deep]]]] Number))
;=> <full form in error>
Source


*verbose-types*

dynamic var

    
If true, print fully qualified types in error messages
and return values. Bind around a type checking form like 
cf or check-ns.

eg. 
(binding [*verbose-types* true] 
  (cf 1 Number))
;=> java.lang.Number
Source


Agent1

type alias
Usage: (Agent1 t)
An agent that can read and write type x.

(TFn [[x :variance :invariant]] (clojure.lang.Agent x x))


Agent2

type alias
Usage: (Agent2 t t)
An agent that can write type w and read type r.

(TFn
 [[w :variance :contravariant] [r :variance :covariant]]
 (clojure.lang.Agent w r))


AnyInteger

type alias
Usage: AnyInteger
A type that returns true for clojure.core/integer?

(U Integer Long clojure.lang.BigInt BigInteger Short Byte)


Atom1

type alias
Usage: (Atom1 t)
An atom that can read and write type x.

(TFn [[x :variance :invariant]] (clojure.lang.Atom x x))


Atom2

type alias
Usage: (Atom2 t)
An atom that can write type w and read type r.

(TFn
 [[w :variance :contravariant] [r :variance :covariant]]
 (clojure.lang.Atom w r))


BlockingDeref

type alias
Usage: (BlockingDeref t)
A Clojure blocking derefable (see clojure.core/deref).

(TFn [[x :variance :covariant]] (clojure.lang.IBlockingDeref x))


Coll

type alias
Usage: (Coll t)
A persistent collection with member type x.

(TFn [[x :variance :covariant]] (clojure.lang.IPersistentCollection x))


Delay

type alias
Usage: (Delay t)
A Clojure delay (see clojure.core/{delay,force}).

(TFn [[x :variance :covariant]] (clojure.lang.Delay x))


Deref

type alias
Usage: (Deref t)
A Clojure derefable (see clojure.core/deref).

(TFn [[x :variance :covariant]] (clojure.lang.IDeref x))


EmptyCount

type alias
Usage: EmptyCount
The type of all things with count 0. Use as part of an intersection.
eg. See EmptySeqable.

(ExactCount 0)


EmptySeqable

type alias
Usage: (EmptySeqable t)
A type that can be used to create a sequence of member type x
with count 0.

(TFn
 [[x :variance :covariant]]
 (I (clojure.lang.Seqable x) (ExactCount 0)))


ExInfo

type alias
Usage: ExInfo
A Clojure custom exception type.

(I clojure.lang.IExceptionInfo RuntimeException)


Future

type alias
Usage: (Future t)
A Clojure future (see clojure.core/{future-call,future}).

(TFn
 [[x :variance :covariant]]
 (Extends
  [(clojure.lang.IDeref x)
   (clojure.lang.IBlockingDeref x)
   clojure.lang.IPending
   java.util.concurrent.Future]))


Hierarchy

type alias
Usage: Hierarchy
A hierarchy for use with derive, isa? etc.

'{:parents (clojure.lang.IPersistentMap Any Any),
  :ancestors (clojure.lang.IPersistentMap Any Any),
  :descendants (clojure.lang.IPersistentMap Any Any)}


Id

type alias
Usage: Id
The identity function at the type level.

(TFn [[x :variance :covariant]] x)


Int

type alias
Usage: Int
A type that returns true for clojure.core/integer?

(U Integer Long clojure.lang.BigInt BigInteger Short Byte)


Keyword

type alias
Usage: Keyword
A keyword

clojure.lang.Keyword


List

type alias
Usage: (List t)
A Clojure persistent list.

(TFn [[x :variance :covariant]] (clojure.lang.IPersistentList x))


Map

type alias
Usage: (Map t t)
A persistent map with keys k and vals v.

(TFn
 [[k :variance :covariant] [v :variance :covariant]]
 (clojure.lang.IPersistentMap k v))


Multi

type alias
Usage: Multi
A Clojure multimethod.

clojure.lang.MultiFn


Namespace

type alias
Usage: Namespace
A namespace

clojure.lang.Namespace


Nilable

type alias
Usage: (Nilable t)
A union of x and nil.

(TFn [[x :variance :covariant]] (U nil x))


NilableNonEmptySeq

type alias
Usage: (NilableNonEmptySeq t)
A persistent sequence of member type x with count greater than 0, or nil.

(TFn
 [[x :variance :covariant]]
 (U nil (I (clojure.lang.ISeq x) (CountRange 1))))


NonEmptyColl

type alias
Usage: (NonEmptyColl t)
A persistent collection with member type x and count greater than 0.

(TFn
 [[x :variance :covariant]]
 (I (clojure.lang.IPersistentCollection x) (CountRange 1)))


NonEmptyCount

type alias
Usage: NonEmptyCount
The type of all things with count greater than 0. Use as part of an intersection.
eg. See NonEmptySeq

(CountRange 1)


NonEmptyLazySeq

type alias
Usage: (NonEmptyLazySeq t)
A non-empty lazy sequence of type t

(TFn
 [[t :variance :covariant]]
 (I (clojure.lang.LazySeq t) (CountRange 1)))


NonEmptySeq

type alias
Usage: (NonEmptySeq t)
A persistent sequence of member type x with count greater than 0.

(TFn
 [[x :variance :covariant]]
 (I (clojure.lang.ISeq x) (CountRange 1)))


NonEmptySeqable

type alias
Usage: (NonEmptySeqable t)
A type that can be used to create a sequence of member type x
with count greater than 0.

(TFn
 [[x :variance :covariant]]
 (I (clojure.lang.Seqable x) (CountRange 1)))


NonEmptyVec

type alias
Usage: (NonEmptyVec t)
A persistent vector with member type x and count greater than 0.

(TFn
 [[x :variance :covariant]]
 (I (clojure.lang.IPersistentVector x) (CountRange 1)))


Num

type alias
Usage: Num
A type that returns true for clojure.core/number?

Number


Option

type alias
Usage: (Option t)
A union of x and nil.

(TFn [[x :variance :covariant]] (U nil x))


Promise

type alias
Usage: (Promise t)
A Clojure promise (see clojure.core/{promise,deliver}).

(TFn
 [[x :variance :invariant]]
 (Rec
  [p]
  (I
   (Extends
    [(clojure.lang.IDeref x)
     (clojure.lang.IBlockingDeref x)
     clojure.lang.IPending])
   [x -> (U nil p)])))


Proxy

type alias
Usage: Proxy
A Clojure proxy.

clojure.lang.IProxy


Ref1

type alias
Usage: (Ref1 t)
A ref that can read and write type x.

(TFn [[x :variance :invariant]] (clojure.lang.Ref x x))


Ref2

type alias
Usage: (Ref2 w r)
A ref that can write type w and read type r.

(TFn
 [[w :variance :contravariant] [r :variance :covariant]]
 (clojure.lang.Ref w r))


Reversible

type alias
Usage: (Reversible t)
A Clojure reversible collection.

(TFn [[x :variance :covariant]] (clojure.lang.Reversible x))


Seq

type alias
Usage: (Seq t)
A persistent sequence of member type x.

(TFn [[x :variance :covariant]] (clojure.lang.ISeq x))


Seqable

type alias
Usage: (Seqable t)
A type that can be used to create a sequence of member type x.

(TFn [[x :variance :covariant]] (clojure.lang.Seqable x))


Set

type alias
Usage: (Set t)
A persistent set with member type x

(TFn [[x :variance :covariant]] (clojure.lang.IPersistentSet x))


SortedSet

type alias
Usage: (SortedSet t)
A sorted persistent set with member type x

(TFn
 [[x :variance :covariant]]
 (Extends [(clojure.lang.IPersistentSet x) clojure.lang.Sorted]))


Stack

type alias
Usage: (Stack t)
A Clojure stack.

(TFn [[x :variance :covariant]] (clojure.lang.IPersistentStack x))


Symbol

type alias
Usage: Symbol
A symbol

clojure.lang.Symbol


Var1

type alias
Usage: (Var1 t)
An var that can read and write type x.

(TFn [[x :variance :invariant]] (clojure.lang.Var x x))


Var2

type alias
Usage: (Var2 w r)
An var that can write type w and read type r.

(TFn
 [[w :variance :contravariant] [r :variance :covariant]]
 (clojure.lang.Var w r))


Vec

type alias
Usage: (Vec t)
A persistent vector with member type x.

(TFn [[x :variance :covariant]] (clojure.lang.IPersistentVector x))


ann

macro
Usage: (ann varsym typesyn)
Annotate varsym with type. If unqualified, qualify in the current namespace.
If varsym has metadata {:no-check true}, ignore definitions of varsym 
while type checking.

If annotating vars in namespaces other than the current one, a fully
qualified symbol must be provided. Note that namespace aliases are not
recognised: the *full* namespace must be given in the first part of the symbol.

eg. ; annotate the var foo in this namespace
    (ann foo [Number -> Number])

    ; annotate a var in another namespace
    (ann another.ns/bar [-> nil])
 
    ; don't check this var
    (ann ^:no-check foobar [Integer -> String])
Source


ann-datatype

macro
Usage: (ann-datatype dname [field :- type*] opts*)
       (ann-datatype binder dname [field :- type*] opts*)
Annotate datatype Class name dname with expected fields.
If unqualified, qualify in the current namespace.
Takes an optional type variable binder before the name.

Fields must be specified in the same order as presented 
in deftype, with exactly the same field names.

Also annotates datatype factories and constructors.

Binder is a vector of specs. Each spec is a vector
with the variable name as the first entry, followed by
keyword arguments:
- :variance (mandatory)
  The declared variance of the type variable. Possible
  values are :covariant, :contravariant and :invariant.
- :< (optional)
  The upper type bound of the type variable. Defaults to
  Any, or the most general type of the same rank as the
  lower bound.
- :> (optional)
  The lower type bound of the type variable. Defaults to
  Nothing, or the least general type of the same rank as the
  upper bound.

eg. ; a datatype in the current namespace
    (ann-datatype MyDatatype [a :- Number,
                              b :- Long])

    ; a datatype in another namespace
    (ann-datatype another.ns.TheirDatatype
                  [str :- String,
                   vec :- (Vec Number)])

    ; a datatype, polymorphic in a
    (ann-datatype [[a :variance :covariant]]
                  MyPolyDatatype
                  [str :- String,
                   vec :- (Vec Number)
                   ply :- (Set a)])
Source


ann-form

macro
Usage: (ann-form form ty)
Annotate a form with an expected type.
Source


ann-many

macro
Usage: (ann-many t & vs)
Annotate several vars with type t.

eg. (ann-many FakeSearch
              web1 web2 image1 image2 video1 video2)
Source


ann-precord

macro
Usage: (ann-precord dname vbnd fields & {ancests :unchecked-ancestors, rplc :replace, :as opt})
Annotate record Class name dname with a polymorphic binder and expected fields.
If unqualified, qualify in the current namespace.
Source


ann-protocol

macro
Usage: (ann-protocol vbnd varsym & methods)
       (ann-protocol varsym & methods)
Annotate a possibly polymorphic protocol var with method types.

eg. (ann-protocol IFoo
      bar
      [IFoo -> Any]
      baz
      [IFoo -> Number])
    (defprotocol> IFoo
      (bar [this])
      (baz [this]))

    ; polymorphic protocol
    ; x is scoped in the methods
    (ann-protocol [[x :variance :covariant]]
      IFooPoly
      bar
      [(IFooPoly x) -> Any]
      baz
      [(IFooPoly x) -> Number])
    (defprotocol> IFooPoly
      (bar [this])
      (baz [this]))
Source


ann-record

macro
Usage: (ann-record dname [field :- type*] opts*)
       (ann-record binder dname [field :- type*] opts*)
Annotate record Class name dname with expected fields.
If unqualified, qualify in the current namespace.
Takes an optional type variable binder before the name.

Fields must be specified in the same order as presented 
in defrecord, with exactly the same field names.

Also annotates record factories and constructors.

Binder is a vector of specs. Each spec is a vector
with the variable name as the first entry, followed by
keyword arguments:
- :variance (mandatory)
  The declared variance of the type variable. Possible
  values are :covariant, :contravariant and :invariant.
- :< (optional)
  The upper type bound of the type variable. Defaults to
  Any, or the most general type of the same rank as the
  lower bound.
- :> (optional)
  The lower type bound of the type variable. Defaults to
  Nothing, or the least general type of the same rank as the
  upper bound.

eg. ; a record in the current namespace
    (ann-record MyRecord [a :- Number,
                          b :- Long])

    ; a record in another namespace
    (ann-record another.ns.TheirRecord
                  [str :- String,
                   vec :- (Vec Number)])

    ; a record, polymorphic in a
    (ann-record [[a :variance :covariant]]
                MyPolyRecord
                [str :- String,
                 vec :- (Vec Number)
                 ply :- (Set a)])
Source


atom>

macro
Usage: (atom> t init & args)
Like atom, but creates an Atom1 of type t.

Same as (atom (ann-form init t) args*)

eg. (atom> Number 1)
    (atom> (Vec Any) [])
Source


cf

macro
Usage: (cf form)
       (cf form expected)
Takes a form and an optional expected type and
returns a human-readable inferred type for that form.
Throws an exception if type checking fails.

Do not use cf inside a typed namespace. cf is intended to be
used at the REPL or within a unit test. Note that testing for
truthiness is not sufficient to unit test a call to cf, as nil
and false are valid type syntax.

cf preserves annotations from previous calls to check-ns or cf,
and keeps any new ones collected during a cf. This is useful for
debugging and experimentation. cf may be less strict than check-ns
with type checker warnings.

eg. (cf 1) 
    ;=> Long

    (cf #(inc %) [Number -> Number])
    ;=> [Number -> Number]
Source


check-form*

function
Usage: (check-form* form)
       (check-form* form expected)
       (check-form* form expected type-provided?)
Takes a (quoted) form and optional expected type syntax and
type checks the form. If expected is provided, type-provided?
must be true.
Source


check-form-info

function
Usage: (check-form-info form & {:keys [expected type-provided? profile]})
Alpha - subject to change

Type checks a (quoted) form and returns a map of results from type checking the
form.

Options
- :expected        Type syntax representing the expected type for this form
                   type-provided? option must be true to utilise the type.
- :type-provided?  If true, use the expected type to check the form
- :profile         Use Timbre to profile the type checker. Timbre must be
                   added as a dependency.
Source


check-ns

function
Usage: (check-ns)
       (check-ns ns-or-syms & {:keys [collect-only trace profile], :as kw})
Type check a namespace/s (a symbol or Namespace, or collection).
If not provided default to current namespace.
Returns a true value if type checking is successful, otherwise
throws an Exception.

Do not use check-ns within a checked namespace.
It is intended to be used at the REPL or within a unit test.
Suggested idiom for clojure.test: (is (check-ns 'your.ns))

check-ns resets annotations collected from 
previous check-ns calls or cf. A successful check-ns call will
preserve any type annotations collect during that checking run.

Keyword arguments:
- :collect-only  if true, collect type annotations but don't type check code.
                 Useful for debugging purposes.
- :trace         if true, print some basic tracing of the type checker
- :profile       if true, use Timbre to profile type checking. Must include
                 Timbre as a dependency.

If providing keyword arguments, the namespace to check must be provided
as the first argument.

Bind *verbose-types* to true to print fully qualified types.
Bind *verbose-forms* to print full forms in error messages.

eg. (check-ns 'myns.typed)
    ;=> :ok
   
    ; implicitly check current namespace
    (check-ns)
    ;=> :ok

    ; collect but don't check the current namespace
    (check-ns *ns* :collect-only true)
Source


check-ns-info

function
Usage: (check-ns-info)
       (check-ns-info ns-or-syms & {:keys [collect-only trace profile]})
Alpha - subject to change

Same as check-ns, but returns a map of results from type checking the
namespace.
Source


declare-alias-kind

macro
Usage: (declare-alias-kind sym ty)
Declare a kind for an alias, similar to declare but on the kind level.
Source


declare-datatypes

macro
Usage: (declare-datatypes & syms)
Declare datatypes, similar to declare but on the type level.
Source


declare-names

macro
Usage: (declare-names & syms)
Declare names, similar to declare but on the type level.
Source


declare-protocols

macro
Usage: (declare-protocols & syms)
Declare protocols, similar to declare but on the type level.
Source


def-alias

macro
Usage: (def-alias sym doc-str t)
       (def-alias sym t)
Define a type alias. Takes an optional doc-string as a second
argument.

Updates the corresponding var with documentation.

eg. (def-alias MyAlias
      "Here is my alias"
      (U nil String))
Source


def>

macro
Usage: (def> name docstring? :- type expr)
Like def, but with annotations.

eg. (def> vname :- Long 1)

;doc
(def> vname
  "Docstring"
  :- Long
  1)
Source


defn>

macro
Usage: (defn> name docstring? :- type [param :- type *] exprs*)
       (defn> name docstring? (:- type [param :- type *] exprs*) +)
Like defn, but with annotations. Annotations are mandatory for
parameters and for return type.

eg. (defn> fname :- Integer [a :- Number, b :- (U Symbol nil)] ...)

;annotate return
(defn> :- String [a :- String] ...)

;named fn
(defn> fname :- String [a :- String] ...)

;multi-arity
(defn> fname 
  (:- String [a :- String] ...)
  (:- Long   [a :- String, b :- Number] ...))
Source


doseq>

macro
Usage: (doseq> seq-exprs & body)
Like doseq but requires annotation for each loop variable: 
[a [1 2]] becomes [a :- Long [1 2]]

eg.
(doseq> [a :- (U nil AnyInteger) [1 nil 2 3]
         :when a]
   (inc a))
Source


dotimes>

macro
Usage: (dotimes> bindings & body)
Like dotimes.

eg. (dotimes> [_ 100]
      (println "like normal"))
Source


fn

macro
Usage: (fn name? :- type? [param :- type* & param :- type * ?] exprs*)
       (fn name? (:- type? [param :- type* & param :- type * ?] exprs*) +)
Like clojure.core/fn, but with optional annotations.

eg. ;these forms are equivalent
    (fn [a] b)
    (fn [a :- Any] b)
    (fn [a :- Any] :- Any b)
    (fn [a] :- Any b)

    ;annotate return
    (fn [a :- String] :- String body)

    ;named fn
    (fn fname [a :- String] :- String body)

    ;rest parameter
    (fn [a :- String & b :- Number *] body)

    ;dotted rest parameter
    (fn [a :- String & b :- Number ... x] body)

    ;multi-arity
    (fn fname 
      ([a :- String] :- String ...)
      ([a :- String, b :- Number] :- String ...))
Source


fn>

macro
Usage: (fn> name? :- type? [param :- type* & param :- type * ?] exprs*)
       (fn> name? (:- type? [param :- type* & param :- type * ?] exprs*) +)
DEPRECATED: use clojure.core.typed/fn

Like fn, but with annotations. Annotations are mandatory
for parameters, with optional annotations for return type.
If fn is named, return type annotation is mandatory.

Suggested idiom: use commas between parameter annotation triples.

eg. (fn> [a :- Number, b :- (U Symbol nil)] ...)

    ;annotate return
    (fn> :- String [a :- String] ...)

    ;named fn
    (fn> fname :- String [a :- String] ...)

    ;multi-arity
    (fn> fname 
      (:- String [a :- String] ...)
      (:- Long   [a :- String, b :- Number] ...))
Deprecated since Gradual Typing version true
Source


for>

macro
Usage: (for> tk ret-ann seq-exprs body-expr)
Like for but requires annotation for each loop variable: [a [1 2]] becomes [a :- Long [1 2]]
Also requires annotation for return type.

eg. (for> :- Number
      [a :- (U nil AnyInteger) [1 nil 2 3]
       :when a]
      (inc a))
Source


inst

macro
Usage: (inst inst-of & types)
Instantiate a polymorphic type with a number of types.

eg. (inst foo-fn t1 t2 t3 ...)
Source


inst-ctor

macro
Usage: (inst-ctor inst-of & types)
Instantiate a call to a constructor with a number of types.
First argument must be an immediate call to a constructor.
Returns exactly the instantiatee (the first argument).

eg. (inst-ctor (PolyCtor. a b c)
               t1 t2 ...)
Source


into-array>

macro
Usage: (into-array> cljt coll)
       (into-array> javat cljt coll)
       (into-array> into-array-syn javat cljt coll)
Make a Java array with Java class javat and Typed Clojure type
cljt. Resulting array will be of type javat, but elements of coll must be under
cljt. cljt should be a subtype of javat (the same or more specific).

*Temporary hack*
into-array-syn is exactly the syntax to put as the first argument to into-array.
Calling resolve on this syntax should give the correct class.
Source


letfn>

macro
Usage: (letfn> [fn-spec-or-annotation*] expr*)
Like letfn, but each function spec must be annotated.

eg. (letfn> [a :- [Number -> Number]
             (a [b] 2)

             c :- [Symbol -> nil]
             (c [s] nil)]
      ...)
Source


load-if-needed

function
Usage: (load-if-needed)
Load and initialize all of core.typed if not already
Source


loop>

macro
Usage: (loop> [binding :- type init*] exprs*)
Like loop, except loop variables require annotation.

Suggested idiom: use a comma between the type and the initial
expression.

eg. (loop> [a :- Number, 1
            b :- (U nil Number), nil]
      ...)
Source


method-type

function
Usage: (method-type mname)
Given a method symbol, print the core.typed types assigned to it.
Intended for use at the REPL.
Source


nilable-param

macro
Usage: (nilable-param msym mmap)
Override which parameters in qualified method msym may accept
nilable values. If the parameter is a parameterised type or
an Array, this also declares the parameterised types and the Array type as nilable.

mmap is a map mapping arity parameter number to a set of parameter
positions (integers). If the map contains the key :all then this overrides
other entries. The key can also be :all, which declares all parameters nilable.
Source


non-nil-return

macro
Usage: (non-nil-return msym arities)
Override the return type of fully qualified method msym to be non-nil.
Takes a set of relevant arities,
represented by the number of parameters it takes (rest parameter counts as one),
or :all which overrides all arities.

eg. ; must use full class name
    (non-nil-return java.lang.Class/getDeclaredMethod :all)
Source


override-constructor

macro
Usage: (override-constructor ctorsym typesyn)
Override all constructors for Class ctorsym with type.
Source


override-method

macro
Usage: (override-method methodsym typesyn)
Override type for qualified method methodsym.
Source


pfn>

macro
Usage: (pfn> & forms)
Define a polymorphic typed anonymous function.
(pfn> name? [binder+] :- type? [[param :- type]* & [param :- type *]?] exprs*)
(pfn> name? [binder+] (:- type? [[param :- type]* & [param :- type *]?] exprs*)+)
Source


pred

macro
Usage: (pred t)
Generate a flat (runtime) predicate for type that returns true if the
argument is a subtype of the type, otherwise false.

The current type variable and dotted type variable scope is cleared before parsing.

eg. ((pred Number) 1)
    ;=> true
Source


print-env

function
Usage: (print-env debug-str)
During type checking, print the type environment to *out*,
preceeded by literal string debug-str.
Source


print-filterset

function
Usage: (print-filterset debug-string frm)
During type checking, print the filter set attached to form, 
preceeded by literal string debug-string.
Returns nil.

eg. (let [s (seq (get-a-seqable))]
      (print-filterset "Here now" s))
Source


ref>

macro
Usage: (ref> t init & args)
Like ref, but creates a Ref1 of type t.

Same as (ref (ann-form init t) args*)

eg. (ref> Number 1)
    (ref> (Vec Any) [])
Source


reset-caches

function
Usage: (reset-caches)
Reset internal type caches.
Source


statistics

function
Usage: (statistics nsyms)
Takes a collection of namespace symbols and returns a map mapping the namespace
symbols to a map of data
Source


tc-ignore

macro
Usage: (tc-ignore & body)
Ignore forms in body during type checking
Source


typed-deps

macro
Usage: (typed-deps & args)
Declare namespaces which should be checked before the current namespace.
Accepts any number of symbols. Only has effect via check-ns.

eg. (typed-deps clojure.core.typed.holes
                myns.types)
Source


var-coverage

function
Usage: (var-coverage)
       (var-coverage nsyms-or-nsym)
Summarises annotated var coverage statistics to *out*
for namespaces nsyms, a collection of symbols or a symbol/namespace.
Defaults to the current namespace if no argument provided.
Source


var>

macro
Usage: (var> sym)
Like var, but resolves at runtime like ns-resolve and is understood by
the type checker. sym must be fully qualified (without aliases).

eg. (var> clojure.core/+)
Source


warn-on-unannotated-vars

macro
Usage: (warn-on-unannotated-vars)
Allow unannotated vars in the current namespace. 

Emits a warning instead of a type error when checking
a def without a corresponding expected type.

eg. (warn-on-unannotated-vars)
Source


when-let-fail

macro
Usage: (when-let-fail b & body)
Like when-let, but fails if the binding yields a false value.
Source

clojure.core.typed.async

This namespace contains annotations and helper macros for type
checking core.async code. Ensure clojure.core.async is require'd
before performing type checking.

go
  use go>

chan
  use chan>

buffer
  use buffer> (similar for other buffer constructors)


clojure.core.typed.hole

This namespace contains easy tools for hole driven development
See also: Hole Driven Development

Types



NoisyHole

type

    Fields: []
Protocols:
Interfaces:

Public Variables and Functions



->NoisyHole

function
Usage: (->NoisyHole)
Positional factory function for class clojure.core.typed.hole.NoisyHole.
Source


noisy-hole

function
Usage: (noisy-hole)
A noisy hole. The type system will complain when
(noisy-hole) is used in positions that expect a type
more specific than Object or Any.
Use (noisy-hole) as a placeholder for code.
Throws an exception when evaluted.
Source


silent-hole

function
Usage: (silent-hole)
A silent hole. (silent-hole) passes for any other type
when type checking.
Use (silent-hole) as a placeholder for code.
Throws an exception when evaluted.
Source

clojure.core.typed.internal





Public Variables and Functions



parse-fn*

function
Usage: (parse-fn* is-poly forms)
(fn name? [[param :- type]* & [param :- type *]?] :- type? exprs*)
(fn name? ([[param :- type]* & [param :- type *]?] :- type? exprs*)+)
Source


parse-fn>

function
Usage: (parse-fn> is-poly forms)
(fn> name? poly? :- type? [[param :- type]* & [param :- type *]?] exprs*)
(fn> name? poly? (:- type? [[param :- type]* & [param :- type *]?] exprs*)+)
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.