Hacker News new | ask | show | jobs
by millstone 2014 days ago
Fair points - Haskell is all-in on these ideas, and agreed that do-notation has power well beyond Result and Option. I regret including do-notation in my critique, maybe list comprehensions instead.

I think we disagree on what "different code" ought to mean. I have a C function which multiplies a list of numbers; I make it immediately `return 0` if it hits zero. In C that's the same function, just optimized; in Haskell it's a breaking API change due to laziness. I suppose the languages reflect that difference.

1 comments

I don't think it's about laziness; 99% of the time bailing out of a list operation early vs processing the entire list is a semantic difference that I want to be able to see when I'm reading the code. If what you want to do is really and truly just a performance optimization then the language runtime should be able to do it.