News for hackers. Stuff that matters.
Re:Clojure Don’ts: Lazy Effects (2015) by serpix on Saturday March 03, 2018 @05:19PM (#16511996)
always mapv when doing I/O on the backend and always extra vec when returning sequences in the frontend
Re:Clojure Don’ts: Lazy Effects (2015) by joncampbelldev on Saturday March 03, 2018 @05:52PM (#16512182)
run! and doseq are for IO on each element of a sequence. Functions like mapv are intended for data transformation, not side-effects. This is why run! and doseq return nil
Re:Clojure Don’ts: Lazy Effects (2015) by djtango on Monday March 05, 2018 @05:22PM (#16525090)
I don't often find myself doing sequential side effects so often anymore, but when I do doseq has been my go to, though I will confess I didn't know about run! until this thread.