Module mapsets

set implementation using maps.

Copyright © X4lldux <x4lldux@vectron.io>

Description

set implementation using maps.

Copyright X4lldux 2017 <x4lldux@vectron.io>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Data Types

set()

abstract datatype: set(Element)

set()

set() = set(term())

Function Index

add_element/2adds an element to a set.
from_list/1given a list, returns a set.
intersection/2given two sets, returns their intersection.
new/0returns new set.
size/1given set, returns it's size.
to_list/1given a set, returns a list of elements.

Function Details

add_element/2

add_element(E, Mapset::set(E)) -> set(E)

adds an element to a set

from_list/1

from_list(L::[E]) -> set(E)

given a list, returns a set

intersection/2

intersection(Mapset::set(E), X2::set(E)) -> set(E)

given two sets, returns their intersection

new/0

new() -> set()

returns new set

size/1

size(Mapset::set()) -> integer()

given set, returns it's size

to_list/1

to_list(Mapset::set(E)) -> [E]

given a set, returns a list of elements


Generated by EDoc