Stream: beginners

Topic: ✔ Is there short-circuiting in Roc?


view this post on Zulip Karakatiza (Jan 07 2024 at 23:23):

I know Roc is strict and the compiler does loop fusion, but is there short circuiting in cases like list map a |> filter b |> find c?

view this post on Zulip Karakatiza (Jan 07 2024 at 23:25):

As in, do functions a and b execute only until 'find' returns?

view this post on Zulip Richard Feldman (Jan 07 2024 at 23:32):

the compiler doesn't do fusion at all yet, although I definitely would like it to in the future! :big_smile:

view this post on Zulip Karakatiza (Jan 07 2024 at 23:36):

Oh! And is there a vision for short-circuiting, or it would require some special user-space types and functions?

view this post on Zulip Richard Feldman (Jan 07 2024 at 23:40):

I'm not familiar with the implementation details of fusion, but I'd hope that could Just Work as long as there were no dbg or expects in a or b - being able to safely do optimizations out that is one of the advantages of having a pure language!

view this post on Zulip Notification Bot (Jan 07 2024 at 23:44):

Karakatiza has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC