News for hackers. Stuff that matters.
Re:Differences Between `Foldl` and `Foldr` by brabel on Monday October 05, 2026 @02:31PM (#49968630)
Fewer bugs is such a wild claim. Especially since study after study has shown that to be wishful thinking. Haskell apps have just as many bugs in general as anything else.
Re:Differences Between `Foldl` and `Foldr` by anyfoo on Monday October 05, 2026 @05:42PM (#49971254)
Can you produce those studies? Genuinely interested. Intuitively, I would have thought properly used Haskell prevents a lot of bugs by virtue if its type system, which allows for encoding internal constraints to a certain degree.

The extreme end of this is dependent types, which is so strong that it can be used as a foundation for mathematics itself, and is the principle that the Lean, the proof assistance, is used on. A Lean "program" is effectively proven to be bug-free.

Re:Differences Between `Foldl` and `Foldr` by brabel on Wednesday October 07, 2026 @04:02PM (#49998078)
Someone else posted a danluu study that is very good. I've read many more studies over the years and NEVER seen one showing a significant advantage for Haskell and similar languages. Try Google Scholar and you'll find some for sure.

Also, just think about this: what bugs have you had in your software historically? How many of those do you believe would've been prevented by a type system like Haskell's?? At least for my software, nearly every bug is a logical bug that no type system could've prevented (though I do use typed languages like Java and Kotlin).

The only thing that ever made a difference in the number of bugs in any study I've seen was not the language, but good testing and the experience of the developer.

> A Lean "program" is effectively proven to be bug-free.

You misunderstand this. Lean proves the program matches a specification. It doesn't and can't prove the specification is for the "right thing" - in other words, if your specification itself has wrong or bad assumptions, you'll still have bugs. Now, who is going to prove the specification is specifying the "right things"? It's turtles all the way.

Re:Differences Between `Foldl` and `Foldr` by tome on Thursday October 08, 2026 @03:40AM (#50002901)
This comment by nh2 (on Reddit) is my favourite response to that line of thinking. I recommend reading the whole thing. Excepts:

> You're not going to get any "credible empirical evidence" already because the sample size is so small. That would require getting, say, 100 companies that are similar in size and tasks, have a working business model and are still around, and also want to spend time on methotically collecting concrete evidence, and care to blog about that.

> people don't really want to spend time stating the obvious

> We don't spend time blogging that on our Haskell server, we get pretty much none of [run time type error or segfault] because well, those don't exist in Haskell

> We're convinced it's the best tool for the server job, compared to other tech we used at past jobs and projects. So we're using Haskell for it, and we started it in Haskell. We cannot compare before/after, because we directly started it in the "best tool available". We can compare our current project to our past individual work experience, but one cannot simply turn such individual cross-project experience into quantitative evidence

https://www.reddit.com/r/haskell/comments/1plsmqh/comment/nt...

Re:Differences Between `Foldl` and `Foldr` by brabel on Thursday October 08, 2026 @03:13PM (#50010585)
As long as you recognize that this is a perfect example of an anecdote and as such cannot be generalized to anything, and others could provide just the same “experience” for pretty much any language being the best. It’s telling that the poster can’t even compare with other languages as they started with the “best”! Yeah yeah I am sure you chose perfectly first time… we all know that doing some research on paper always proves to end up with the perfect choices.
Re:Differences Between `Foldl` and `Foldr` by tome on Friday October 09, 2026 @02:24AM (#50016721)
I think you've got it exactly backwards. The comment is supposed to explain that there can't be a scientific determination of such a matter, not that it itself is such a determination.
Re:Differences Between `Foldl` and `Foldr` by anyfoo on Thursday October 08, 2026 @06:36PM (#50013404)
No, I'm not misunderstanding, and you are pushing goalposts. The majority of programs above a certain size would benefit tremendously if they were "matching a specification". Sure, the specification itself may not be fully correct, but a lot, if not most bugs, are code that would go against such a specification.

> Also, just think about this: what bugs have you had in your software historically? How many of those do you believe would've been prevented by a type system like Haskell's??

I program Haskell all the time, and I encounter "non-bugs" where the compiler prevented me from doing something, which other languages would not have, on the regular.

> (though I do use typed languages like Java and Kotlin)

Those are not even close to a Hindley-Milner based type system like the one in Haskell.