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

mapv*clj

(mapv* f coll)

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

(into [] (map inc) nil) => 75 ns (into [] (map inc) (range 1000)) => 17 us (into [] (map inc) (vec (range 1000))) => 17 us

(mapv inc nil) => 70 ns (mapv inc (range 1000)) => 21 us (mapv inc (vec (range 1000))) => 19 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.

(into [] (map inc) nil) => 75 ns
(into [] (map inc) (range 1000)) => 17 us
(into [] (map inc) (vec (range 1000))) => 17 us

(mapv inc nil) => 70 ns
(mapv inc (range 1000)) => 21 us
(mapv inc (vec (range 1000))) => 19 us

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

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

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