Stream: beginners

Topic: Comparing sets


view this post on Zulip Sebastian Porto (Dec 05 2022 at 08:38):

How do I compare two sets?
I tried comparing sets using https://www.roc-lang.org/builtins/Set#isEq
Getting The Set module does not expose isEq:

Then tried set1 == set2
Getting a panic

An internal compiler expectation was broken.
This is definitely a compiler bug.

Is == meant to be the way to do it, should I open an issue then?

view this post on Zulip Anton (Dec 05 2022 at 08:45):

I'm not sure how two sets should be compared for equality, but set1 == set2 should give a nice error instead of the An internal compiler expectation was broken. So yes, please make an issue for that :)

view this post on Zulip Brendan Hansknecht (Dec 05 2022 at 15:55):

This is definitely supposed to just work with set1 == set2. If you download the latest nightly, there is a chance it is fixed now (there was just a large update to all of this). Otherwise, please file a bug with the full error message. We can take a look.

view this post on Zulip Ayaz Hafiz (Dec 05 2022 at 15:57):

it's a known bug: https://github.com/roc-lang/roc/issues/4671. I'm working on fixing it now

view this post on Zulip Brendan Hansknecht (Dec 05 2022 at 16:00):

Ah, ok

view this post on Zulip Ayaz Hafiz (Dec 05 2022 at 22:46):

This is now fixed - it shouldn't be a problem in the next nightly!


Last updated: Jul 05 2025 at 12:14 UTC