当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


erlang partition(SetFun, Set)用法及代码示例


partition(SetFun, Set) -> Partition
类型:
SetFun = set_fun()
Partition = Set = a_set()

返回分割Set这样,如果应用的结果是两个元素被认为是相等的SetFun是平等的。

1> Ss = sofs:from_term([[a],[b],[c,d],[e,f]]),
SetFun = fun(S) -> sofs:from_term(sofs:no_elements(S)) end,
P = sofs:partition(SetFun, Ss),
sofs:to_external(P).
[[[a],[b]],[[c,d],[e,f]]]

相关用法


注:本文由纯净天空筛选整理自erlang.org大神的英文原创作品 partition(SetFun, Set) -> Partition。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。