Skip to content

v0.6.6

Latest

Choose a tag to compare

@robertvansteen robertvansteen released this 30 Jul 12:30
a09f205

Operators lift over absence (#79)

Optional operands no longer refuse to compile. Resolution is two-staged: rules see the operand types as given first (a rule that reads optional operands deliberately — equality's x == null probe — always wins untouched); only when every rule refuses are the rules consulted with the operands' present types, and a match there returns lifted — the return type becomes optional and an absent operand answers absence without the rule running.

  • Option<Number> > Number compiles to Boolean?; a missing operand answers None.
  • Option<Never> (a bare null literal) never lifts: null + 1 stays a compile error.
  • &&/|| read optional booleans with Kleene's three-valued semantics (new Connective rule): true decides a disjunction, false decides a conjunction, and only a result no present operand can decide is absent. !, not, xor stay ordinary rows — strictness and Kleene agree for them.
  • PresentType::of() joins core Types; UnaryExpressionCompiler's private lift is retired in favour of the resolver-owned law (behaviour unchanged).

No operator rule definitions change; extensions get absence-tolerance for free. Full details in #79.