Draft: Add a Foldable UniqDSet instance
I needed this instance in another patch, but I wanted to make sure this got the scrutiny it deserves.
Three questions we need answered before this can be merged:
- Is this instance sound? That is, are all invariants respected?
- Is this instance performant? Is implementing just
foldr
enough to get good behavior? - Is this instance a good idea, style-wise?
My answers:
- It seems so, because
Foldable
consumes only. But I somehow want a double-check. - I have no idea.
- I think so.
Foldable
unlocks a number of useful coding patterns, and I'd like to use them.