Stream: ideas

Topic: `pass_to`-like `dbg`


view this post on Zulip Agus Zubiaga (Jan 02 2025 at 18:13):

Sorry if this has been suggested already, but in the static dispatch world, I'd love for dbg to support a syntax similar to pass_to:

artists
    .dbg()
    .filter(.is_starred.dbg())
    .dbg()

It'd be so easy to drop that anywhere, no need to fiddle with parens or rearrange things like you might have to do in Rust.

view this post on Zulip Sam Mohr (Jan 02 2025 at 18:15):

This definitely makes sense if we have .pass_to, otherwise this is the only place in Roc where we have a reserved method. I'm here for it though, it's extremely natural

view this post on Zulip Richard Feldman (Jan 02 2025 at 18:16):

this makes sense to me!

view this post on Zulip Richard Feldman (Jan 02 2025 at 18:17):

you already can't name a field dbg anyway because it's a reserved keyword


Last updated: Jun 16 2026 at 16:19 UTC