Data.TaggedError was introduced in Distinct failures with Data.TaggedError ↗In JavaScript, two objects with the exact same fields are still not equal, because the triple-equals compares references, not contents. So the moment you put them in a Set to dedupe, nothing dedupes: same data, two entries. Your only fix in plain JavaScript is a compare function written by hand and kept in sync with every field.
Data closes that gap. Data.struct builds an ordinary value that carries structural equality with it. Same fields now means equal, and Equal.equals returns true with no compare function to maintain. The references still differ, but the values match, which is the question you actually meant to ask.
And the Data.TaggedError you wrote back in chapter two is this same machinery. Data.taggedEnum builds a tagged union whose variants each carry that value equality. Every constructor stamps an _tag onto the value, the field that tells Loading from Success from Failure. Hold onto that tag, because the next lesson matches on it.