navid/haze / 8ad27175ea7468984a380df035464efe6200afefbd75a9fe1bfd354d46029e85 / 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))
}