core: use associated type to store pretty printer modes