Here are a list of libraries that I find very useful and make my clojure programming even more joyful. They are grouped (roughly) by categories, and for each of them I try to describe the most frequent used part.
Hopefully you guys could also share some of yours fav libs!
Libraries that use macros
- https://github.com/Engelberg/better-cond : making it much easier to write complex branching logic without too many indentations
-
https://github.com/rplevy/swiss-arrows : The
-!>
macro is just like prog1/aprog1 of emacs lisp, very handy. Also a bunch of other goodies like-<>
- net.cgrand/macrovich for writing macros that supports both clj & cljs
Libraries that (ab)use data readers
- https://github.com/weavejester/hashp, using the #p reader
- https://github.com/philoskim/debux, using the #d/dbg reader etc.
I find myself using hashp most of the time since there is least characters to type. Also debux’s dbgn/clogn is very powerful when debugging form evaluation. There is also https://github.com/dgrnbrg/spyscope, but I didn’t find the need to use it.
Examples of hashp and debux:
user=> #p (let [x 1 y 2] (+ x y))
#p (let [x 1 y 2] (+ x y)) => 3
3
user=> #d/dbgn (let [x 1 y 2] (+ x y))
dbgn: (let [x 1 y 2] (+ x y)) =>
| x =>
| 1
| y =>
| 2
| (+ x y) =>
| 3
| (let [x 1 y 2] (debux.common.util/insert-blank-line) (+ x y)) =>
| 3
3
normal clj/cljs libraries
- https://github.com/weavejester/medley . Goodies like map-keys, map-vals, map-kv, find-first etc.
- for cljs/js interop:
- https://github.com/mfikes/cljs-bean
- https://clojars.org/binaryage/oops
- https://github.com/applied-science/js-interop
- The three seem to be pretty complementary to each other.
-
https://github.com/funcool/cuerdas for string ops, I use it mostly for a usable
format
implementation in cljs. - https://github.com/lambdaisland/glogi for logging in cljs