News for hackers. Stuff that matters.
Re:The general value of typed functional programming lies in... by LessDmesg on Monday February 24, 2020 @01:38PM (#22406940)
Exceptions and Maybe types aren't mutually exclusive. They should be used together. Maybe types handle variability that is expected and predictable, like a dictionary not having a certain key; exceptions handle the unexpected situations, like a file handle being closed too early.

Maybes explicitly express what the programmer has foreseen, exceptions form a safety net over it. You need both in a wholesome language. That's wht even Haskell has exceptions.

Re:The general value of typed functional programming lies in... by nicoburns on Monday February 24, 2020 @05:07PM (#22408966)
Having used Rust, which almost exclusively uses Maybe types, I have to disagree. The "safety net" introduced by exceptions just hides possible errors, and causes reliability problems that would be entirely avoidable if Maybe types were used. The `?` operator makes propogating errors painless if that is what you want, but at least they're all documented so you have to make a concious chocie to pass the buck on error handling.
Re:The general value of typed functional programming lies in... by renox on Monday February 24, 2020 @05:58PM (#22409347)
I don't know: if we really wanted to be 'strict' every integer operation should return a Maybe due to possible overflow, every IO operation also.

That's a lot of possible error to handle! I don't like exception's invisible flow but I think that they are good for 'should never happen' errors.