Music theorists have a questionable history of taking tendencies observed in European musics and deploying them as prescriptive rulesets. Fortunately, musicians break the rules whenever it suits them. In fact, cognitive science suggests that rulebreaking and manipulating audience expectations is fundamental to how music is able to provoke emotion. But in the universe of algorithmic music, the balance of power has shifted. The music programmer is both theorist and practicioner. We can, if we choose, use software correctness techniques like schemas and types to enforce musical rules. This gives rise to a dilemma. If we make illegal states unrepresentable, do we make innovative states unimaginable? And if we omit composition rules from our programs altogether, are we really being faithful to a domain where schema violation is itself a first-class concept? This talk will attempt to resolve the dilemma using a practical reconciliation between Paul Hudak’s Haskell school of expression and David Huron’s psychological theory of expectations.