Hacker News new | ask | show | jobs
by unscaled 2961 days ago
I guess this was your point, but the problem is how Java does does type erasure. With Haskell type erasure is an implementation detail, but with Java it leaks into the compile-time type checker. For instance, you can't have both these overloads:

    public void foo(List<String> list)
    public void foo(List<Integer> list)
This just wouldn't compile.
2 comments

The problem there is that the equivalent Haskell would dispatch statically, whereas this is dynamic dispatch in java
Not today, but in the future it might, depending on how the work on value types will turn out.