3 ms·
It really is. Since using Haskell, the type systems in the mainstream languages I've used have seemed sorely lacking.
by TazeTSchnitzel 11y ago
It really is. Since using Haskell, the type systems in the mainstream languages I've used have seemed sorely lacking.
- Dewie3 11y agoThough make the type system sufficiently more expressive than Haskell's and you have to give up on type inference again... Though maybe you could restrict how expressive the type system is on something like a module (Haskell module) level, so that you can have type inference if you give up on some power? I don't know.
- Kutta 11y agoType inference doesn't somehow fail if we go beyond Haskell's type system. The inferable subset of the language remains inferable. Haskell already has inferable (Hindley-Milner) and uninferable (higher-rank polymorphism, GADTs) parts. If we go beyond Haskell's type system, it actually becomes crucial for productivity to have powerful type (and term) inference. Agda and Coq both have much more powerful inference than Haskell; it's just that don't bother with using it to realize Hindley-Milner-style annotation-free bindings, because there's little use for it in proof assistants.
- gamegoblin 11y agoHaving used Haskell a lot, I still feel pretty fine about C++ or C# type systems. It's Java's that drives me absolutely insane. Type erasure makes me want to pull my hair out.
- the_af 11y agoI agree that Java is painful to use, but why is type erasure the annoyance that you need to single out? Haskell does type erasure as well.
- gamegoblin 11y agoSomething I find myself wanting to do occasionally, that you can do in C#, is instantiate a generic type with a default constructor. Like if I have a generic type T, I'd like to be able to do `new T()`.
- codygman 11y agoI feel like that comment is a little disingenous or at least needs a caveat after reading this[0]. I know that casts are almost never needed in Haskell code whereas I needed them in my last Android application (correct me if there's another way). 0: http://stackoverflow.com/questions/12468722/does-haskell-erase-types http://stackoverflow.com/questions/12468722/does-haskell-era...
- the_af 11y agoThat stackoverflow answer explains Haskell does type erasure. No, it doesn't work exactly the same as in Java, but nobody claimed it did. The OP claimed Java's type erasure annoyed him, while also claiming he had used Haskell a lot. I merely pointed out Haskell also erases types. I cannot advise you on your Android application without knowing what you're trying to accomplish.