TypeEq: Protocol equivalence by typing