You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to be able to overload and and or for Maybe, Either, and other monadic types:
var x = maybeA() and maybeB() and maybeC(); // short-circuit maybe chaining (aka ">>=")
var y = maybeA() or maybeB(); // maybe alternation (aka "mplus")
var z = maybeA() or 0; // maybe unpack with default
The text was updated successfully, but these errors were encountered:
What's your stance on using 'and', 'or', 'not' keywords instead of the C-like operators (&&,||,!) ? Is this a preference or just a carry over from the Pascal syntax?
I'm not sure. I'd like the short-circuit behavior to be inherent in the way and and or desugar, perhaps by having the right-hand side desugar as a lambda.
It would be useful to be able to overload
and
andor
forMaybe
,Either
, and other monadic types:The text was updated successfully, but these errors were encountered: