navid/haze / 13ba2f33894c67a16c9bf8afb859ffc1b9f11d054fe58f1e57ae1d2d57994a9b / samples/baseline_2.4/generic_multi_instantiation.hz
generic_multi_instantiation.hz
← samples/baseline_2.4 · 257 bytes · raw · download
pure fn choose[T](a T, b T, first bool) T
: post r => r == a || r == b
=> if first {
a
} else {
b
}
fn main() {
print(choose(1, 2, false))
print(choose(true, false, true))
print(choose("left", "right", false))
}