hashicorp / go-set

The go-set package provides generic Set implementations for Go, including HashSet for types with a Hash() function and TreeSet for orderable data
Mozilla Public License 2.0
118 stars 8 forks source link

add ability to create slice of another type #4

Closed shoenig closed 1 year ago

shoenig commented 2 years ago

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.

shoenig commented 1 year ago

Closed by #56