Public Variables and Functions
var
If true, print complete forms in error messages.
Source
*verbose-types*
var
If true, print fully qualified types in error messages
and return values.
Source
-base-aliases
var
Internal use only.
Source
-init-delayed-errors
function
Usage: (-init-delayed-errors)
Internal use only
Source
ann
macro
Usage: (ann varsym typesyn)
Annotate varsym with type. If unqualified, qualify in the current namespace.
If varsym has metadata {:nocheck true}, ignore definitions of varsym while type checking.
Source
ann*
function
Usage: (ann* varsym typesyn check?)
Internal use only. Use ann.
Source
ann-datatype
macro
Usage: (ann-datatype dname fields & {ancests :unchecked-ancestors, rplc :replace, :as opts})
Annotate datatype Class name dname with expected fields.
If unqualified, qualify in the current namespace.
Source
ann-datatype*
function
Usage: (ann-datatype* dname fields opts)
Internal use only. Use ann-datatype.
Source
macro
Usage: (ann-form form ty)
Annotate a form with an expected type.
Source
function
Usage: (ann-form* form ty)
Internal use only. Use ann-form.
Source
ann-pdatatype
macro
Usage: (ann-pdatatype dname vbnd fields & {ancests :unchecked-ancestors, rplc :replace, :as opt})
Annotate datatype Class name dname with a polymorphic binder and expected fields.
If unqualified, qualify in the current namespace.
Source
ann-pdatatype*
function
Usage: (ann-pdatatype* dname vbnd fields opt)
Internal use only. Use ann-pdatatype.
Source
ann-pprotocol
macro
Usage: (ann-pprotocol varsym vbnd & {:as mth})
Annotate polymorphic protocol with a polymorphic binder and method types.
Source
ann-pprotocol*
function
Usage: (ann-pprotocol* varsym vbnd mth)
Internal use only. Use ann-pprotocol.
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-precord*
function
Usage: (ann-precord* dname vbnd fields opt)
Internal use only. Use ann-precord.
Source
ann-protocol
macro
Usage: (ann-protocol varsym & {:as mth})
Annotate protocol var with method types.
eg. (ann-protocol IFoo
bar
[IFoo -> Any]
baz
[IFoo -> Number])
Source
ann-protocol*
function
Usage: (ann-protocol* varsym mth)
Internal use only. Use ann-protocol.
Source
ann-record
macro
Usage: (ann-record dname fields & {ancests :unchecked-ancestors, rplc :replace, :as opt})
Annotate record Class name dname with expected fields.
If unqualified, qualify in the current namespace.
Source
ann-record*
function
Usage: (ann-record* dname fields opt)
Internal use only. Use ann-record
Source
cf
macro
Usage: (cf form)
(cf form expected)
Type check a Clojure form and return its type
Source
check-ns
function
Usage: (check-ns)
(check-ns nsym)
Type check a namespace. If not provided default to current namespace.
Bind *verbose-types* to true to print fully qualified types.
Bind *verbose-forms* to print full forms in error messages.
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-alias-kind*
function
Usage: (declare-alias-kind* sym ty)
Internal use only. Use declare-alias-kind.
Source
declare-datatypes
macro
Usage: (declare-datatypes & syms)
Declare datatypes, similar to declare but on the type level.
Source
declare-datatypes*
function
Usage: (declare-datatypes* nms)
Internal use only. Use declare-datatypes.
Source
declare-names
macro
Usage: (declare-names & syms)
Declare names, similar to declare but on the type level.
Source
declare-names*
function
Usage: (declare-names* syms)
Internal use only. Use declare-names.
Source
declare-protocols
macro
Usage: (declare-protocols & syms)
Declare protocols, similar to declare but on the type level.
Source
declare-protocols*
function
Usage: (declare-protocols* syms)
Internal use only. Use declare-protocols.
Source
def-alias
macro
Usage: (def-alias sym doc-str type)
(def-alias sym type)
Define a type alias. Takes an optional doc-string as a second
argument.
Source
def-alias*
function
Usage: (def-alias* sym type)
Internal use only. Use def-alias.
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.
Source
fn>
macro
Usage: (fn> & forms)
Define a typed anonymous function.
(fn> name? :- type? [[param :- type]* & [param :- type *]?] exprs*)
(fn> name? (:- type? [[param :- type]* & [param :- type *]?] exprs*)+)
Source
fn>-ann
function
Usage: (fn>-ann fn-of param-types-syn)
Internal use only. Use fn>.
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
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.
Source
inst-poly
function
Usage: (inst-poly inst-of types-syn)
Internal use only. Use inst.
Source
inst-poly-ctor
function
Usage: (inst-poly-ctor inst-of types-syn)
Internal use only. Use inst-ctor
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
into-array>*
function
Usage: (into-array>* cljt coll)
(into-array>* javat cljt coll)
(into-array>* into-array-syn javat cljt coll)
Internal use only. Use into-array>.
Source
letfn>
macro
Usage: (letfn> bindings & body)
Like letfn, but each binding 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> bndings* & forms)
Like loop, except loop variables require annotation.
eg. (loop> [a :- Number 1
b :- (U nil Number) nil]
...)
Source
loop>-ann
function
Usage: (loop>-ann loop-of bnding-types)
Internal use only. Use loop>
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
nilable-param*
function
Usage: (nilable-param* msym mmap)
Internal use only. Use nilable-param.
Source
non-nil-return
macro
Usage: (non-nil-return msym arities)
Override the return type of 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. (non-nil-return java.lang.Class/getDeclaredMethod :all)
Source
non-nil-return*
function
Usage: (non-nil-return* msym arities)
Internal use only. Use non-nil-return.
Source
override-constructor
macro
Usage: (override-constructor ctorsym typesyn)
Override all constructors for Class ctorsym with type.
Source
override-constructor*
function
Usage: (override-constructor* ctorsym typesyn)
Internal use only. Use override-constructor.
Source
override-method
macro
Usage: (override-method methodsym typesyn)
Override type for qualified method methodsym.
Source
override-method*
function
Usage: (override-method* methodsym typesyn)
Internal use only. Use override-method.
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
pfn>-ann
function
Usage: (pfn>-ann fn-of polys param-types-syn)
Internal use only. Use pfn>.
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
Source
tc-ignore
macro
Usage: (tc-ignore & body)
Ignore forms in body during type checking
Source
function
Usage: (tc-ignore-forms* r)
Internal use only. Use tc-ignore
Source
typed-deps
macro
Usage: (typed-deps & args)
Declare namespaces which should be checked before the current namespace.
Accepts any number of symbols.
Source
typed-deps*
function
Usage: (typed-deps* args)
Internal use only. Use typed-deps.
Source
Public Variables and Functions
->c
function
Usage: (->c S X T bnds)
Source
->cset
function
Usage: (->cset maps)
Source
->cset-entry
function
Usage: (->cset-entry fixed dmap projections)
Source
->dcon
function
Usage: (->dcon fixed rest)
Source
->dcon-dotted
function
Usage: (->dcon-dotted fixed dc dbound)
Source
->dcon-exact
function
Usage: (->dcon-exact fixed rest)
Source
->dmap
function
Usage: (->dmap map)
Source
->i-subst
function
Usage: (->i-subst types)
Source
->i-subst-dotted
function
Usage: (->i-subst-dotted types dty dbound)
Source
->i-subst-starred
function
Usage: (->i-subst-starred types starred)
Source
->t-subst
function
Usage: (->t-subst type bnds)
Source
DCon
var
(U dcon dcon-exact dcon-dotted)
FreeBnds
var
A map of free variable names to their bounds.
(IPersistentMap Symbol Bounds)
SubstMap
var
A substutition map of symbols naming frees to types
to instantitate them with.
(IPersistentMap Symbol SubstRHS)
SubstRHS
var
The substitution records.
(U t-subst i-subst i-subst-starred i-subst-dotted)
map->c
function
Usage: (map->c {:as m#, :keys [S X T bnds]})
Source
map->cset
function
Usage: (map->cset {:as m#, :keys [maps]})
Source
map->cset-entry
function
Usage: (map->cset-entry {:as m#, :keys [fixed dmap projections]})
Source
map->dcon
function
Usage: (map->dcon {:as m#, :keys [fixed rest]})
Source
map->dcon-dotted
function
Usage: (map->dcon-dotted {:as m#, :keys [fixed dc dbound]})
Source
map->dcon-exact
function
Usage: (map->dcon-exact {:as m#, :keys [fixed rest]})
Source
map->dmap
function
Usage: (map->dmap {:as m#, :keys [map]})
Source
map->i-subst
function
Usage: (map->i-subst {:as m#, :keys [types]})
Source
map->i-subst-dotted
function
Usage: (map->i-subst-dotted {:as m#, :keys [types dty dbound]})
Source
map->i-subst-starred
function
Usage: (map->i-subst-starred {:as m#, :keys [types starred]})
Source
map->t-subst
function
Usage: (map->t-subst {:as m#, :keys [type bnds]})
Source
Public Variables and Functions
->AnyValue
function
Usage: (->AnyValue)
Source
->App
function
Usage: (->App rator rands)
Source
->B
function
Usage: (->B idx)
Source
->Bounds
function
Usage: (->Bounds upper-bound lower-bound higher-kind)
Source
->CountRange
function
Usage: (->CountRange lower upper)
Source
->DataType
function
Usage: (->DataType the-class variances poly? fields record?)
Source
->DottedPretype
function
Usage: (->DottedPretype pre-type name)
Source
->F
function
Usage: (->F name)
Source
->FlowSet
function
Usage: (->FlowSet normal)
Source
->FnIntersection
function
Usage: (->FnIntersection types)
Source
->Function
function
Usage: (->Function dom rng rest drest kws)
Source
->GTRange
function
Usage: (->GTRange n)
Source
->HeterogeneousList
function
Usage: (->HeterogeneousList types)
Source
->HeterogeneousMap
function
Usage: (->HeterogeneousMap types absent-keys other-keys?)
Source
->HeterogeneousSeq
function
Usage: (->HeterogeneousSeq types)
Source
->HeterogeneousVector
function
Usage: (->HeterogeneousVector types)
Source
->Intersection
function
Usage: (->Intersection types)
Source
->KwArgs
function
Usage: (->KwArgs mandatory optional)
Source
->KwArgsSeq
function
Usage: (->KwArgsSeq mandatory optional)
Source
->LTRange
function
Usage: (->LTRange n)
Source
->ListDots
function
Usage: (->ListDots pre-type bound)
Source
->Mu
function
Usage: (->Mu scope)
Source
->Name
function
Usage: (->Name id)
Source
->NotType
function
Usage: (->NotType type)
Source
->Poly
function
Usage: (->Poly nbound bbnds scope actual-frees)
Source
->PolyDots
function
Usage: (->PolyDots nbound bbnds scope)
Source
->PrimitiveArray
function
Usage: (->PrimitiveArray jtype input-type output-type)
Source
->Projection
function
Usage: (->Projection afn ts)
Source
->Protocol
function
Usage: (->Protocol the-var variances poly? on-class methods)
Source
->RClass
function
Usage: (->RClass variances poly? the-class replacements unchecked-ancestors)
Source
->Scope
function
Usage: (->Scope body)
Source
->TApp
function
Usage: (->TApp rator rands)
Source
->TCError
function
Usage: (->TCError)
Source
->TCResult
function
Usage: (->TCResult t fl o flow)
Source
->Top
function
Usage: (->Top)
Source
->TopFunction
function
Usage: (->TopFunction)
Source
->TypeFn
function
Usage: (->TypeFn nbound variances bbnds scope)
Source
->Union
function
Usage: (->Union types)
Source
->Value
function
Usage: (->Value val)
Source
TempFilterSet
var
Can't import FilterSet here, so an alias will do for now
clojure.core.typed.filter_rep.FilterSet
Variance
var
Keywords that represent a certain variance
(U ':constant ':covariant ':contravariant ':invariant ':dotted)
make-F
function
Usage: (make-F name)
Make a free variable
Source
make-Function
function
Usage: (make-Function dom rng)
(make-Function dom rng rest)
(make-Function dom rng rest drest & {:keys [filter object mandatory-kws optional-kws]})
Make a function, wrap range type in a Result.
Accepts optional :filter and :object parameters that default to the most general filter
and EmptyObject
Source
make-Result
function
Usage: (make-Result t)
(make-Result t f)
(make-Result t f o)
Make a result. ie. the range of a Function
Source
map->AnyValue
function
Usage: (map->AnyValue {:as m#, :keys []})
Source
map->App
function
Usage: (map->App {:as m#, :keys [rator rands]})
Source
map->B
function
Usage: (map->B {:as m#, :keys [idx]})
Source
map->Bounds
function
Usage: (map->Bounds {:as m#, :keys [upper-bound lower-bound higher-kind]})
Source
map->CountRange
function
Usage: (map->CountRange {:as m#, :keys [lower upper]})
Source
map->DataType
function
Usage: (map->DataType {:as m#, :keys [the-class variances poly? fields record?]})
Source
map->DottedPretype
function
Usage: (map->DottedPretype {:as m#, :keys [pre-type name]})
Source
map->F
function
Usage: (map->F {:as m#, :keys [name]})
Source
map->FlowSet
function
Usage: (map->FlowSet {:as m#, :keys [normal]})
Source
map->FnIntersection
function
Usage: (map->FnIntersection {:as m#, :keys [types]})
Source
map->Function
function
Usage: (map->Function {:as m#, :keys [dom rng rest drest kws]})
Source
map->GTRange
function
Usage: (map->GTRange {:as m#, :keys [n]})
Source
map->HeterogeneousList
function
Usage: (map->HeterogeneousList {:as m#, :keys [types]})
Source
map->HeterogeneousMap
function
Usage: (map->HeterogeneousMap {:as m#, :keys [types absent-keys other-keys?]})
Source
map->HeterogeneousSeq
function
Usage: (map->HeterogeneousSeq {:as m#, :keys [types]})
Source
map->HeterogeneousVector
function
Usage: (map->HeterogeneousVector {:as m#, :keys [types]})
Source
map->Intersection
function
Usage: (map->Intersection {:as m#, :keys [types]})
Source
map->KwArgs
function
Usage: (map->KwArgs {:as m#, :keys [mandatory optional]})
Source
map->KwArgsSeq
function
Usage: (map->KwArgsSeq {:as m#, :keys [mandatory optional]})
Source
map->LTRange
function
Usage: (map->LTRange {:as m#, :keys [n]})
Source
map->ListDots
function
Usage: (map->ListDots {:as m#, :keys [pre-type bound]})
Source
map->Mu
function
Usage: (map->Mu {:as m#, :keys [scope]})
Source
map->Name
function
Usage: (map->Name {:as m#, :keys [id]})
Source
map->NotType
function
Usage: (map->NotType {:as m#, :keys [type]})
Source
map->Poly
function
Usage: (map->Poly {:as m#, :keys [nbound bbnds scope actual-frees]})
Source
map->PolyDots
function
Usage: (map->PolyDots {:as m#, :keys [nbound bbnds scope]})
Source
map->PrimitiveArray
function
Usage: (map->PrimitiveArray {:as m#, :keys [jtype input-type output-type]})
Source
map->Projection
function
Usage: (map->Projection {:as m#, :keys [afn ts]})
Source
map->Protocol
function
Usage: (map->Protocol {:as m#, :keys [the-var variances poly? on-class methods]})
Source
map->RClass
function
Usage: (map->RClass {:as m#, :keys [variances poly? the-class replacements unchecked-ancestors]})
Source
map->Result
function
Usage: (map->Result {:as m#, :keys [t fl o]})
Source
map->Scope
function
Usage: (map->Scope {:as m#, :keys [body]})
Source
map->TApp
function
Usage: (map->TApp {:as m#, :keys [rator rands]})
Source
map->TCError
function
Usage: (map->TCError {:as m#, :keys []})
Source
map->TCResult
function
Usage: (map->TCResult {:as m#, :keys [t fl o flow]})
Source
map->Top
function
Usage: (map->Top {:as m#, :keys []})
Source
map->TopFunction
function
Usage: (map->TopFunction {:as m#, :keys []})
Source
map->TypeFn
function
Usage: (map->TypeFn {:as m#, :keys [nbound variances bbnds scope]})
Source
map->Union
function
Usage: (map->Union {:as m#, :keys [types]})
Source
map->Value
function
Usage: (map->Value {:as m#, :keys [val]})
Source
ret
function
Usage: (ret t)
(ret t f)
(ret t f o)
(ret t f o flow)
Convenience function for returning the type of an expression
Source
scope-depth?
function
Usage: (scope-depth? scope depth)
True if scope is has depth number of scopes nested
Source
visit-bounds
function
Usage: (visit-bounds ty f)
Apply f to each element of bounds
Source