2 ms·
Original code: if some_error_condition then None else ( // everything else in the function is nested ) Why not use a Maybe/Eithe
by Peaker 12y ago
Original code:
if some_error_condition then
None
else (
// everything else in the function is nested
)
Why not use a Maybe/Either monad like:
x <- some_maybe_value
// everything else in the function isn't nested, and "x" is available (if some_maybe_value was Just)
Kind of like exceptions, but a bit more explicit.