It seems in one of the recent nightlies, has Eq
has become a way to describe that something is comparable. I haven't found any documentation on this so far. Is there a place I can read up on what features this entails, or should i be patient for a more formal release here? (I'm interested in whether I can implement Eq
for a type, for example)
I think this is the WIP Abilities feature
thanks ^_^
some of that document may be out of date with the current design of abilities. But yes you can implement Eq for a custom type, see this test for an example! https://github.com/roc-lang/roc/blob/d6885bde232f85708d6accd39488ddb455288e44/crates/compiler/test_gen/src/gen_abilities.rs#L1622
That's a pretty elegant way of doing that :)
Gabriel Pickl has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC