let hash (te,dims) = 31*(Typ.hash te) + dims