Stream: beginners

Topic: where a implements Eq


view this post on Zulip Eelco Hoekema (Dec 05 2024 at 12:15):

I am porting the gatherWith and gatherEquals functions from elm-community/list-extra, copying these functions over almost literally.

I ran into an interesting error:

This gatherWith call produces:

    List (
        a,
        List a,
    )a where a implements Eq, a implements Eq

But the type annotation on gatherEquals says it should be:

    List (
        a,
        List a,
    )a

I don't see any "where a implements ..." in the tutorial. Where can i find docs to read up on these specific type annotations?

view this post on Zulip Tanner Nielsen (Dec 05 2024 at 16:03):

I believe you're looking for "abilities": https://www.roc-lang.org/abilities

view this post on Zulip Eelco Hoekema (Dec 05 2024 at 20:48):

Oh wow, did not realise this existed in Roc.


Last updated: Jul 06 2025 at 12:14 UTC