Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immutable set type / frozenset #1

Open
vdemario opened this issue Jul 24, 2018 · 0 comments
Open

Immutable set type / frozenset #1

vdemario opened this issue Jul 24, 2018 · 0 comments

Comments

@vdemario
Copy link

The advice to delete updaters.go probably wouldn't work well in practice. Removing a file is not a common practice and has no support in tooling such as dep and similars.

How about creating a new type exposed through the API? It might be named ImmutableSet, FrozenSet, or something like that, with these methods:

func MakeImmutable(elems ...string) ImmutableSet
func MakeImmutableFromText(text string) ImmutableSet
func (s ImmutableSet) Channel() <-chan string
func (s ImmutableSet) Contains(elem string) bool
func (s ImmutableSet) ContainsAll(elems ...string) bool
func (s ImmutableSet) Copy() ImmutableSet
func (s ImmutableSet) Difference(other ImmutableSet) ImmutableSet
func (s ImmutableSet) Equal(other ImmutableSet) bool
func (s ImmutableSet) Intersection(other ImmutableSet) ImmutableSet
func (s ImmutableSet) Len() int
func (s ImmutableSet) String() string
func (s ImmutableSet) SubImmutableSetOf(other ImmutableSet) bool
func (s ImmutableSet) SuperImmutableSetOf(other ImmutableSet) bool
func (s ImmutableSet) SymmetricDifference(other ImmutableSet) ImmutableSet
func (s ImmutableSet) ToSlice() []string
func (s ImmutableSet) Union(other ImmutableSet) ImmutableSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant