Public Vars

Back

associative? (clj)

(source)

function

(associative? coll)
Returns true if coll implements Associative

Examples

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))))

cc/associative? (t/Pred (t/Associative t/Any t/Any))
cc/coll? (t/Pred (t/Coll t/Any))
      ;TODO should these be parameterized?
cc/sequential? (t/Pred t/Sequential)
cc/sorted? (t/Pred (t/Sorted t/Any))
cc/meta [t/Any :-> (t/Nilable (t/Map t/Any t/Any))]
;; FIXME IObj annotations are a hack. doesn't literally return the same reference.
cc/with-meta (t/All [[x :< #?(:clj clojure.lang.IObj
                              :cljs cljs.core/IWithMeta)]]
                    [x (t/Nilable (t/Map t/Any t/Any)) :-> x])
cc/vary-meta (t/All [[x :< #?(:clj clojure.lang.IObj
                              :cljs cljs.core/IWithMeta)] b :..]
                    [x [(t/Nilable (t/Map t/Any t/Any)) b :.. b :-> (t/Nilable (t/Map t/Any t/Any))] b :.. b :-> x])