IterTools.distinct
— Methoddistinct(xs)
Iterate through values skipping over those already encountered.
julia> for i in distinct([1,1,2,1,2,4,1,2,3,4])
+
Be aware that if iterating the original has a side-effect it will not be repeated when iterating again, – indeed that is a key feature of the CachedIterator
. Be aware also that if the original iterator is nondeterminatistic in its order, when iterating again from the cache it will infact be determinatistic and will be the same order as before – this also is a feature.