Hacker News new | ask | show | jobs
by GeoJawDguJin 6348 days ago
Typesafe generics have been in ML from the get-go (1970s) from what I remember. People like to talk about how type inference is useful, but it's really the generic polymorphism that makes it shine.

I was hacking together an Arc interpreter in Haskell the other day, and after refactoring some of the hairier monadic code, I was horrified to see that the type signature for a particular function was twice as long as the function body. And that's with the compiler figuring it out for me... I don't know what I'd have done if it was C++ instead.

1 comments

It's really amusing (in an oh-my-God-I'm-fucked way) to try and debug type errors in Happy-generated parsers. There have been times when the type of the function (not even the whole error message) has been a page long.

C++ STL code can be similarly (un)fun.

Intel's C++ compiler produces much more readable error message, I find. Though, almost perversely, I've gotten used enough to GCC's cryptic template error output that I'm more comfortable with it.