Types with Attribute Grammars