effekt
effekt copied to clipboard
Implement first draft of or-patterns
This is a first attempt to implement or patterns (such as requested by #805).
It also supports nested or patterns, but exhaustivity is not yet implemented.
Please note that this generates code (after inlining) such as
if (infixEq_85("c", "a")) {
let tmp_1303570 = println_1("hello")
l_1303481(tmp_1303570)
} else {
if (infixEq_85("c", "b")) {
let tmp_1303572 = println_1("hello")
l_1303481(tmp_1303572)
} else {
let tmp_1303573 = println_1("world")
l_1303481(tmp_1303573)
}
}
while the following would be better (for sharing code)
if (infixEq_85("c", "a") || infixEq_85("c", "b")) {
let tmp_1303570 = println_1("hello")
l_1303481(tmp_1303570)
} else {
let tmp_1303573 = println_1("world")
l_1303481(tmp_1303573)
}