Error Dejection Operator

Ah, now I know your inspiration, and why you chose this particular syntax.

I don't see any reason why an operator couldn't catch an exception. The operator decides how to operate on its operands, and if it chooses to catch any errors generated while an operand executes, so be it. This kind of control is similar to how the "||" operator can choose to not even evaluate its RHS operand if the LHS is falsy.

But, potatoes-potatoes. There's no solid definition of what an operator really is, and what technically counts as an operator and what doesn't.

I am somewhat familiar with haskell, and I can see better where your inspiration came from. If you're wanting something similar to haskell's try function, you may like this thread, which I would argue gets us even closer to what haskell's "try" does. Here's the proposal repo from that thread. And here's an example:

const { value, error } = try evaluate(5, 'div', 0)
if (error) {
  console.log('Caught exception: ' + String(error))
} else {
  console.log('The answer was: ' + String(value))
}

In that proposal, try becomes an operator, and it returns an either-like object. If it was successful, "value" will be set to the final value. Otherwise, "error" will be set to the error that was thrown.

Combine that with the proposed pattern-matching syntax, and we've got something that looks very similar to the haskell example you gave:

const result = try evaluate(5, 'div', 0)
match (result) {
  when ({ error }) { console.log('Caught exception: ' + String(error)) }
  when ({ value }) { console.log('The answer was: ' + String(value)) }
}