Open neapel opened 10 years ago
Did you try the clojure.core/cond-> arrow?
I don't understand how this would work using cond->
? It accepts a value as the first argument like all the other arrows, my idea was about introducing a higher-order arrow that returns a function, which when given a value returns the same result as the other arrows do when given that value as the first argument.
Edit (confused cond->
and condp
. There wouldn't be a useful fncond->
version because the clauses would have no way to access the value)
I'm quite new to clojure and not sure if there isn't a better way already, but I found myself writing things like
quite often. Which I instinctively want to write in a point-free style, but this means I'll loose the comfort and readability of arrows:
I'm using these trivial helper macros now:
which allow writing
Would that be a candidate for inclusion in swiss-arrows?