3 ms·
Why not? Rust isn't limited to what Haskell does, and a lot of it's features are driven by a desire for parity with C++, which does have variadic generics. Oth
by Diggsey 5y ago
Why not? Rust isn't limited to what Haskell does, and a lot of it's features are driven by a desire for parity with C++, which does have variadic generics.
Other languages in the same domain (like D) also have variadic generics.
- masklinn 5y agoBecause Rust’s generics are patterned after Haskell’s (traits are dual to type classes), not C++’ templates.
- Diggsey 5y agoYou're conflating traits with generics. Generics exist without traits, and in Rust they are more closely aligned with C++ templates than anything else, since they are implemented via monomorphisation, whereas in Haskell they are not. Regardless, Rust is not "patterned" after a single other language. It's influenced by many langauges, so it makes no sense to say that one feature is just copied straight from a specific other language.