heckj / CRDT

Conflict-free Replicated Data Types in Swift
https://swiftpackageindex.com/heckj/CRDT/main/documentation/crdt
MIT License
145 stars 3 forks source link

Is the constraint on List.T conforming to Comparable necessary? #30

Closed jefflovejapan closed 1 year ago

jefflovejapan commented 1 year ago

Apologies if this isn't the right venue to ask the question, but is it really necessary for the elements of List to be comparable? I don't see anywhere that the elements are being compared against one another, and commenting out the constraint doesn't prevent compilation or cause tests to fail.

heckj commented 1 year ago

hi @jefflovejapan - perfectly fine venue for the question. Nope, not required at all. Leftover, I suspect, from my own explorations. The value does need to be hashable and equatable because the underlying storage is within a set, but that doesn't require comparable at all.

heckj commented 1 year ago

I just dropped it from the code, since it wasn't needed - reflected on the main branch.

jefflovejapan commented 1 year ago

Awesome, thanks @heckj !