erlang sets -----去重
来源:互联网 发布:优化发展环境表态发言 编辑:程序博客网 时间:2024/05/01 09:19
sets
MODULE
MODULE SUMMARY
DESCRIPTION
Sets are collections of elements with no duplicate elements. The representation of a set is not defined.
This module provides exactly the same interface as the module ordsets but with a defined representation. One difference is that while this module considers two elements as different if they do not match (=:=), ordsets considers two elements as different if and only if they do not compare equal (==).
DATA TYPES
set(Element)
As returned by new/0.
set()
set() is equivalent to set(term()).
EXPORTS
new() -> set()
Returns a new empty set.
is_set(Set) -> boolean()
Types:
Returns true if Set is a set of elements, otherwise false.
size(Set) -> integer() >= 0
Types:
Returns the number of elements in Set.
to_list(Set) -> List
Types:
Returns the elements of Set as a list.
from_list(List) -> Set
Types:
Returns an set of the elements in List.
is_element(Element, Set) -> boolean()
Types:
Returns true if Element is an element of Set, otherwise false.
add_element(Element, Set1) -> Set2
Types:
Returns a new set formed from Set1 with Element inserted.
del_element(Element, Set1) -> Set2
Types:
Returns Set1, but with Element removed.
union(Set1, Set2) -> Set3
Types:
Returns the merged (union) set of Set1 and Set2.
union(SetList) -> Set
Types:
Returns the merged (union) set of the list of sets.
intersection(Set1, Set2) -> Set3
Types:
Returns the intersection of Set1 and Set2.
intersection(SetList) -> Set
Types:
Returns the intersection of the non-empty list of sets.
is_disjoint(Set1, Set2) -> boolean()
Types:
Returns true if Set1 and Set2 are disjoint (have no elements in common), and false otherwise.
subtract(Set1, Set2) -> Set3
Types:
Returns only the elements of Set1 which are not also elements of Set2.
is_subset(Set1, Set2) -> boolean()
Types:
Returns true when every element of Set11 is also a member of Set2, otherwise false.
fold(Function, Acc0, Set) -> Acc1
Types:
Fold Function over every element in Set returning the final value of the accumulator.
filter(Pred, Set1) -> Set2
Types:
Filter elements in Set1 with boolean function Pred.
See Also
ordsets(3), gb_sets(3)
- erlang sets -----去重
- erlang sets
- erlang数据结构-- sets
- Erlang生成式实现的列表去重、求交集及并集
- 去重
- 去重
- 去重
- 去重
- 去重
- erlang代码重构
- Erlang supervisor重启策略
- 数组去重,json数组去重
- 数组去重,list去重
- Sets
- sql去重
- 词典去重数据
- SQL去重
- sql去重3
- Android性能调优
- 关于Wireshark 分析出现的各种颜色意义
- HDU - 1542 (扫描线+线段树优化)
- Guava学习笔记:Guava新增集合类型-Multiset
- android MediaPlayer 播放各种来源的音频
- erlang sets -----去重
- 使用ajax 传值 必须用alert
- hibernate_Restrictions用法
- 怎样用ASP代码获取网页源代码
- android 马赛克 mosaic
- Guava学习笔记:Guava新增集合类型-Multimap
- test
- 装修公司管理软件系统迎来云计算新时代
- android代码运行cmd命令截屏