background preloader

Clojure

Facebook Twitter

Swannodette/mori. Core — Reducers - A Library and Model for Collection Processing. I'm happy to have pushed today the beginnings of a new Clojure library for higher-order manipulation of collections, based upon reduce and fold.

core — Reducers - A Library and Model for Collection Processing

Of course, Clojure already has Lisp's reduce, which corresponds to the traditional foldl of functional programming. reduce is based upon sequences, as are many of the core functions of Clojure, like map, filter etc. So, what could be better? It's a long story, so I'll give you the ending first: Functional Programming For The Rest of Us. A little bit of CPS, a few thunks, and a trampoline. A couple of weeks ago I gave a talk for the Triangle Clojure Users Group giving an overview of the state of constant space tail calls in Clojure and the techniques employed in the Clojure Tail Call Optimization compiler (hereafter known as Clojure TCO or CTCO) to improve that support.

A little bit of CPS, a few thunks, and a trampoline

Rather than following my normal routine of writing up slides and then practicing the talk to death, I wrote a set of extensive notes to fully flesh out all the topics I wanted to cover and then gave the talk more off-the-cuff and used notes and drawings on a whiteboard. Unfortunately there’s no recording of that talk, but I figured I could share my original notes. I’ve cleaned them up a bit, removing the parts that make reference to specifics of the talk, but they’re still a bit unapologetically rough. Introduction A History Lesson.