rank 2 types and type inference