types+grammar: more work on ch5