Fork me on GitHub
#clj-kondo
<
2022-07-21
>
sheluchin11:07:08

I wonder if it would be possible to have a linter for this guideline: > Only use pure functions with the lazy sequence operations like map, filter, take-while, etc. When you need side effects, use one of these alternatives: https://stuartsierra.com/2015/08/25/clojure-donts-lazy-effects

borkdude11:07:45

I think we could, certainly if you use a side-effecting clojure var directly in map, etc. With composite functions, we need to introduce some side-effect tracking stuff

sheluchin11:07:18

It seems to me like it would be helpful. Reasoning about how lazy sequence operations get evaluated can get confusing at times, but with this guideline it's pretty clear how to avoid most of the trouble.

sheluchin13:07:51

I created https://github.com/clj-kondo/clj-kondo/issues/1757 in case there is more interest in this idea.