Liking cljdoc? Tell your friends :D

noahtheduke.splint.clojure-ext.core


->listclj

(->list coll)

Efficient thread-first friendly concrete list creation.

(apply list (range 1000)) => 40.8 µs (apply list (vec (range 1000))) => 43.8 µs

(->list (range 1000)) => 28.5 µs (->list (vec (range 1000))) => 15.2 µs

Efficient thread-first friendly concrete list creation.

(apply list (range 1000)) => 40.8 µs
(apply list (vec (range 1000))) => 43.8 µs

(->list (range 1000)) => 28.5 µs
(->list (vec (range 1000))) => 15.2 µs
sourceraw docstring

keepvclj

(keepv f coll)

Wrapper around `(into [] (keep f) coll) cuz that's annoying to write. Short-circuits on nil and empty Counted collections.

Wrapper around `(into [] (keep f) coll) cuz that's annoying to write. Short-circuits on nil and empty Counted collections.
sourceraw docstring

mapv*clj

(mapv* f coll)

Efficient version of mapv which operates directly on the sequence instead of Clojure's reduce abstraction.

(doall (map inc nil)) => 30 ns (doall (map inc (range 1000))) => 32 us (doall (map inc (vec (range 1000)))) => 32 us

(into [] (map inc) nil) => 100 ns (into [] (map inc) (range 1000)) => 23 us (into [] (map inc) (vec (range 1000))) => 23 us

(mapv inc nil) => 86 ns (mapv inc (range 1000)) => 15 us (mapv inc (vec (range 1000))) => 15 us

(mapv* inc nil) => 3 ns (mapv* inc (range 1000)) => 22 us (mapv* inc (vec (range 1000))) => 19 us

Efficient version of mapv which operates directly on the sequence
instead of Clojure's reduce abstraction.

(doall (map inc nil)) => 30 ns
(doall (map inc (range 1000))) => 32 us
(doall (map inc (vec (range 1000)))) => 32 us

(into [] (map inc) nil) => 100 ns
(into [] (map inc) (range 1000)) => 23 us
(into [] (map inc) (vec (range 1000))) => 23 us

(mapv inc nil) => 86 ns
(mapv inc (range 1000)) => 15 us
(mapv inc (vec (range 1000))) => 15 us

(mapv* inc nil) => 3 ns
(mapv* inc (range 1000)) => 22 us
(mapv* inc (vec (range 1000))) => 19 us
sourceraw docstring

parse-mapclj

(parse-map obj loc)
source

parse-setclj

(parse-set obj loc)
source

pmap*clj

(pmap* f coll)

Efficient version of pmap which avoids the overhead of lazy-seq.

(doall (pmap (fn [_] (Thread/sleep 100)) coll)) => 3.34 secs (pmap* (fn [_] (Thread/sleep 100)) coll) => 202 ms

Efficient version of pmap which avoids the overhead of lazy-seq.

(doall (pmap (fn [_] (Thread/sleep 100)) coll)) => 3.34 secs
(pmap* (fn [_] (Thread/sleep 100)) coll) => 202 ms
sourceraw docstring

postwalk*clj

(postwalk* f form)

More efficient and meta-preserving clojure.walk/postwalk. Only handles types returned from simple-type. All ISeqs return concrete lists.

(clojure.walk/postwalk identity big-map) => 72 us (postwalk* identity big-map) => 25 us

More efficient and meta-preserving clojure.walk/postwalk.
Only handles types returned from simple-type.
All ISeqs return concrete lists.

(clojure.walk/postwalk identity big-map) => 72 us
(postwalk* identity big-map) => 25 us
sourceraw docstring

run!*clj

(run!* f coll)

Efficient version of run! which operates directly on the sequence instead of Clojure's reduce abstraction. Does not respond to reduced.

(run! inc (range 1000)) => 7 µs (run!* inc (range 1000)) => 950 ns

Efficient version of run! which operates directly on the sequence
instead of Clojure's reduce abstraction. Does not respond to `reduced`.

(run! inc (range 1000)) => 7 µs
(run!* inc (range 1000)) => 950 ns
sourceraw docstring

throw-dup-keysclj

(throw-dup-keys kind ks)
source

vary-meta*clj

(vary-meta* obj f & args)

Like vary-meta but returns the obj if given an object that doesn't support metadata.

Like vary-meta but returns the obj if given an object that doesn't support metadata.
sourceraw docstring

Walkcljprotocol

walk*clj

(walk* form inner outer)

Protocol version of postwalk

Protocol version of postwalk
source

with-meta*clj

(with-meta* obj meta)

Same as clojure.core/with-meta except it doesn't error if the obj doesn't support meta.

Same as clojure.core/with-meta except it doesn't error if the obj doesn't
support meta.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close