"This post started out as a gist meant to help work through what I’ve learned about category theory by applying it to something I already knew, JavaScript. The surprising result is a clearly defined set of JavaScript functions and jQuery helpers that can be optimized to reduce execution time. In the course of this post we’ll define two categories: one for HTMLElements and the other for jQuery objects. We’ll then construct a Functor that maps from the category of HTMLElements to the category of jQuery objects. At the end we’ll see how jQuery plugin authors can help user’s speed up their JavaScript using what we learned along the way."