News for hackers. Stuff that matters.
Re:Error Handling Patterns by zactato on Thursday May 04, 2023 @05:51PM (#35822583)
I agree, Monads don't solve everything, but if we're being pedantic then I would argue that in a functional context you would almost never write

fn doTheThing() -> void, raises Error SomeVal x = try doSomethingFallibly()

Functions don't do things, they process and return things. Side effects are handled higher up at the root of a program. Generally any time you'd be "doing a thing" you'd also be in a position to handle the error.

source: I don't do any functional programming but have seen some videos on youtube

There are no comments on this comment yet.