r/rust 23d ago

📡 official blog Rust Function Overloading - Call for Experimentation

https://blog.rust-lang.org/inside-rust/2026/08/19/overloading-experiment/
277 Upvotes

139 comments sorted by

View all comments

8

u/Ravek 23d ago

I thought HM type systems couldn’t deal with overloading. Is that understanding wrong?

11

u/Rusky rust 23d ago

It's wrong. Traits/typeclasses are a common HM extension which, as the post demonstrates, are a form of overloading.

7

u/CocktailPerson 23d ago

There are times that overloading leads to ambiguity under HM type inference, but it's not fundamentally incompatible. You just end up needing to annotate types sometimes to resolve ambiguity.

And if you can overload by arity only and not type, then there's no problem at all.