aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/ordsets.erl
diff options
context:
space:
mode:
authorj.uhlig <[email protected]>2018-03-19 16:32:21 +0100
committerj.uhlig <[email protected]>2018-03-19 16:32:21 +0100
commitdf7d961bfd648e88b50eb3762af39a3cd985bc11 (patch)
tree79d2cb5f3e99fb8e0ba302ed474042d7a497905d /lib/stdlib/src/ordsets.erl
parentf05074ac001a5f81f98c08d8812850a7d0b9ab18 (diff)
downloadotp-df7d961bfd648e88b50eb3762af39a3cd985bc11.tar.gz
otp-df7d961bfd648e88b50eb3762af39a3cd985bc11.tar.bz2
otp-df7d961bfd648e88b50eb3762af39a3cd985bc11.zip
is_empty/1 for ordsets
Diffstat (limited to 'lib/stdlib/src/ordsets.erl')
-rw-r--r--lib/stdlib/src/ordsets.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/stdlib/src/ordsets.erl b/lib/stdlib/src/ordsets.erl
index 569407f5ef..939e147ad8 100644
--- a/lib/stdlib/src/ordsets.erl
+++ b/lib/stdlib/src/ordsets.erl
@@ -19,7 +19,7 @@
-module(ordsets).
--export([new/0,is_set/1,size/1,to_list/1,from_list/1]).
+-export([new/0,is_set/1,size/1,is_empty/1,to_list/1,from_list/1]).
-export([is_element/2,add_element/2,del_element/2]).
-export([union/2,union/1,intersection/2,intersection/1]).
-export([is_disjoint/2]).
@@ -60,6 +60,13 @@ is_set([], _) -> true.
size(S) -> length(S).
+%% is_empty(OrdSet) -> boolean().
+%% Return 'true' if OrdSet is an empty set, otherwise 'false'.
+-spec is_empty(Ordset) -> boolean() when
+ Ordset :: ordset(_).
+
+is_empty(S) -> S=:=[].
+
%% to_list(OrdSet) -> [Elem].
%% Return the elements in OrdSet as a list.