track λ depth throughout type inference