This PR ensures that conditional expressions and boolean operators adhere to the "lazy evaluation" behaviour expected of these constructs. To achieve these, both of these directly desugar to match expressions rather than function applications.
Conditional expressions:
if c then x else y
…desugar to:
c match {
case True(_) => x
case False(_) => y
}
Logical conjunction:
a && b
…desugars to:
a match {
case True(_) => b
case False(_) => << False = { } >>
}
Logical disjunction:
a || b
…desugars to:
a match {
case True(_) => << True = { } >>
case False(_) => b
}
This PR ensures that conditional expressions and boolean operators adhere to the "lazy evaluation" behaviour expected of these constructs. To achieve these, both of these directly desugar to match expressions rather than function applications.
Conditional expressions:
…desugar to:
Logical conjunction:
…desugars to:
Logical disjunction:
…desugars to: