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

Something went wrong in the adoption process.

Haskell's biggest benefit is functions, not methods. To define a function, you need to stop directly mutating, and instead rely maps, folds, filters, etc. The bargain was: you give up your familiar and beloved for-loops, and in return you get software that will yield the same output given the same input.

So what happened with the adoption? The Java people willingly gave up the for-loops in favour of the Streams/maps/filters. But they didn't take up the reward of software that yields the same input given the same output.

What's something else in the top-5 killer Haskell features? No nulls. The value proposition is: if you have a value, then you have a value, no wondering about whether it's "uninitialised". The penalty you pay for this is more verbosity when representing missing values (i.e. Maybe).

Again, the penalty (verbose missing values ie. Optional<>) was adopted, and the reward (confidently-present values) was not.



> Again, the penalty (verbose missing values ie. Optional<>) was adopted, and the reward (confidently-present values) was not.

Ah, the joys of having a Scala `Option` type and still having to consider the cases or Some[thing], Nothing and... null!

Yes, well-written Scala code knows not to use null with reckless abandon, but since when your coworkers coming from Java know to show restraint?


The type system is a big part and elements of that have shown up elsewhere. I’m with you on the belief that we should have better adoption for immutability, pure functions, and equational reasoning.

JavaScript promises can work analogously to the Maybe monad if you want them to.

Swift’s optionals are essentially the same thing as the Maybe monad.




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

Search: