Fork me on GitHub

Hey, I made yet another threading library. What's special about it: - Any arrow defined in this library will thread the passed expression into its arguments. They all obey the form (arrow threading-slot-1 threading-slot-2 ... threading-slot-n). Looking at you cond->. - The anti-threading arrow <- can be used as an equivalent of constantly. (-> 1 (<- 100)) returns 100. - A bunch of arrow fletchings. - Transitionning from ->> to ->: (->> 1 (>>- (-> (/ 2)))) returns 1/2. - Moving an arrow onto a form's arguments: (-> 1 (>-args (-> (+ inc inc inc)))) returns 6. - The teleport fletching/arrow: (-> 5 (•- (+ 1 (-• (* 100))))) returns 501.

👏 4

I love the teleport! Is that original to you?


Thank you ! I wrote it yesterday so it may well be unique to this library but I wouldn't be surprised to find it in other threading libraries. There is also Haskell arrows to ponder on.


I know there are a couple of older clj libs as well which define various other arrows. The one I remember offhand is And there's some discussion of them in the academic literature, IIRC, where they're given bird names, although I can't remember what those are at the moment. I can track it down if you're not already aware.


Thrush operators, that's it.


No need to, I checked them all out.


Oh and stuffs like if->, or->, when-not->, map->, binding->, let-> ... All arrows comme with both -> and ->> variants. There is a also a defthreading macro to define them easily.


Release fun-map 0.2.0, a map can automatically unwrap any value from identities (ref, atom, promise, delay, future …) etc, and provides a new way to construct function invocation path, it allows you decouple function dependencies and can be changed anytime without change function implementation code, make unit testing your function with plain value, but replace it anytime in integration. It can be used as a replacement of prismatic graph with more possibility. It also can replace component library for integration, by introduce no dependency of your code, you write your stoppable component without adapt any protocol or any multimethod implementation. Just put your component in a fun-map as a value, and it’s good to go. A fun-map is just a normal map with auto unboxing ability, it can be used interchangeable with any plain map, all magics are done by the wrapped value/function/identity.


I just wanted to let people know that I have open spots for training and/or consulting in Clojure. Please contact <mailto:[email protected]|[email protected]> if you are interested.

👍 32