Stream: compiler development

Topic: removal of binop `?`


view this post on Zulip Anton (Jun 24 2026 at 15:05):

I just noticed that the binary operator version of ? got removed in PR#9618. Can you explain the reasoning behind that change @Richard Feldman?

I quite liked that syntax, it's a very compact way to add descriptive errors:

-   first_str = strings.first() ? NoFirstError
+   first_str = match strings.first() {
+       Ok(s) => s
+       Err(e) => { return Err(NoFirstError(e)) }
+   }

I used that syntax a lot in our build_website.roc script (old Roc).

view this post on Zulip Richard Feldman (Jun 24 2026 at 15:11):

I wanted to revisit the syntax

view this post on Zulip Richard Feldman (Jun 24 2026 at 15:12):

but I admittedly have not thought of any better ideas since :laughing:

view this post on Zulip Richard Feldman (Jun 24 2026 at 15:12):

maybe it's actually best to put it back then

view this post on Zulip Richard Feldman (Jun 24 2026 at 15:20):

want to open a pr for that?

view this post on Zulip Anton (Jun 24 2026 at 15:29):

Yes. right away

view this post on Zulip Anton (Jun 24 2026 at 16:56):

PR#9791


Last updated: Jul 23 2026 at 13:15 UTC