-
Notifications
You must be signed in to change notification settings - Fork 17
/
doc.go
30 lines (28 loc) · 1.15 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package set implements utility functions for manipulating sets of
// primitive type elements represented as maps.
//
// For each primitive type "foo", the package provides global
// variables Foo and FooBool that implement utility functions for
// map[foo]struct{} and map[foo]bool respectively. For each such
// variable, the package provides:
//
// 1. methods for conversion between sets represented as maps and
// slices: FromSlice(slice) and ToSlice(set)
//
// 2. methods for common set operations: Difference(s1, s2),
// Intersection(s1, s2), and Union(s1, s2); note that these
// functions store their result in the first argument
//
// For instance, one can use these functions as follows:
//
// s1 := set.String.FromSlice([]string{"a", "b"})
// s2 := set.String.FromSlice([]string{"b", "c"})
//
// set.String.Difference(s1, s2) // s1 == {"a"}
// set.String.Intersection(s1, s2) // s1 == {}
// set.String.Union(s1, s2) // s1 == {"b", "c"}
package set
//go:generate go run ./gen.go