My current understanding is that the need for expect-fx isn't / won't be needed anymore after the introduction purity inference / !. Are we at a point now where that can be removed from the language?
We'd probably want to be solid on the replacement's design within expect
The last thing I saw from Richard was something like
expect \get!, set! ->
import Foo { get! } as F
set! 123
stored = get! 123
F.stuff! {} == 456
So if an effectful function is passed to expect, we provide it get! and set! to emulate effectfulness with
It may be fine to remove expect-fx before this is ironed out, though, as it's never been used/working
I'm asking because it's causing some (minor) problems with parsing & formatting invariants that I'm now running into with fuzzing
I don't expect much of the plumbing for it would be useful with whatever new design we go with, so I'd agree with just removing it
In particular, the parser currently has to disallow keywords followed by a dash, and ends up treating them as identifiers instead. I have yet to find any useful code that this affects, but the simplest code that parses and runs into problems is: try-1. That parses as the identifier try, - 1, and then formats to try - 1 which the parser recognizes as being the keyword try.
Formatting isn't supposed to affect the syntax tree (modulo normalizations), and this violates that invariant
No bueno
yeah I think we don't need expect-fx anymore!
because of purity inference
https://github.com/roc-lang/roc/pull/7227
Last updated: Jun 16 2026 at 16:19 UTC