Fun with functions, monads, and the DOM