Tweaked the structure of a functional-style space invaders game to be cleaner and more actually functional. Major insight: moving triggers for sound effects from deep inside the game logic to a separate piece of code that compared the state before and after the frame, and played the appropriate sounds based on that.
Question for the functional programming pros here: would you rather build it this way, or with a writer monad? The writer monad seems like less code overall, and keeps the side effect generation code near the code which generates the sound.