A CLI converter
Read a positional argument with a default, parse it with the error addressed on the same line, print the answer. hale build turns it into one static executable, with no interpreter and no packaging step. The break shows the fallback being typed: a default that could not stand in for the parse result is refused.
fn main() {
let raw = std::env::arg_or(1, "100");
let celsius = std::str::parse_int(raw) or 0;
let fahrenheit = celsius * 9 / 5 + 32;
println(raw, "°C = ", fahrenheit, "°F");
}$ hale run convert.hl
100°C = 212°FDefault with the wrong type. std::str::parse_int(raw) or 0 std::str::parse_int(raw) or "0"
$ hale check convert.hl
convert.hl:3:19: type error: `or <substitute>`: fallback type `String` does not match success type `Int`
let celsius = std::str::parse_int(raw) or "0";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^