Stream: ideas

Topic: Time to sunset expect-fx?


view this post on Zulip Joshua Warner (Nov 17 2024 at 19:01):

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?

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:08):

We'd probably want to be solid on the replacement's design within expect

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:11):

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

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:13):

So if an effectful function is passed to expect, we provide it get! and set! to emulate effectfulness with

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:14):

It may be fine to remove expect-fx before this is ironed out, though, as it's never been used/working

view this post on Zulip Joshua Warner (Nov 17 2024 at 19:21):

I'm asking because it's causing some (minor) problems with parsing & formatting invariants that I'm now running into with fuzzing

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:23):

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

view this post on Zulip Joshua Warner (Nov 17 2024 at 19:23):

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.

view this post on Zulip Joshua Warner (Nov 17 2024 at 19:25):

Formatting isn't supposed to affect the syntax tree (modulo normalizations), and this violates that invariant

view this post on Zulip Sam Mohr (Nov 17 2024 at 19:31):

No bueno

view this post on Zulip Richard Feldman (Nov 17 2024 at 19:46):

yeah I think we don't need expect-fx anymore!

view this post on Zulip Richard Feldman (Nov 17 2024 at 19:46):

because of purity inference

view this post on Zulip Joshua Warner (Nov 18 2024 at 04:26):

https://github.com/roc-lang/roc/pull/7227


Last updated: Jun 16 2026 at 16:19 UTC