Fixed grammar Show instance, slightly simplified scanner, note on state monad