When working on roc-ray examples, I ran into what looks like a couple of bugs with try
and ?
early returns with effectful functions. It seems like the backpassing-style continuation that gets generated is required to be pure. When using ?
this makes multiple early returns from fallible effectful functions into a compile error. When using try
, roc check
passes but roc build
crashes.
These are two minimal-ish repros in roc-ray examples. They can be run with:
just dev examples/early-return-question-mark.roc
just dev examples/early-return-try.roc
Edit: I made a github issue
Known issue, I'll try to crack out a fix this weekend. Thanks for reporting, I kept saying I'd do it but didn't get around to it
Last updated: Jul 06 2025 at 12:14 UTC