2 ms·
Can you honestly tell me any usage of reified generics outside of perhaps ArrayList<int> possibly having another more performant implementation? The amount of
by kaba0 4y ago
Can you honestly tell me any usage of reified generics outside of perhaps ArrayList<int> possibly having another more performant implementation?
The amount of time I’ve seen it complained about, yet in practice I am very seldom hit by that (just a note, Haskell also erases every type yet it doesn’t bother anyone there).
- culturedsystems 4y agoThe post gives an example - overloading a method based on the type parameter (e.g separate overloads for Option<Integer> and Option<Double>). This is why Java's generic erasure is more of a problem than Haskell's type erasure: Java erases generic parameters at compile time, whereas Haskell retains type information for long enough to use it when linking modules.