3 ms·
That's why in Haskell after the Either monad becomes popular, people simply made a library that flips the arguments to become the Success monad. The problem wi
by kccqzy 2y ago
That's why in Haskell after the Either monad becomes popular, people simply made a library that flips the arguments to become the Success monad.
The problem with most languages here is the name "exceptions" implying it's for exceptional scenarios, but without any substitute for good non-local control flow.
- layer8 2y agoIt’s not necessarily only for exceptional scenarios, but instead it is an exception to the normal return of a value. The usage where the return is always by exception (as in the n-queens example) is itself an exception ;). I do think it’s useful to mark one (return) type as the primary/normal/good case and other types as secondary/auxiliary/error cases, and have the latter auto-escalate independently.