4 ms·
> Unidirectional type inference would make for more intelligible compiler errors. Full Hindley-Milner can get confusing. Bidirectional type checking has good e
by Hirrolot 3y ago
> Unidirectional type inference would make for more intelligible compiler errors. Full Hindley-Milner can get confusing.
Bidirectional type checking has good error messages and a very intuitive implementation.
- lolinder 3y agoRather than just taking a statement from OP and stating the opposite, can you elaborate on why you disagree with them? My personal experience has been very much in line with OP's: nonlocal type inference (in Rust specifically) frequently makes code hard to modify because a change can cause inference to fail in unexpected ways and places. Local inference doesn't have the same tendency.
- debugnik 3y agoThey didn't state the opposite, bidirectional typing rules are a technique to describe a type system, distinct from both Hindley-Milner's and simple "unidirectional" checking. I'm using it for my personal lang project and I'm quite satisfied as well, it translates easily into code and interacts well with subtyping.