Stream: compiler development

Topic: parse error with -> and lambda


view this post on Zulip Anton (Feb 23 2026 at 14:28):

Piping into a lambda with -> should work right?

» lst.map(|_| "zzz ").join_with(" ").trim()->(|trimmed_str| {if trimmed_str.is_empty() "" else "bla"})
**PARSE ERROR**
A parsing error occurred: `expr_arrow_expects_ident`
This is an unexpected parsing error. Please check your syntax.

view this post on Zulip Richard Feldman (Feb 23 2026 at 14:50):

it should!

view this post on Zulip Richard Feldman (Feb 23 2026 at 14:51):

but we probably never supported it

view this post on Zulip Anton (Feb 23 2026 at 15:06):

#9195

view this post on Zulip Luke Boswell (Feb 23 2026 at 20:15):

I can implement this later today.

view this post on Zulip Luke Boswell (Feb 24 2026 at 02:23):

fixed in https://github.com/roc-lang/roc/pull/9197

view this post on Zulip Anton (Feb 24 2026 at 11:10):

Thanks Luke :)

view this post on Zulip Anton (Feb 24 2026 at 11:10):

I added a complex pipeline demo to the all syntax example: #9199

view this post on Zulip ugi (Apr 28 2026 at 10:11):

Do we also want to support calling the lambda in the arrow dispatch? Like:

» lst.map(|_| "zzz ").join_with(" ").trim()->(|trimmed_str| {if trimmed_str.is_empty() "" else "bla"})()

(Notice the () in the end)

Related: #9372

view this post on Zulip Anton (Apr 28 2026 at 11:13):

Hi @ugi,
I just tried your example in the repl and that already works. Did I misunderstand your question?

view this post on Zulip ugi (Apr 28 2026 at 11:50):

Just wanted to make sure if this style should be supported.
I guess since it works in the repl, then that implies that it should also be supported.
Though the formatting for such styles does not work, therefore the related issue.

view this post on Zulip Anton (Apr 28 2026 at 12:11):

Yeah, I think disallowing it seems overly strict, so we should make the formatter support it.


Last updated: May 01 2026 at 12:45 UTC