In the notes, simplified some of the compiler by factoring out a utility, compileMap().