useful functions that have not found a proper place yet
useful functions that have not found a proper place yet
(assert m spec)
checks that m conforms to spec. Returns an error message on error or nil otherwise
checks that m conforms to spec. Returns an error message on error or nil otherwise
(coerce m coercers)
takes a map and a mapping of keyword to a 1 argument function. Recursively transforms m by updating its value through the passed functions. Non existent values are ignored
takes a map and a mapping of keyword to a 1 argument function. Recursively transforms m by updating its value through the passed functions. Non existent values are ignored
(combinations n coll)
returns a lazy sequence of all the possible combinations of the elements in coll in groups of n members. Example: (combinations 2 [:a :b :c]) ;;=> ((:a :b) (:a :c) (:b :c))
returns a lazy sequence of all the possible combinations of the elements in coll in groups of n members. Example: (combinations 2 [:a :b :c]) ;;=> ((:a :b) (:a :c) (:b :c))
(jsonista value)
returns a string representation of Java objects or the object itself otherwise
returns a string representation of Java objects or the object itself otherwise
(map-vals f)
(map-vals f coll)
map over values ONLY
map over values ONLY
(some pred? coll)
an alternative version of Clojure's some which uses reduce instead of recur. Useful for collections that know how to reduce themselves faster than first/next
Returns the value that caused (pred? value) to be true; as opposed to Clojure's
an alternative version of Clojure's some which uses reduce instead of recur. Useful for collections that know how to reduce themselves faster than first/next Returns the value that caused (pred? value) to be true; as opposed to Clojure's
(unique)
(unique coll)
Returns a lazy sequence of the elements of coll with duplicates removed. Returns a stateful transducer when no collection is provided.
Returns a lazy sequence of the elements of coll with duplicates removed. Returns a stateful transducer when no collection is provided.
(unique-by pred)
(unique-by attr coll)
Returns a lazy sequence of the elements of coll with duplicates attributes removed. Returns a stateful transducer when no collection is provided.
Returns a lazy sequence of the elements of coll with duplicates attributes removed. Returns a stateful transducer when no collection is provided.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close