> > No more explanations needed I guess. > As an end-user, no. But there's a rational explanation for the behavior you're seeing.
Dicts (and sets) are implemented as red-black trees (like binary trees but self-balancing). This is why keys must be comparable. Equality is Elm checks reference equality first, and then (for union types such as dicts) the recursive structural equality. This is why you were able to get equality to "work" when inserting. But when you removed an element, it just so happened that the tree got balanced differently. Equality told you that there were two different representations, which for your purposes, is completely irrelevant. There's a long-standing proposal to special case dict equality so that it "just works". The primary objection seems to be that this treatment wouldn't be available to package authors, perhaps even those who made a slightly modified version of Dict (which is written in Elm and open source). -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.