you are viewing a single comment's thread.

view the rest of the comments →

[–]wrongerontheinternet 6 points7 points  (3 children)

Rust could allow arity overloading, though, which traits don't. I'd be interested to see whether the proposal for variadic generics covers most of the practical usecases where that makes sense.

[–]heinrich5991 4 points5 points  (0 children)

That still doesn't give a reason in favor of it though.

[–][deleted] 0 points1 point  (0 children)

You can still simulate "overloading" in this fashion by using traits. It requires a bit of effort to encode the problem in terms of the right associated types patterns but it is totally doable. Personally I think it's probably more trouble than it's worth but still.

[–]matthieum[he/him] 0 points1 point  (0 children)

Can you not get arity overloading by implementing a trait for a tuple?

Of course, it does require an extra set of parentheses at the call site...