Hacker News new | ask | show | jobs
by thedataangel 2816 days ago
Java's types become incomprehensible once you start trying to do anything complex with generics.

Haskell _allows_ you to write some true type monstrosities (cf. Lens), but almost all the useful instances of that are wrapped in libraries. Types in app code are typically very readable and expressive.

My main complaint with Haskell's type system vs Java's is actually that Haskell has too few type annotations. The inference is good enough that you usually don't need anything besides the function header, which can make it harder to read code without an IDE if you don't know what types certain functions have.

2 comments

What is the state-of-the-art for Haskell IDEs? The last time I was doing Haskell in anger, I was a college freshman using GHCI and, I think Geany, which was slightly a nightmare. I would expect that there ought to be some pretty powerful stuff nowadays.
I personally use VSCode with the Haskell IDE Engine as a backend.

It's definitely not as nice as something like Visual Studio or IntelliJ, but it's not too bad.

Standard coding practice is to write type signatures for functions.