I think that the Eq instance should be just derived and current implementation should be exported as separate function. Besides, using allRotations is surely not the most optimal way of implementing the desired behavior. What if two CLists contain different sets of elements? Current implementation will check all the rotations, while it is possible to return False after finding the first element which is present in one of the given CLists but not in the other.
As stated here,
Currently we have, e.g.
I think that the
Eq
instance should be just derived and current implementation should be exported as separate function. Besides, usingallRotations
is surely not the most optimal way of implementing the desired behavior. What if two CLists contain different sets of elements? Current implementation will check all the rotations, while it is possible to returnFalse
after finding the first element which is present in one of the givenCList
s but not in the other.