Hacker News new | past | comments | ask | show | jobs | submit login

Haskell hides this complexity and allows you to write just:

add x y = x + y

There is no functions returning functions here, just a normal addition. It is perfectly readable.




Yes, it is perfectly readable. But: there is a function returning a function.

Haskell just decided to have a syntax (and type system) that can handle this without inducing nausea in the programmer.

As with everything, this comes with trade-offs. For example, Haskell's syntax (and type system) have a much harder time dealing with optional arguments. Something that eg Python does just fine, and that even C handles OK in the form of varargs.




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

Search: