Yeah, I agree. The objection that some SetAlgebra
APIs don't make a ton of sense for BitSet
reminds me of the discussion (starting here) about whether clamped(to:)
made sense as a method on Comparable
, even though it resulted in API of questionable use on String
. IMO, the value provided by being able to use BitSet
in generic contexts expecting a set-like thing outweighs the somewhat confusing APIs.
The objection that the APIs for SetAlgebra
result in BitSet
doing more work than necessary are perhaps more compelling, but I'd be curious to know what the practical impact of this is. @MahanazAtiqullah, do you happen to have any benchmarks that compare the performance of the non-SetAlgebra
-conforming BitSet
to an implementation which does support the conformance?