You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compare between two sequences seems to have a limited use. Because defining an order on a sequence can't be defined as a single implementation and thus is ambigue.
Here are a few options on how to implement the comparison:
What would you do if the sequences have different sizes?
Would the order of a sequence compared to another sequence be its compare of each element? Then parts of it is ordered before and others after.
Another option is to sum the elements of the sequence and then compare the value. Or maybe it would first average the sequence and compare them on that.
But in that case you would see the sequence as a set and ignore its order.
So having a generic compare function between sequences is very application and type specific.
So the best way to solve this problem is to let the user use map to do the element wise comparison.
The other comparisons can be created by using reduce and then compare the result.
Otherwise I agree that sequences, while sometimes as reliable as slices, are more general and there are a lot of new ways for the input to be unkind. To safely use these you'd need to know that both inputs were "nice".
I'm not really for or against these but it makes me uneasy, like the xiter.Equals* from the original proposal. I'm all for these going somewhere but maybe somewhere third party until they've proven to be generally useful without causing problems or confusion.
Proposal Details
Proposed to add below functions:
Same as seq2
The text was updated successfully, but these errors were encountered: