Does it make sense to allow if, when, match expressions to be treated as statements if there's trailing top-level bang in each branch? For example:
Allow (should it be allowed that a and b can return different Task<a> and Task<b>?)
f = \x, a, b ->
if x then
a!
else
b! x
Task.ok x
Error: the return value is not used
f = \x, a, b ->
if x then
a
else
b x
Task.ok x
Currently, it can be done with parentheses:
f = \x, a, b ->
(
if x then
a
else
b x
)!
Task.ok x
The same for pizza operator:
Allow
f = \x, g, h ->
x |> g |> h!
Task.ok x
Error: the return value is not used
f = \x, g, h ->
x |> g |> h
Task.ok x
Currently, it can be done with parentheses:
f = \x, g, h ->
(
x |> g |> h
)!
Task.ok x
Allow (should it be allowed that
aandbcan return differentTask<a>andTask<b>?)
The Chaining Syntax Design Proposal talks about this. In summary I don't this this should be allowed.
This proposal would let you write if statements which are an extension of the task statements above: when you would write {} = if … you can instead just write the if as a statement. (You'll get a type mismatch if any branches don't evaluate to a task whose output is {} though!) Same with when statements.
Last updated: Jun 16 2026 at 16:19 UTC