News for hackers. Stuff that matters.
Re:State Monad for the Rest of Us by itishappy on Friday August 09, 2024 @12:05PM (#41203120)
Now you have 3 different states that all represent an error:

    (null, new DivideByZeroException())
    (null, null)
    (result, new DivideByZeroException())
One of which does not actually use our custom error type, and one of which contains a value for some reason. Our function is simple division! Are there really 3 different ways division can fail?

This isn't a showstopper, it's just more stuff you have to keep in your head.

There are no comments on this comment yet.