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

As a recent convert to functional programming, I'd like to point out that more functional styles of error handling helps one address them more properly and not sweep them under the rug.

This ties into the article's first point about how poor error handling is a common source of bugs.



How exactly does functional programming help here?


Sum types allow a function to return either a result or an error. Not accounting for both possibilities is a compile time type error.

Go mimics this behavior, so it's not only a functional thing: http://blog.golang.org/error-handling-and-go


I guess he's referring to things like the maybe monad.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: