A Neat Pattern With Juxt

I recently added the function juxt to my toolbox in Clojure.

A good pattern I've discovered is using juxt to perform operations on a data structure and destructuring its return value.

(defn read-files
  [^String path]
  (let [data-files (find-data-files path)
        [prices receipts] ((juxt find-prices-file find-receipt-files) data-files)]
    {:prices (read-prices prices)
     :receipts (apply merge (read-receipts receipts))}))

Master GitHub Actions with a Senior Infrastructure Engineer

As a senior staff infrastructure engineer, I share exclusive, behind-the-scenes insights that you won't find anywhere else. Get the strategies and techniques I've used to save companies $500k in CI costs and transform teams with GitOps best practices—delivered straight to your inbox.

Not sure yet? Check out the archive.

Unsubscribe at any time.