Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thank you for your detailed answer.

If I gather from the other answers here correctly, the Haskell money feature (for abstraction) is type-classes.

FYI, I'm keying off of abstractions/features here because I see that as a clear route towards writing less code (less bugs).



> If I gather from the other answers here correctly, the Haskell money feature (for abstraction) is type-classes.

On a more elementary level, lots of languages could benefit from algebraic data types. Most languages only support the `product' part of them well, but the `sum' is equally important.

Where product means in terms of C putting things together in a struct, and a sum is more like union. Only that C's unions are dangerous.


I'll also add that type-classes are the main feature in Haskell that Python/Ruby cannot easily encode.

There are many interesting features that Python/Ruby/Lisp-variants can encode, but Haskell does with static guarantees, whereas Python/Ruby use dynamism (e.g: general polymorphism, "duck typing", various strong type system features that Python/Ruby do not "need" because they don't attempt to give guarantees, etc).


You also get far less bugs because of controlled effects and the strong polymorphic types (i.e: Haskell's strong type system).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: