assoc
support less unsound
clojure.core/reductions
annotation
reduced
valuesclojure.core/reduce
annotation
reduced
clojure.core/keep
transducer arityclojure.core/keep
never returns nil, update annotation appropriatelyfilter
, remove
, {take,drop}-while
, partition-all
, distinct
,
interpose
, {map,keep}-indexed
,keep
accepts Seqable
, not just Coll
drop-last
keyword
1-arity to accept a variteration
, partitionv
, parse-{uuid,boolean,double,long}
, update-{keys,vals}
, abs
, NaN?
, infinite?
, *repl*
, replace
,
partition-by
, cat
, dedupe
, random-sample
, eduction
, tagged-literal{?}
, reader-conditional{?}
, unreduced
, halt-when
, ensure-reduced
, completing
,
transduce
, sorted-map-by
, rational?
, float?
, {r}subseq
comp
keys
and vals
peek
in most general case (nilable return)(reduce (fn [a b] (+ a b)) [1])
(comp (fn [y] y) (fn [x] x))
t/Infer
, like t/Any
but downcasted when checked against a more specific type(fn [x] x)
prints as [Nothing :-> Nothing]
(map (fn [x] x))
prints as (Transducer Nothing Nothing)
t/Infer
clojure.core.typed
alias in current namespace to shorten types (rather than just typed.clojure
)(into [] (map identity) [1])
fn
against a union typet/*
, t/+
, t/alt
, t/?
, t/cat
IFn
. e.g.,
[(t/cat a b) :-> t/Any] => [a b :-> t/Any]
[(t/cat a b) :* :-> t/Any] => [(t/HSequential [a b] :repeat true) <* :-> t/Any]
[(t/cat a b) :.. c :-> t/Any] => [(t/HSequential [a b] :repeat true) <... c :-> t/Any]
[(t/* a) :-> t/Any] => [a :* :-> t/Any]
[(t/? a) :-> t/Any] => (IFn [:-> t/Any] [a :-> t/Any])
[(t/+ a) :-> t/Any] => [a :+ :-> t/Any] => [a a :* :-> t/Any]
[(t/alt (t/cat a) (t/cat a b)) :-> t/Any] => (t/IFn [a :-> t/Any] [a b :-> t/Any])
clojure.core/update
(typed.clojure/fn ...)
as symbolic closure if unannotateddefmulti
clojure.core.async/pipe
clojure.core.typed/{for,doseq}
clojure.core/{for,doseq}
clojure.core.typed.deprecated-wrapper-macros=true
to add them backt/ann
, t/ann-protocol
etc., are now removed from the
global type environment if the (Clojure JVM) namespace in which those macros occur is removed or reloaded.
t/ann
simply by correcting it, then refreshing the namespace via tools.namespace.
the underlying annotation for the misspelled version is removed as if it were a var in the old namespace.:collect-only
feature
typed.spec.clojure.core/atom-spec
:forms
documentation for core aliases(merge)
as nil
t/Merge
clojure.core/merge
but at the type level(t/Merge '{:a t/Int :b t/Bool} '{:a t/Bool :c t/Str}) => '{:a t/Bool :b t/Bool :c t/Str}
^:typed.clojure/ignore
or ^{:typed.clojure {:ignore true}}
meta
(ns ^:typed.clojure/ignore foo)
typed.clojure/check-dir-clj{s}
for type checking directories of codetyped.clojure.main
for command line usage^::t/dbg
output[:maybe]
case in Malli schema to static type translation[:and s1 s2 s3 ...]
to s1
in type translation to avoid tricky subtyping cases^:fake-quote 'TYPE
<=> TYPE
^{::t/- TYPE} EXP
<=> (t/ann-form EXP TYPE)
^{::t/inst [...]} EXP
<=> (t/inst EXP ...)
^{::t/unsafe-cast TYPE} EXP
checks EXP with no expected type and unsafely infers type TYPE^::t/ignore EXP
<=> (t/tc-ignore EXP)
^::t/dbg EXP
prints type info on EXPtyped.clojure/doc-clj{s}
for documentation snippets and type lookupclojure.core.typed/envs
[Foo Bar :+ :-> Baz] <=> [Foo Bar Bar :* :-> Baz]
[Foo Bar :? :-> Baz] <=> (IFn [Foo :-> Baz] [Foo Bar :-> Baz])
{min,max}-key
disj
clojure.test/run-all-tests
merge
is a map, rest can be nilable and still returns a map:..
keyword syntax for dotted rest argument (along with ...
and :...
)t/All
parsing: allow combining :..
with keyword args: (t/All [a :.. :named [b])
(t/Assoc c ... c)
type syntax to (t/Assoc c :.. c)
:{?,*,+}
:*
function types
(-> (fn ([] 0)
([a] (+ a))
([a b & more] (apply + a b more)))
(ann-form [t/Int :* :-> t/Int]))
(ann-form (fn [& rst] (first rst)) [t/Int :+ :-> t/Int])
set!
clojure.core.typed/envs
sort-by
, method-sig
, partition
clojure.core/fn
(t/fn [a :- t/Int]) <=> (cc/fn [^{:typed.clojure/- t/Int} a])
(t/fn [] :- t/Bool) <=> (cc/fn ^{:typed.clojure/- t/Bool} [])
(t/ann-form (t/fn [a] a) (t/All [x] [x :-> x])) <=> (cc/fn ^{:typed.clojure/- (t/All [x] [x :-> x])} _id [a] a)
(fn [p :- [[t/Int :-> t/Int] :-> t/Int]] (p #(inc %)))
typed.clojure/Associative
now takes 2 type arguments (before, 3)
cljs.core/IAssociative
, clojure.lang.Associative
cc/reduce-kv
annotationseqable?
, indexed?
, find
t/MapEntry
to t/AMapEntry
for fn outputs, change t/MapEntry
for fn inputstyped.clojure/cns
typed.clojure/check-ns-cljs
from macro to functionclojure.core
and cljs.core
type rulesminimal-clj
example project to test typed.clj.checker in isolation without cljs depsclojure.core/defprotocol
rule for clj{s}cljs.core/implements?
rule for cljs(defn sym-or-kw? [a] (or (symbol? a) (keyword? a)))
:flow
filters
:filters
around 2015.typed.clojure.jvm
for jvm annotations
override-class
-- see typed.ann.clojure.jvm
for base environment usingclojure.core/reify
in Clojure checkerclojure.core/satisfies?
in Clojure checker:extend-via-metadata
(and other kw options) in defprotocol wrappertyped.clojure/check-ns
typed.clojure/check-ns{,-clj,cljs}
no longer require the namespaces being checked to depend on a Typed Clojure namespacetyped.malli.schema-to-type/register-malli->type-extension
clojure.java.io
annotations{pos,neg,nat}-int?
annotationstyped.clj.malli
submodule to typed.malli
t/def
and t/defn
never infer their types, and use t/ann
to register global annotation
typed.clojure
namespacelib.spec.alpha
lib for spec.alpha annotations
s/def
and s/fdef
typed.cljs.analyzer
typed.clojure
namespace for cross-platform useclojure.core.typed.special-vars=true
to restore:refer
ing these vars is not cross-platform. type resolution can
work without these varsclojure.core.typed.intern-defaliases=true
to restoreclojure.core/seqable?
, so now we can annotate as (t/Pred (t/Seqable t/Any))
clojure.core/boolean?
annotationclojure.core/inc
is appears in error messages instead of clojure.lang.RT/inc
typed.clj.malli
projectclojure.core/for
typing rule with destructuringclojure.core/let
typing ruletyped.clj.generators
namespace to typed.clj.checkerCan you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close