runeset

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RuneSet

type RuneSet map[rune]Signal

func FromRunes

func FromRunes(runes ...rune) RuneSet

FromRunes creates a set from runes

func FromString

func FromString(s string) (set RuneSet)

FromString converts a string to a RuneSet of the runes inside.

func Intersection

func Intersection(set RuneSet, sets ...RuneSet) RuneSet

func Union

func Union(sets ...RuneSet) RuneSet

func (RuneSet) Contains

func (rs RuneSet) Contains(r rune) bool

Contains shows whether r is in the RuneSet.

func (RuneSet) Copy

func (rs RuneSet) Copy() RuneSet

Copy returns a copy of the RuneSet.

func (RuneSet) Difference

func (rs RuneSet) Difference(sets ...RuneSet) (difference RuneSet)

Difference returns the items in the reciever but not any other arguments i.e, if set = {'a', b' 'c'}; set.Difference({'b', 'c'}) = {'a'}

func (RuneSet) Equal

func (rs RuneSet) Equal(other RuneSet) bool

Equal shows whether two RuneSets are equal; i.e, they contain the same items.

func (RuneSet) Intersection

func (rs RuneSet) Intersection(sets ...RuneSet) (intersection RuneSet)

Intersection returns the intersection of the sets;

func (RuneSet) Union

func (rs RuneSet) Union(sets ...RuneSet) (union RuneSet)

Union returns the union of the sets.

type Signal

type Signal struct{}

RuneSet is a map[rune]bool with the methods you would expect from a set type. Eg, Contains, Union, Intersection, and Difference. I will make code generation for further set types in the future.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL