Re:Hindley-Milner Type Inference (2012)
by CDSlice on Friday July 10, 2020 @04:15PM
(#23795920)
To expand on this, if you use CLion as your Rust IDE it will actually show you the types for all your variables automatically. For example, if you had a line like this:
CLion would then show the type in a faded font where the type would go if you wrote it out manually like so:
This is extremely useful when working with more complicated types such as iterator chain because it lets you see exactly what type everything is without having to manually write it all out and have the compiler check it.
[ Parent
| on HN ]
That's available with VSCode and rust-analyzer too (but I suspect others that piggyback on rust-analyzer got that ability). It can get noisy fast, but you can toggle hints for when you need them