One pattern that comes up is using a Set (or map) to de-duplicate a slice of (e.g.) strings, and then use those strings to create a slice of some other object. We could make this another one-liner with something like Set[A].ToList[B](f func(a A) B) []B helper method.
One pattern that comes up is using a
Set
(ormap
) to de-duplicate a slice of (e.g.) strings, and then use those strings to create a slice of some other object. We could make this another one-liner with something likeSet[A].ToList[B](f func(a A) B) []B
helper method.