(<f facet this)
given a facet keyword and something, return the registered or default implementation
given a facet keyword and something, return the registered or default implementation
(<fs t)
get all facets implementations for the given type
get all facets implementations for the given type
(declare-alias type sym)
register a type-alias ex: (declare-alias clojure.lang.PersistentVector ::vec)
register a type-alias ex: (declare-alias clojure.lang.PersistentVector ::vec)
(declare-derived-type name parents & [constructor impl-map])
same as declare-type but inherit all impls of the given parents, unless overiden via impl-map parameter
same as declare-type but inherit all impls of the given parents, unless overiden via impl-map parameter
(declare-facet name & [impl-map])
declare a new facet, just a fancy name for behavior or method ex: (declare-facet ::say-hello {::type1 (fn [x] (println "hello from type 1")) ::type2 (fn [x] (println "hello from type 2")) :default (fn [x] (println "default hello from a type that doesn't implement ::say-hello))})
declare a new facet, just a fancy name for behavior or method ex: (declare-facet ::say-hello {::type1 (fn [x] (println "hello from type 1")) ::type2 (fn [x] (println "hello from type 2")) :default (fn [x] (println "default hello from a type that doesn't implement ::say-hello))})
(declare-type name & [constructor impl-map])
declare a new datatype, attaching it the given constructor and facets implementations. ex: (declare-type ::foo identity {:say-hello (fn [this] (println "hello from foo"))})
declare a new datatype, attaching it the given constructor and facets implementations. ex: (declare-type ::foo identity {:say-hello (fn [this] (println "hello from foo"))})
(extend-facet name impl-map)
assoc new implementations to existing facet
assoc new implementations to existing facet
(extend-type name impl-map)
assoc new facets implementation to existing type
assoc new facets implementation to existing type
(prefer type & types)
register a type preference, 'type' will be prefered over 'types'
register a type preference, 'type' will be prefered over 'types'
(reify this parents-or-impl-map)
(reify this parents impl-map)
anonymous type, that can inherit from one or several existing types
anonymous type, that can inherit from one or several existing types
(t e)
(t sym e)
artity 2: assign type sym to e arity 1: get the type tag of e
artity 2: assign type sym to e arity 1: get the type tag of e
(t= x & xs)
check if all given args are of same type
check if all given args are of same type
(t> t & args)
generic constructor call. apply the constructor of type t to args
generic constructor call. apply the constructor of type t to args
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close