Public Vars

Back

pr (clj)

(source)

function

(pr) (pr x) (pr x & more)
Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader

Examples

clojure
(ns clojure.test-clojure.server
    (:import java.util.Random)
    (:require [clojure.test :refer :all])
    (:require [clojure.core.server :as s]))

(deftest test-validate-opts
  (check-invalid-opts {} "Missing required socket server property :name")
  (check-invalid-opts {:name "a" :accept 'clojure.core/+} "Missing required socket server property :port")
  (doseq [port [-1 "5" 999999]]
    (check-invalid-opts {:name "a" :port port :accept 'clojure.core/+} (str "Invalid socket server port: " port)))
  (check-invalid-opts {:name "a" :port 5555} "Missing required socket server property :accept"))

(deftest test-parse-props
  (let [thread (create-random-thread)]
    (.start thread)
    (Thread/sleep 1000)
    (try
      (is (>= (count
        (#'s/parse-props (System/getProperties))) 0))
      (finally (.interrupt thread)))))
clojure
(ns clojure.test-clojure.reducers
  (:require [clojure.core.reducers :as r]
            [clojure.test.generative :refer (defspec)]
            [clojure.data.generators :as gen])
  (:use clojure.test))

(defn reduced-at-probe
  [m p]
  (reduce-kv (fn [_ k v] (when (== p k) (reduced :foo))) nil m))

(defspec reduced-always-returns
  (fn [probe to-end]
    (let [len (+ probe to-end 1)
          nums (range len)
          m (zipmap nums nums)]
      (reduced-at-probe m probe)))
  [^{:tag `gen-num} probe ^{:tag `gen-num} to-end]
  (assert (= :foo %)))

(deftest test-closed-over-clearing
  ;; this will throw OutOfMemory without proper reference clearing
  (is (number? (reduce + 0 (r/map identity (range 1e8))))))
clojure
(deftest division
  (is (= clojure.core// /))
  (binding [*ns* *ns*]
    (eval '(do (ns foo
                 (:require [clojure.core :as bar])
                 (:use [clojure.test]))
               (is (= clojure.core// bar//))))))

(deftest Instants
  (testing "Instants are read as java.util.Date by default"
    (is (= java.util.Date (class #inst "2010-11-12T13:14:15.666"))))
  (let [s "#inst \"2010-11-12T13:14:15.666-06:00\""]
    (binding [*data-readers* {'inst read-instant-date}]
      (testing "read-instant-date produces java.util.Date"
        (is (= java.util.Date (class (read-string s)))))
      (testing "java.util.Date instants round-trips"
        (is (= (-> s read-string)
               (-> s read-string pr-str read-string))))
      (testing "java.util.Date instants round-trip throughout the year"
        (doseq [month (range 1 13) day (range 1 29) hour (range 1 23)]
          (let [s (format "#inst \"2010-%02d-%02dT%02d:14:15.666-06:00\"" month day hour)]
            (is (= (-> s read-string)
                   (-> s read-string pr-str read-string))))))
      (testing "java.util.Date handling DST in time zones"
        (let [dtz (TimeZone/getDefault)]
          (try
            ;; A timezone with DST in effect during 2010-11-12
            (TimeZone/setDefault (TimeZone/getTimeZone "Australia/Sydney"))
            (is (= (-> s read-string)
                   (-> s read-string pr-str read-string)))
            (finally (TimeZone/setDefault dtz)))))
      (testing "java.util.Date should always print in UTC"
        (let [d (read-string s)
              pstr (print-str d)
              len (.length pstr)]
          (is (= (subs pstr (- len 7)) "-00:00\"")))))
    (binding [*data-readers* {'inst read-instant-calendar}]
      (testing "read-instant-calendar produces java.util.Calendar"
        (is (instance? java.util.Calendar (read-string s))))
      (testing "java.util.Calendar round-trips"
        (is (= (-> s read-string)
               (-> s read-string pr-str read-string))))
      (testing "java.util.Calendar remembers timezone in literal"
        (is (= "#inst \"2010-11-12T13:14:15.666-06:00\""
               (-> s read-string pr-str)))
        (is (= (-> s read-string)
               (-> s read-string pr-str read-string))))
      (testing "java.util.Calendar preserves milliseconds"
        (is (= 666 (-> s read-string
                       (.get java.util.Calendar/MILLISECOND)))))))
  (let [s "#inst \"2010-11-12T13:14:15.123456789\""
        s2 "#inst \"2010-11-12T13:14:15.123\""
        s3 "#inst \"2010-11-12T13:14:15.123456789123\""]
    (binding [*data-readers* {'inst read-instant-timestamp}]
      (testing "read-instant-timestamp produces java.sql.Timestamp"
        (is (= java.sql.Timestamp (class (read-string s)))))
      (testing "java.sql.Timestamp preserves nanoseconds"
        (is (= 123456789 (-> s read-string .getNanos)))
        (is (= 123456789 (-> s read-string pr-str read-string .getNanos)))
        ;; truncate at nanos for s3
        (is (= 123456789 (-> s3 read-string pr-str read-string .getNanos))))
      (testing "java.sql.Timestamp should compare nanos"
        (is (= (read-string s) (read-string s3)))
        (is (not= (read-string s) (read-string s2)))))
    (binding [*data-readers* {'inst read-instant-date}]
      (testing "read-instant-date should truncate at milliseconds"
        (is (= (read-string s) (read-string s2) (read-string s3))))))
  (let [s "#inst \"2010-11-12T03:14:15.123+05:00\""
        s2 "#inst \"2010-11-11T22:14:15.123Z\""]
    (binding [*data-readers* {'inst read-instant-date}]
      (testing "read-instant-date should convert to UTC"
        (is (= (read-string s) (read-string s2)))))
    (binding [*data-readers* {'inst read-instant-timestamp}]
      (testing "read-instant-timestamp should convert to UTC"
        (is (= (read-string s) (read-string s2)))))
    (binding [*data-readers* {'inst read-instant-calendar}]
      (testing "read-instant-calendar should preserve timezone"
        (is (not= (read-string s) (read-string s2)))))))

(deftest UUID
  (is (= java.util.UUID (class #uuid "550e8400-e29b-41d4-a716-446655440000")))
  (is (.equals #uuid "550e8400-e29b-41d4-a716-446655440000"
               #uuid "550e8400-e29b-41d4-a716-446655440000"))
  (is (not (identical? #uuid "550e8400-e29b-41d4-a716-446655440000"
                       #uuid "550e8400-e29b-41d4-a716-446655440000")))
  (is (= 4 (.version #uuid "550e8400-e29b-41d4-a716-446655440000")))
  (is (= (print-str #uuid "550e8400-e29b-41d4-a716-446655440000")
         "#uuid \"550e8400-e29b-41d4-a716-446655440000\"")))


(defn roundtrip
  "Print an object and read it back. Returns rather than throws
   any exceptions."
  [o]
  (binding [*print-length* nil
            *print-dup* nil
            *print-level* nil]
    (try
     (-> o pr-str read-string)
     (catch Throwable t t))))

(defn roundtrip-dup
  "Print an object with print-dup and read it back.
   Returns rather than throws any exceptions."
  [o]
  (binding [*print-length* nil
            *print-dup* true
            *print-level* nil]
    (try
     (-> o pr-str read-string)
     (catch Throwable t t))))

(defspec types-that-should-roundtrip
  roundtrip
  [^{:tag cgen/ednable} o]
  (when-not (= o %)
    (throw (ex-info "Value cannot roundtrip, see ex-data" {:printed o :read %}))))

(defspec types-that-need-dup-to-roundtrip
  roundtrip-dup
  [^{:tag cgen/dup-readable} o]
  (when-not (= o %)
    (throw (ex-info "Value cannot roundtrip, see ex-data" {:printed o :read %}))))

(deftest preserve-read-cond-test
  (let [x (read-string {:read-cond :preserve} "#?(:clj foo :cljs bar)" )]
       (is (reader-conditional? x))
       (is (not (:splicing? x)))
       (is (= :foo (get x :no-such-key :foo)))
       (is (= (:form x) '(:clj foo :cljs bar)))
       (is (= x (reader-conditional '(:clj foo :cljs bar) false))))
  (let [x (read-string {:read-cond :preserve} "#?@(:clj [foo])" )]
       (is (reader-conditional? x))
       (is (:splicing? x))
       (is (= :foo (get x :no-such-key :foo)))
       (is (= (:form x) '(:clj [foo])))
       (is (= x (reader-conditional '(:clj [foo]) true))))
  (is (thrown-with-msg? RuntimeException #"No reader function for tag"
                        (read-string {:read-cond :preserve} "#js {:x 1 :y 2}" )))
  (let [x (read-string {:read-cond :preserve} "#?(:cljs #js {:x 1 :y 2})")
        [platform tl] (:form x)]
       (is (reader-conditional? x))
       (is (tagged-literal? tl))
       (is (= 'js (:tag tl)))
       (is (= {:x 1 :y 2} (:form tl)))
       (is (= :foo (get tl :no-such-key :foo)))
       (is (= tl (tagged-literal 'js {:x 1 :y 2}))))
  (testing "print form roundtrips"
           (doseq [s ["#?(:clj foo :cljs bar)"
                      "#?(:cljs #js {:x 1, :y 2})"
                      "#?(:clj #clojure.test_clojure.reader.TestRecord [42 85])"]]
                  (is (= s (pr-str (read-string {:read-cond :preserve} s)))))))

(deftest reader-conditionals
  (testing "basic read-cond"
    (is (= '[foo-form]
           (read-string {:read-cond :allow :features #{:foo}} "[#?(:foo foo-form :bar bar-form)]")))
    (is (= '[bar-form]
           (read-string {:read-cond :allow :features #{:bar}} "[#?(:foo foo-form :bar bar-form)]")))
    (is (= '[foo-form]
           (read-string {:read-cond :allow :features #{:foo :bar}} "[#?(:foo foo-form :bar bar-form)]")))
    (is (= '[]
           (read-string {:read-cond :allow :features #{:baz}} "[#?( :foo foo-form :bar bar-form)]"))))
  (testing "environmental features"
    (is (= "clojure" #?(:clj "clojure" :cljs "clojurescript" :default "default"))))
  (testing "default features"
    (is (= "default" #?(:clj-clr "clr" :cljs "cljs" :default "default"))))
  (testing "splicing"
    (is (= [] [#?@(:clj [])]))
    (is (= [:a] [#?@(:clj [:a])]))
    (is (= [:a :b] [#?@(:clj [:a :b])]))
    (is (= [:a :b :c] [#?@(:clj [:a :b :c])]))
    (is (= [:a :b :c] [#?@(:clj [:a :b :c])])))
  (testing "nested splicing"
    (is (= [:a :b :c :d :e]
           [#?@(:clj [:a #?@(:clj [:b #?@(:clj [:c]) :d]):e])]))
    (is (= '(+ 1 (+ 2 3))
           '(+ #?@(:clj [1 (+ #?@(:clj [2 3]))]))))
    (is (= '(+ (+ 2 3) 1)
           '(+ #?@(:clj [(+ #?@(:clj [2 3])) 1]))))
    (is (= [:a [:b [:c] :d] :e]
           [#?@(:clj [:a [#?@(:clj [:b #?@(:clj [[:c]]) :d])] :e])])))
  (testing "bypass unknown tagged literals"
    (is (= [1 2 3] #?(:cljs #js [1 2 3] :clj [1 2 3])))
    (is (= :clojure #?(:foo #some.nonexistent.Record {:x 1} :clj :clojure))))
  (testing "error cases"
    (is (thrown-with-msg? RuntimeException #"Feature should be a keyword" (read-string {:read-cond :allow} "#?((+ 1 2) :a)")))
    (is (thrown-with-msg? RuntimeException #"even number of forms" (read-string {:read-cond :allow} "#?(:cljs :a :clj)")))
    (is (thrown-with-msg? RuntimeException #"read-cond-splicing must implement" (read-string {:read-cond :allow} "#?@(:clj :a)")))
    (is (thrown-with-msg? RuntimeException #"is reserved" (read-string {:read-cond :allow} "#?@(:foo :a :else :b)")))
    (is (thrown-with-msg? RuntimeException #"must be a list" (read-string {:read-cond :allow} "#?[:foo :a :else :b]")))
    (is (thrown-with-msg? RuntimeException #"Conditional read not allowed" (read-string {:read-cond :BOGUS} "#?[:clj :a :default nil]")))
    (is (thrown-with-msg? RuntimeException #"Conditional read not allowed" (read-string "#?[:clj :a :default nil]")))
    (is (thrown-with-msg? RuntimeException #"Reader conditional splicing not allowed at the top level" (read-string {:read-cond :allow} "#?@(:clj [1 2])")))
    (is (thrown-with-msg? RuntimeException #"Reader conditional splicing not allowed at the top level" (read-string {:read-cond :allow} "#?@(:clj [1])")))
    (is (thrown-with-msg? RuntimeException #"Reader conditional splicing not allowed at the top level" (read-string {:read-cond :allow} "#?@(:clj []) 1"))))
  (testing "clj-1698-regression"
    (let [opts {:features #{:clj} :read-cond :allow}]
      (is (= 1 (read-string opts "#?(:cljs {'a 1 'b 2} :clj 1)")))
      (is (= 1 (read-string opts "#?(:cljs (let [{{b :b} :a {d :d} :c} {}]) :clj 1)")))
      (is (= '(def m {}) (read-string opts "(def m #?(:cljs ^{:a :b} {} :clj  ^{:a :b} {}))")))
      (is (= '(def m {}) (read-string opts "(def m #?(:cljs ^{:a :b} {} :clj ^{:a :b} {}))")))
      (is (= 1 (read-string opts "#?(:cljs {:a #_:b :c} :clj 1)")))))
  (testing "nil expressions"
    (is (nil? #?(:default nil)))
    (is (nil? #?(:foo :bar :clj nil)))
    (is (nil? #?(:clj nil :foo :bar)))
    (is (nil? #?(:foo :bar :default nil)))))

(defn str->lnpr
  [s]
  (-> s (java.io.StringReader.) (clojure.lang.LineNumberingPushbackReader.)))

(deftest test-read+string
  (let [[r s] (read+string (str->lnpr "[:foo  100]"))]
    (is (= [:foo 100] r))
    (is (= "[:foo  100]" s)))

  (let [[r s] (read+string {:read-cond :allow :features #{:y}} (str->lnpr "#?(:x :foo :y :bar)"))]
    (is (= :bar r))
    (is (= "#?(:x :foo :y :bar)" s))))

  (are [l c s] (= {:line l :column c} (-> s str->lnpr read meta (select-keys [:line :column])))
    42 99 "^{:line 42 :column 99} (1 2)"
    1 99 "^{:column 99} (1 2)")

  (eval (-> "^{:line 42 :column 99} (defn explicit-line-numbering [])" str->lnpr read))
  (is (= {:line 42 :column 99}
         (-> 'explicit-line-numbering resolve meta (select-keys [:line :column])))))
babashka/babashka
(ns babashka.impl.server
  (:require [babashka.impl.clojure.core.server :as server]
            [babashka.impl.common :as common]
            [babashka.impl.socket-repl :as socket-repl]
            [sci.core :as sci]))

(def prepl (fn [& args]
             (apply server/prepl (common/ctx) args)))

(def io-prepl
  (fn [& args]
    (apply server/io-prepl (common/ctx) args)))

(def clojure-core-server-namespace
  {'repl (sci/copy-var socket-repl/repl sns)
   'prepl (sci/copy-var prepl sns)
   'io-prepl (sci/copy-var io-prepl sns)
   'start-server (sci/copy-var start-server sns)
   'stop-server (sci/copy-var server/stop-server sns)})
clojure/core.async
;; The clojure.core.async namespace contains the public API.
(require '[clojure.core.async :as async :refer :all])

;; Data is transmitted on queue-like channels. By default channels
;; are unbuffered (0-length) - they require producer and consumer to
;; rendezvous for the transfer of a value through the channel.

;; Here we convert our prior channel example to use go blocks:
(let [c (chan)]
  (go (>! c "hello"))
  (assert (= "hello" (<!! (go (<! c)))))
  (close! c))

;; Instead of the explicit thread and blocking call, we use a go block
;; for the producer. The consumer uses a go block to take, then
;; returns a result channel, from which we do a blocking take.

(let [c1 (chan)
      c2 (chan)]
  (thread (while true
            (let [[v ch] (alts!! [c1 c2])]
              (println "Read" v "from" ch))))
  (>!! c1 "hi")
  (>!! c2 "there"))

(let [c1 (chan)
      c2 (chan)]
  (go (while true
        (let [[v ch] (alts! [c1 c2])]
          (println "Read" v "from" ch))))
  (go (>! c1 "hi"))
  (go (>! c2 "there")))

;; Since go blocks are lightweight processes not bound to threads, we
;; can have LOTS of them! Here we create 1000 go blocks that say hi on
;; 1000 channels. We use alts!! to read them as they're ready.

(let [n 1000
      cs (repeatedly n chan)
      begin (System/currentTimeMillis)]
  (doseq [c cs] (go (>! c "hi")))
  (dotimes [i n]
    (let [[v c] (alts!! cs)]
      (assert (= "hi" v))))
  (println "Read" n "msgs in" (- (System/currentTimeMillis) begin) "ms"))

(let [t (timeout 100)
      begin (System/currentTimeMillis)]
  (<!! t)
  (println "Waited" (- (System/currentTimeMillis) begin)))

(let [c (chan)
      begin (System/currentTimeMillis)]
  (alts!! [c (timeout 100)])
  (println "Gave up after" (- (System/currentTimeMillis) begin)))

;; Channels can also use custom buffers that have different policies
;; for the "full" case.  Two useful examples are provided in the API.
noprompt/meander
(ns multimethods
  (:refer-clojure :exclude [defmethod defmulti])
  (:require
   #?(:clj [clojure.core :as clj] :cljs [cljs.core :as cljs])
   [meander.epsilon :as m]))

(defprotocol IMeanderMethods
  (-set-fn         [this f]))

(defmethod test-fn
  [:add ?x ?y]
  (println ?x ?y)
  (+ ?x ?y))
hraberg/deuce
(ns deuce.emacs
  (:require [clojure.core :as c]
            [deuce.emacs-lisp :as el]
            [deuce.emacs-lisp.globals :as globals])
  (:refer-clojure :only [])
  (:use [deuce.emacs-lisp :only [and apply-partially catch cond condition-case defconst define-compiler-macro defmacro
                                 defun defvar function if interactive lambda let let* or prog1 prog2 progn quote
                                 save-current-buffer save-excursion save-restriction setq setq-default
                                 unwind-protect while throw]]
        [deuce.emacs.alloc]
        [deuce.emacs.buffer]
        [deuce.emacs.bytecode]
        [deuce.emacs.callint]
        [deuce.emacs.callproc]
        [deuce.emacs.casefiddle]
        [deuce.emacs.casetab]
        [deuce.emacs.category]
        [deuce.emacs.ccl]
        [deuce.emacs.character]
        [deuce.emacs.charset]
        [deuce.emacs.chartab]
        [deuce.emacs.cmds]
        [deuce.emacs.coding]
        [deuce.emacs.composite]
        [deuce.emacs.data]
        [deuce.emacs.dired]
        [deuce.emacs.dispnew]
        [deuce.emacs.doc]
        [deuce.emacs.editfns]
        [deuce.emacs.emacs]
        [deuce.emacs.eval]
        [deuce.emacs.fileio]
        [deuce.emacs.filelock]
        [deuce.emacs.floatfns]
        [deuce.emacs.fns]
        [deuce.emacs.font]
        [deuce.emacs.frame]
        [deuce.emacs.indent]
        [deuce.emacs.insdel]
        [deuce.emacs.keyboard]
        [deuce.emacs.keymap]
        [deuce.emacs.lread]
        [deuce.emacs.macros]
        [deuce.emacs.marker]
        [deuce.emacs.menu]
        [deuce.emacs.minibuf]
        [deuce.emacs.print]
        [deuce.emacs.process]
        [deuce.emacs.search]
        [deuce.emacs.syntax]
        [deuce.emacs.term]
        [deuce.emacs.terminal]
        [deuce.emacs.textprop]
        [deuce.emacs.undo]
        [deuce.emacs.window]
        [deuce.emacs.xdisp]
        [deuce.emacs.xfaces]
        [deuce.emacs.xml]))

;; Hack for a predicate in cl.el, this is defined in emacs-lisp/bytecomp.el, which we're not using
(defun byte-compile-file-form (form))
;; ;; AOT cl.el gets confused by this alias
(defalias 'cl-block-wrapper 'identity)
(defmacro declare (&rest _specs) nil)
;; with-no-warnings in byte-run.el needs this
(defun last (list &optional n))
;; subr defines a simpler dolist, which custom uses, which gets redefined by cl-macs.
;; During AOT custom loads the latter dolist definition, requiring 'block' - not yet defined.
;; cl cannot be loaded first, as it depends on help-fns, which depend on custom.
(defmacro block (name &rest body) (cons 'progn body))
;; Hack as delayed-eval doesn't (like some other things) work properly inside let-bindings.
;; Needs to be fixed properly, but let's see if we can get through the boot with this hack.
;; cl-setf-simple-store-p is used in  cl-macs/cl-setf-do-modify, delayed-eval call refers to earlier binding 'method'.
(defun cl-setf-simple-store-p (sym form))
;; Same issue in regexp-opt/regexp-opt. Calls this fn with earlier binding 'sorted-strings'
(defun regexp-opt-group (strings &optional paren lax))

;; These use internal-define-key in Emacs, which doesn't define the prefix as symbol, unlike define-prefix-command.
(setq esc-map (make-keymap))
(fset 'ESC-prefix (symbol-value 'esc-map))
(setq ctl-x-map (make-keymap))
(fset 'Control-X-prefix (symbol-value 'ctl-x-map))

;; Main prefix keymaps setup from keymap.c
(define-key globals/global-map "\\e" 'ESC-prefix)
(define-key globals/global-map "\\C-x" 'Control-X-prefix)
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))

(t/ann-protocol cc/Inst
                -inst-ms [cc/Inst :-> t/Int])

#?(:clj (do
(t/defalias IOFactoryOpts (t/HMap :optional {:append t/Any, :encoding (t/Nilable t/Str)}))
(t/ann-protocol clojure.java.io/IOFactory
                make-reader
                [clojure.java.io/IOFactory IOFactoryOpts :-> java.io.BufferedReader]

(t/ann-protocol clojure.java.io/Coercions
                as-file
                [clojure.java.io/Coercions :-> (t/Nilable java.io.File)]

#?(:cljs (do
(t/ann-protocol cljs.core/Fn)
(t/ann-protocol cljs.core/IFn)
(t/ann-protocol cljs.core/ICloneable
                -clone [cljs.core/ICloneable :-> t/Any])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IIterable
                ;; TODO
                -iterator [(cljs.core/IIterable x) :-> t/Any #_Object])
(t/ann-protocol cljs.core/ICounted
                -count [cljs.core/ICounted :-> t/Num])
(t/ann-protocol cljs.core/IEmptyableCollection
                ;; :/ TFn param on protocol?
                -empty [cljs.core/IEmptyableCollection :-> t/Any])
(t/ann-protocol cljs.core/ICollection
                -conj [cljs.core/ICollection t/Any :-> cljs.core/ICollection])
(t/ann-protocol [[x :variance :covariant]] cljs.core/IIndexed
                -nth (t/All [y]
                            [(cljs.core/IIndexed x) t/JSnumber (t/? y) :-> (t/U x y)]))
(t/ann-protocol cljs.core/ASeq)
(t/ann-protocol [[x :variance :covariant
                  ;;FIXME causes mystery error
                  ;:< t/AnyNilableNonEmptySeq
                  ]]
                cljs.core/ISeqable)
(t/ann-protocol [[x :variance :covariant]] cljs.core/ISeq
                -first [(cljs.core/ISeq x) :-> (t/Nilable x)]
                -rest [(cljs.core/ISeq x) :-> (cljs.core/ISeq x)])
;cljs.core/INext [[x :variance :covariant]]
(t/ann-protocol [[v :variance :covariant]] cljs.core/ILookup)
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]]
                cljs.core/IAssociative
                -contains-key [(cljs.core/IAssociative k v) t/Any :-> t/Bool]
                -assoc (t/All [k1 v1] [(cljs.core/IAssociative k v) k1 v1 :->
                                       (cljs.core/IAssociative (t/U k k1) (t/U v v1))]))
(t/ann-protocol cljs.core/IMap
                -dissoc [cljs.core/IMap t/Any :-> cljs.core/IMap])
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]]
                cljs.core/IMapEntry
                -key [(cljs.core/IMapEntry k v) :-> k]
                -val [(cljs.core/IMapEntry k v) :-> v])
(t/ann-protocol cljs.core/ISet
                -disjoin (t/All [s] [s t/Any :-> s]))
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IStack
                -peek [(cljs.core/IStack x) :-> (t/U nil x)]
                -pop [(cljs.core/IStack x) :-> (cljs.core/IStack x)])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IVector
                -assoc-n (t/All [x1] [(cljs.core/IVector x) t/Num x1
                                      :-> (cljs.core/IVector (t/U x x1))]))
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IDeref
                -deref [(cljs.core/IDeref x) :-> x])
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IDerefWithTimeout
                -deref-with-timeout [(cljs.core/IDerefWithTimeout x) :-> x])
(t/ann-protocol cljs.core/IMeta
                -meta [cljs.core/IMeta :-> (t/Nilable (t/Map t/Any t/Any))])
(t/ann-protocol cljs.core/IWithMeta
                -with-meta [cljs.core/IWithMeta (t/Nilable (t/Map t/Any t/Any)) :-> cljs.core/IWithMeta])
;TODO
;cljs.core/IReduce [[]]
(t/ann-protocol cljs.core/IKVReduce ;;TODO
                -kv-reduce [cljs.core/IKVReduce [t/Any t/Any t/Any :-> t/Any] :-> t/Any])
(t/ann-protocol cljs.core/IList)
(t/ann-protocol cljs.core/IEquiv
                -equiv [cljs.core/IEquiv t/Any :-> t/Bool])
(t/ann-protocol cljs.core/IHash
                -hash [cljs.core/IHash :-> t/Num])
(t/ann-protocol cljs.core/ISequential)
(t/ann-protocol cljs.core/IRecord)
(t/ann-protocol [[x :variance :covariant]]
                cljs.core/IReversible
                -rseq [(cljs.core/IReversible x) :-> (t/NilableNonEmptySeq x)])
(t/ann-protocol [[k :variance :covariant]
                 [v :variance :covariant]] cljs.core/IFind
                -find [(cljs.core/IFind k v) t/Any :-> (t/Nilable (cljs.core/IMapEntry k v))]
                )
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/ISorted
                -sorted-seq [(cljs.core/ISorted x) t/Bool :-> (t/Nilable (t/ASeq x))]
                ;; second arg => comparable?
                -sorted-seq-from [(cljs.core/ISorted x) t/Any t/Bool :-> (t/Nilable (t/ASeq x))]
                -entry-key [(cljs.core/ISorted x) t/Any :-> t/Any]
                -comparator [(cljs.core/ISorted x) :-> [x x :-> t/Num]])
(t/ann-protocol cljs.core/IPending)
;cljs.core/IWriter [[]]
;cljs.core/IPrintWithWriter [[]]
;    ;TODO
;;cljs.core/IWatchable [[]]
;    ;cljs.core/IEditableCollection [[]]
;    ;cljs.core/ITransientCollection [[]]
;    ;cljs.core/ITransientAssociative [[]]
;    ;cljs.core/ITransientMap [[]]
;    ;cljs.core/ITransientVector [[]]
;    ;cljs.core/ITransientSet [[]]
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/IComparable)
;    ;cljs.core/IChunk [[]]
;    ;cljs.core/IChunkedSeq [[]]
;    ;cljs.core/IChunkedNext [[]]
(t/ann-protocol cljs.core/INamed
                -named [cljs.core/INamed :-> t/Str]
                -namespace [cljs.core/INamed :-> (t/Nilable t/Str)])
(t/ann-protocol [[x :variance :invariant]]
                cljs.core/IVolatile
                -vreset! (t/All [x] [(cljs.core/IVolatile x) x :-> x]))

(t/ann-protocol cljs.core/UUID)
))

(t/defalias
  ^{:doc "An atom that can read and write type x.
         
         Deprecated: Please use t/Atom instead."
    :deprecated "1.1.6"
    :superseded-by `t/Atom
    :forms '[(Atom1 x)]}
  t/Atom1
  t/Atom)

(t/defalias
  ^{:doc "An var that can read and write type x."
    :deprecated "1.1.6"
    :superseded-by `t/Var
    :forms '[(Var1 x)]}
  t/Var1
  t/Var)

#?(:clj
   (t/defalias
     ^{:doc "A ref that can read and write type x."
       :deprecated "1.1.6"
       :superseded-by `t/Ref
       :forms '[(Ref1 x)]}
     t/Ref1
     t/Ref))

#?(:clj
   (t/defalias
     ^{:doc "An agent that can read and write type x.
            
            Deprecated: Please use t/Agent."
       :deprecated "1.1.6"
       :superseded-by `t/Agent
       :forms '[(Agent1 x)]}
     t/Agent1
     t/Agent))

#?(:clj
(t/defalias
  ^{:doc "A Clojure promise (see clojure.core/{promise,deliver})."
    :forms '[(Promise x)]}
  t/Promise 
  (t/TFn [[x :variance :invariant]]
         (t/I (t/Deref x)
              (clojure.lang.IBlockingDeref x)
              clojure.lang.IPending
              ;; FIXME I think this might be an implementation detail.
              [x :-> (t/Nilable (t/Promise x))]))))

(t/defalias
  ^{:doc "A Clojure proxy."
    :forms '[Proxy]}
  t/Proxy
  clojure.lang.IProxy)

(macros/anns
#?@(:cljs [] :default [
;; Internal annotations
;clojure.core.typed.current-impl/*current-impl* t/Any
clojure.core.typed.current-impl/clojure t/Any
clojure.core.typed.current-impl/clojurescript t/Any
clojure.core.typed/ann* [t/Any t/Any t/Any :-> t/Any]
clojure.core.typed/untyped-var* [t/Any t/Any :-> t/Any]
clojure.core.typed/declare-names* [t/Any :-> t/Any]
clojure.core.typed/typed-deps* [t/Any :-> t/Any]
clojure.core.typed/warn-on-unannotated-vars* [:-> t/Any]
clojure.core.typed/ann-datatype* [t/Any t/Any t/Any t/Any :-> t/Any]
clojure.core.typed/ann-protocol* [t/Any t/Any t/Any :-> t/Any]
clojure.core.typed/ann-record* [t/Any t/Any t/Any t/Any :-> t/Any]
clojure.core.typed/ann-pdatatype* [t/Any t/Any t/Any t/Any :-> t/Any]
clojure.core.typed/declare-datatypes* [t/Any :-> t/Any]
clojure.core.typed/declare-protocols* [t/Any :-> t/Any]
clojure.core.typed/non-nil-return* [t/Any t/Any :-> t/Any]
clojure.core.typed/nilable-param* [t/Any t/Any :-> t/Any]
clojure.core.typed/override-constructor* [t/Any t/Any :-> t/Any]
clojure.core.typed/override-method* [t/Any t/Any :-> t/Any]
clojure.core.typed/typed-deps* [t/Any :-> t/Any]
clojure.core.typed/load-if-needed [:-> t/Any]
clojure.core.typed/*collect-on-eval* t/Any
])


;TODO flip filters
cc/complement (t/All [x] [[x :-> t/Any] :-> [x :-> t/Bool]])
; should preserve filters
cc/boolean [t/Any :-> t/Bool]

; Unions need to support dots for this to work:
;
; (t/All [t0 b :..]
;    (t/IFn [[t/Any :-> t/Any :filters {:then (is t0 0) :else (! t0 0)}] 
;            [t/Any :-> t/Any :filters {:then (is b 0) :else (! b 0)}] :.. b
;             :-> (t/IFn [t/Any :-> t/Any :filters {:then (is (t/U t0 b :.. b) 0) :else (! (t/U t0 b :.. b) 0)}]
;                        [t/Any :* :-> t/Any])]))
cc/some-fn 
(t/All [t0 t1 t2 t3 t4 t5]
       (t/IFn [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/U t0 t1) 0) :else (! (t/U t0 t1) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/U t0 t1 t2) 0) :else (! (t/U t0 t1 t2) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Bool :filters {:then (is t3 0) :else (! t3 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/U t0 t1 t2 t3) 0) :else (! (t/U t0 t1 t2 t3) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Bool :filters {:then (is t3 0) :else (! t3 0)}]
               [t/Any :-> t/Bool :filters {:then (is t4 0) :else (! t4 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/U t0 t1 t2 t3 t4) 0) :else (! (t/U t0 t1 t2 t3 t4) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Bool :filters {:then (is t3 0) :else (! t3 0)}]
               [t/Any :-> t/Bool :filters {:then (is t4 0) :else (! t4 0)}]
               [t/Any :-> t/Bool :filters {:then (is t5 0) :else (! t5 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/U t0 t1 t2 t3 t4 t5) 0) :else (! (t/U t0 t1 t2 t3 t4 t5) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Any] :+ :-> [t/Any :* :-> t/Any]]))
cc/every-pred
(t/All [t0 t1 t2 t3 t4 t5]
       (t/IFn [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/I t0 t1) 0) :else (! (t/I t0 t1) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/I t0 t1 t2) 0) :else (! (t/I t0 t1 t2) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Bool :filters {:then (is t3 0) :else (! t3 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/I t0 t1 t2 t3) 0) :else (! (t/I t0 t1 t2 t3) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Bool :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Bool :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Bool :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Bool :filters {:then (is t3 0) :else (! t3 0)}]
               [t/Any :-> t/Bool :filters {:then (is t4 0) :else (! t4 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/I t0 t1 t2 t3 t4) 0) :else (! (t/I t0 t1 t2 t3 t4) 0)}]
                          [t/Any :* :-> t/Any])]
              [[t/Any :-> t/Any :filters {:then (is t0 0) :else (! t0 0)}] 
               [t/Any :-> t/Any :filters {:then (is t1 0) :else (! t1 0)}]
               [t/Any :-> t/Any :filters {:then (is t2 0) :else (! t2 0)}]
               [t/Any :-> t/Any :filters {:then (is t3 0) :else (! t3 0)}]
               [t/Any :-> t/Any :filters {:then (is t4 0) :else (! t4 0)}]
               [t/Any :-> t/Any :filters {:then (is t5 0) :else (! t5 0)}]
               :-> (t/IFn [t/Any :-> t/Bool :filters {:then (is (t/I t0 t1 t2 t3 t4 t5) 0) :else (! (t/I t0 t1 t2 t3 t4 t5) 0)}]
                          [t/Any :* :-> t/Any])]
              [(t/+ [t/Any :-> t/Any]) :-> [t/Any :* :-> t/Any]]))

cc/str [t/Any :* :-> t/Str]
cc/prn-str [t/Any :* :-> t/Str]
cc/pr-str [t/Any :* :-> t/Str]
cc/newline [:-> nil]

cc/print [t/Any :* :-> nil]
cc/println [t/Any :* :-> nil]
cc/print-str [t/Any :* :-> t/Str]
cc/println-str [t/Any :* :-> t/Str]
#?@(:cljs [] :default [
cc/printf [t/Str t/Any :* :-> nil]
cc/format [t/Str t/Any :* :-> t/Str]
])
cc/pr [t/Any :* :-> nil]
cc/prn [t/Any :* :-> nil]
cc/flush [:-> nil]
cc/*print-length* (t/U nil false t/AnyInteger)
cc/*print-level* (t/U nil false t/AnyInteger)
#?@(:cljs [] :default [
cc/*verbose-defrecords* t/Bool
cc/print-ctor [Object [Object java.io.Writer :-> t/Any] java.io.Writer :-> nil]
])

cc/prefer-method [t/Multi t/Any t/Any :-> t/Any]
#?@(:cljs [] :default [
cc/print-simple [t/Any java.io.Writer :-> nil]
cc/char-escape-string (t/Map Character t/Str)
cc/char-name-string (t/Map Character t/Str)
cc/primitives-classnames (t/Map Class t/Str)
cc/namespace-munge [(t/U t/Sym t/Namespace) :-> t/Str]
;cc/find-protocol-impl ['{:on-interface Class
;                                   :impls ?}]

cc/method-sig [java.lang.reflect.Method :-> '[t/Any t/AnyNilableNonEmptySeq t/Any]]
cc/proxy-name [Class (t/Seqable Class) :-> t/Str]
cc/get-proxy-class [Class :* :-> Class]
cc/construct-proxy [Class t/Any :* :-> t/Any]
cc/init-proxy [t/Proxy (t/Map t/Str t/Any) :-> t/Proxy]
cc/update-proxy [t/Proxy (t/Map t/Str t/Any) :-> t/Proxy]
cc/proxy-mappings [t/Proxy :-> (t/Map t/Str t/Any)]
cc/proxy-call-with-super (t/All [x] [[:-> x] t/Proxy t/Str :-> x])
cc/bean [Object :-> (t/Map t/Any t/Any)]
])

#?@(:cljs [] :default [
clojure.repl/apropos [(t/U t/Str t/Regex) :-> (t/Seq t/Sym)]
clojure.repl/demunge [t/Str :-> t/Str]
clojure.repl/source-fn [t/Sym :-> (t/U t/Str nil)]
])

 ;would be nice, not quite correct though
; (t/All [x y [m :< (t/Map x y)] k]
;    [(t/Set m) (t/Vec k) :-> (t/Set (t/Map k (Get m k)))])
clojure.set/project (t/All [x y] [(t/Set (t/Map x y)) (t/Vec t/Any) :-> (t/Set (t/Map x y))])
clojure.set/rename (t/All [x y] [(t/Set (t/Map x y)) (t/Map t/Any x) :-> (t/Set (t/Map x y))])
clojure.set/rename-keys (t/All [x y] [(t/Map x y) (t/Map t/Any x) :-> (t/Map x y)])
 ;like filter
clojure.set/select (t/All [x y] (t/IFn [[x :-> t/Any :filters {:then (is y 0)}] (t/Set x) :-> (t/Set y)]
                                       [[x :-> t/Any :filters {:then (! y 0)}] (t/Set x) :-> (t/Set (t/I x (t/Not y)))]
                                       [[x :-> t/Any] (t/Set x) :-> (t/Set x)]))
clojure.set/union (t/All [x] [(t/Set x) :* :-> (t/Set x)])
clojure.set/intersection (t/All [x] [(t/+ (t/Set x)) :-> (t/Set x)])
clojure.set/difference (t/All [x] [(t/Set x) (t/Set t/Any) :* :-> (t/Set x)])
 
; FIXME should be [t/Str [t/Any :-> t/Any] :-> t/Str]
clojure.string/escape [t/Str (t/U (t/Map t/Any t/Any) [t/Any :-> t/Any]) :-> t/Str]
clojure.string/split-lines [t/Str :-> (t/Vec t/Str)]

clojure.test.tap/print-tap-plan [t/Any :-> t/Any]
clojure.test.tap/print-tap-diagnostic [t/Str :-> t/Any]
clojure.test.tap/print-tap-pass [t/Any :-> t/Any]
clojure.test.tap/print-tap-fail [t/Any :-> t/Any]

#?@(:cljs [] :default [
clojure.java.shell/sh [t/Any :*
                       ;would be nice (combine :* and kw args)
                       ; t/Str :*
                       ;& :optional {:in t/Any  ;; any valid input to clojure.java.io/copy
                       ;             :inc-enc t/Str :out-env (t/U ':bytes t/Str)
                       ;             :env (t/U (Array t/Str) (t/Map t/Any t/Any))
                       ;             :dir (t/U t/Str java.io.File)}
                       :-> '{:exit t/Str
                            :out (t/U (Array byte) t/Str)
                            :err t/Str}]
clojure.java.browse/browse-url [t/Any :-> t/Any]
clojure.java.io/delete-file [clojure.java.io/Coercions (t/? t/Any) :-> t/Any]
clojure.java.io/make-parents [(t/+ clojure.java.io/Coercions) :-> t/Any]
clojure.java.io/file [(t/+ clojure.java.io/Coercions) :-> java.io.File]
clojure.java.io/as-relative-path [clojure.java.io/Coercions :-> t/Str]
;; TODO second arg is flattened IOFactoryOpts
clojure.java.io/reader [clojure.java.io/IOFactory :-> java.io.BufferedReader]
;; TODO second arg is flattened IOFactoryOpts
clojure.java.io/writer [clojure.java.io/IOFactory :-> java.io.BufferedWriter]
clojure.java.io/resource [t/Str (t/? ClassLoader) :-> (t/Nilable java.net.URL)]
clojure.stacktrace/e [:-> t/Any]
clojure.stacktrace/print-cause-trace [Throwable :-> t/Any]
clojure.stacktrace/print-stack-trace [Throwable :-> t/Any]
clojure.stacktrace/print-throwable [Throwable :-> t/Any]
clojure.stacktrace/root-cause [Throwable :-> Throwable]
;; FIXME keyword arguments
clojure.reflect/reflect [(t/+ t/Any) :-> (t/Map t/Any t/Any)]
clojure.inspector/atom? [t/Any :-> t/Bool]
clojure.inspector/collection-tag [t/Any :-> t/Keyword]
clojure.inspector/tree-model [t/Any :-> t/Any]
clojure.inspector/old-table-model [t/AnySeqable :-> t/Any]
clojure.inspector/inspect [t/Any :-> javax.swing.JFrame]
clojure.inspector/inspect-tree [t/Any :-> javax.swing.JFrame]
clojure.inspector/inspect-table [t/AnySeqable :-> javax.swing.JFrame]
])

#?@(:cljs [] :default [
clojure.main/demunge [t/Str :-> t/Str]
clojure.main/repl-prompt [:-> t/Any]
clojure.main/repl-read [t/Any t/Any :-> t/Any]
clojure.main/repl-caught [Throwable :-> t/Any]
clojure.main/repl-exception [Throwable :-> t/Any]
clojure.main/root-cause [Throwable :-> Exception]
clojure.main/repl [& :optional {:init [:-> t/Any]
                                :need-prompt [:-> t/Any]
                                :prompt [:-> t/Any]
                                :flush [:-> t/Any]
                                :read [t/Any t/Any :-> t/Any]
                                :eval [t/Any :-> t/Any]
                                :print [t/Any :-> t/Any]
                                :caught [Throwable :-> t/Any]}
                   :-> t/Any]
clojure.main/main [t/Any :* :-> t/Any]
clojure.main/load-script [t/Str :-> t/Any]
])

clojure.walk/keywordize-keys [t/Any :-> t/Any]
clojure.walk/macroexpand-all [t/Any :-> t/Any]
clojure.walk/postwalk [[t/Any :-> t/Any] t/Any :-> t/Any]
clojure.walk/postwalk-demo [t/Any :-> t/Any]
clojure.walk/postwalk-replace [(t/Map t/Any t/Any) t/Any :-> t/Any]
clojure.walk/prewalk [[t/Any :-> t/Any] t/Any :-> t/Any]
clojure.walk/prewalk-demo [t/Any :-> t/Any]
clojure.walk/prewalk-replace [(t/Map t/Any t/Any) t/Any :-> t/Any]
clojure.walk/stringify-keys [t/Any :-> t/Any]
clojure.walk/walk [[t/Any :-> t/Any] [t/Any :-> t/Any] t/Any :-> t/Any]

clojure.zip/zipper [[t/Any :-> t/Any] [t/AnySeqable :-> (t/U nil (t/Seq t/Any))] 
                    [t/Any (t/U nil (t/Seq t/Any)) :-> t/Any]
                    t/Any 
                    :-> (t/Vec t/Any)]
clojure.zip/seq-zip [t/Any :-> (t/Vec t/Any)]
clojure.zip/vector-zip [t/Any :-> (t/Vec t/Any)]
clojure.zip/xml-zip [t/Any :-> (t/Vec t/Any)]
clojure.zip/node [(t/Vec t/Any) :-> t/Any]
clojure.zip/branch? [(t/Vec t/Any) :-> t/Bool]
clojure.zip/children [(t/Vec t/Any) :-> (t/U nil (t/Seq t/Any))]
clojure.zip/root [(t/Vec t/Any) :-> t/Any]
clojure.zip/rightmost [(t/Vec t/Any) :-> (t/Vec t/Any)]
clojure.zip/right [(t/Vec t/Any) :-> t/Any]
clojure.zip/up [(t/Vec t/Any) :-> (t/U nil (t/Vec t/Any))]
clojure.zip/rights [(t/Vec t/Any) :-> t/Any]
clojure.zip/replace [(t/Vec t/Any) t/Any :-> (t/Vec t/Any)]
clojure.zip/down [(t/Vec t/Any) :-> (t/U (t/Vec t/Any) nil)]
clojure.zip/left [(t/Vec t/Any) :-> (t/U (t/Vec t/Any) nil)]
clojure.zip/lefts [(t/Vec t/Any) :-> (t/U (t/Vec t/Any) nil)]
clojure.zip/leftmost [(t/Vec t/Any) :-> (t/U (t/Vec t/Any) nil)]
clojure.zip/append-child [(t/Vec t/Any) t/Any :-> (t/Vec t/Any)]
clojure.zip/branch? [(t/Vec t/Any) :-> t/Bool]
clojure.zip/end? [(t/Vec t/Any) :-> t/Bool]
clojure.zip/insert-child [(t/Vec t/Any) t/Any :-> (t/Vec t/Any)]
clojure.zip/insert-left [(t/Vec t/Any) t/Any :-> (t/Vec t/Any)]
clojure.zip/insert-right [(t/Vec t/Any) t/Any :-> (t/Vec t/Any)]
clojure.zip/next [(t/Vec t/Any) :-> (t/Vec t/Any)]
clojure.zip/prev [(t/Vec t/Any) :-> (t/U (t/Vec t/Any) nil)]
;; more to say here
clojure.zip/path [(t/Vec t/Any) :-> t/Any]
clojure.zip/remove [(t/Vec t/Any) :-> (t/Vec t/Any)]

; need better metadata support if this even has a chance of working
; like class
;; idea: provide global registry of :type mappings to qualified keywords.
;; users can register their types to opt in. Add a new path element so we
;; can refine the type if the result is found to be a kw (and if the arg has immutable metadata),
;; eg., cc/type [t/Any :-> t/Any :obj {:id 0 :path [Type]}]
cc/type [t/Any :-> t/Any]

#?@(:cljs [] :default [
cc/promise (t/All [x] [:-> (t/Promise x)])
cc/deliver (t/All [x] [(t/Promise x) x :-> (t/Nilable (t/Promise x))])
])

;cast to java array
;; TODO rethink input and output types. eg.,
;;      cc/booleans [(ReadyOnlyArray boolean) :-> (t/U nil (Array boolean))]
;; TODO objects??
;;      cc/objects [(ReadyOnlyArray Object) :-> (t/U nil (ReadyOnlyArray Object))]
;;                                  
;; TODO propagate to Numbers/booleans etc
;cc/booleans [t/Any :-> (t/U nil (Array boolean))]
;cc/bytes [t/Any :-> (t/U nil (Array byte))]
;cc/chars [t/Any :-> (t/U nil (Array char))]
;cc/shorts [t/Any :-> (t/U nil (Array short))]
;cc/ints [t/Any :-> (t/U nil (Array int))]
;cc/longs [t/Any :-> (t/U nil (Array long))]
;cc/floats [t/Any :-> (t/U nil (Array float))]
;cc/doubles [t/Any :-> (t/U nil (Array double))]

#?@(:cljs [] :default [
cc/*file* t/Str
])
cc/*command-line-args* (t/NilableNonEmptyASeq t/Str)
#?@(:cljs [
cc/*unchecked-if* t/Bool
cc/*unchecked-arrays* t/Bool
cc/*warn-on-infer* t/Bool
cc/enable-console-print! [:-> t/Any]
] :default [
cc/*warn-on-reflection* t/Bool
cc/*compile-path* t/Str
cc/*compile-files* t/Bool
cc/*unchecked-math* t/Bool
cc/*compiler-options* (t/Map t/Any t/Any)
cc/*in* java.io.Reader
cc/*out* java.io.Writer ;; FIXME cljs
cc/*err* java.io.Writer
cc/*repl* t/Any
])
cc/*flush-on-newline* t/Bool
cc/*print-meta* t/Bool
cc/*print-dup* t/Bool
cc/*print-readably* t/Bool
#?@(:cljs [] :default [
cc/*read-eval* (t/U ':unknown t/Bool)
])

#?@(:cljs [
;TODO
;cljs.pprint/cl-format [(t/U cljs.core/IWriter nil t/Bool) t/Str t/Any :* :-> (t/U nil t/Str)]
;cljs.pprint/fresh-line [:-> t/Any]
;cljs.pprint/get-pretty-writer [cljs.core/IWriter :-> cljs.core/IWriter]
;clojure.pprint/pprint (t/IFn [t/Any :-> nil]
;                             [t/Any java.io.Writer :-> nil])
] :default [
clojure.pprint/cl-format [(t/U java.io.Writer nil t/Bool) t/Str t/Any :* :-> (t/Nilable t/Str)]
clojure.pprint/fresh-line [:-> t/Any]
clojure.pprint/get-pretty-writer [java.io.Writer :-> java.io.Writer]
clojure.pprint/pprint [t/Any (t/? java.io.Writer) :-> nil]
])

#?@(:cljs [] :default [
clojure.repl/pst (t/IFn [:-> nil]
                        [(t/U t/Int Throwable) :-> nil]
                        [Throwable t/Int :-> nil])
clojure.repl/print-doc [t/Sym :-> t/Any]
clojure.repl/find-doc [(t/U t/Str t/Regex) :-> t/Any]
clojure.repl/source-fn [t/Any :-> (t/U nil t/Str)]
clojure.java.javadoc/javadoc [Object :-> t/Any]
complete.core/completions
[t/Any (t/? t/Any) :-> t/Any]
])
)