Comment

Comment by jamii

Currying with map/reduce/filter can be hard to read, but list comprehensions are pretty nice:

   (defn get-imcomplete-task-summaries [membername]
      (.then (fetch-data)
             (fn [data]
               (sort-by :time
                        (for [task (:tasks data)
                              :when (= membername (:username task))
                              :when (not (:complete task))]
                          task ;; immutable, no need to copy
                          )))))
It makes me a little sad that functional programming has come to mean map/reduce/filter for lots of people, rather than avoiding mutation which is far more interesting.
parent jamii 12 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton