diff options
author | Hans Bolinder <[email protected]> | 2018-02-27 15:42:52 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-03-09 14:45:42 +0100 |
commit | 5c7209c2874849a5a7339e23fdbd9aed1bb935b2 (patch) | |
tree | 66d3f1b29fb11f9db988b514800be926737a5641 /lib/stdlib/doc | |
parent | 13e83e2e11b3d211c17c53140249a235b4d7a436 (diff) | |
download | otp-5c7209c2874849a5a7339e23fdbd9aed1bb935b2.tar.gz otp-5c7209c2874849a5a7339e23fdbd9aed1bb935b2.tar.bz2 otp-5c7209c2874849a5a7339e23fdbd9aed1bb935b2.zip |
stdlib: Add function lists:search/2
This is essentially PR 102, https://github.com/erlang/otp/pull/102.
The OTP Technical Board decided to change the name of the function to
search/2.
Diffstat (limited to 'lib/stdlib/doc')
-rw-r--r-- | lib/stdlib/doc/src/lists.xml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml index 7efafedc82..c3d5d7e07a 100644 --- a/lib/stdlib/doc/src/lists.xml +++ b/lib/stdlib/doc/src/lists.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>1996</year><year>2017</year> + <year>1996</year><year>2018</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -771,6 +771,18 @@ length(lists:seq(From, To, Incr)) =:= (To - From + Incr) div Incr</code> </func> <func> + <name name="search" arity="2"/> + <fsummary>Find the first element that satisfies a predicate.</fsummary> + <desc> + <p>If there is a <c><anno>Value</anno></c> in <c><anno>List</anno></c> + such that <c><anno>Pred</anno>(<anno>Value</anno>)</c> returns + <c>true</c>, returns <c>{value, <anno>Value</anno>}</c> + for the first such <c><anno>Value</anno></c>, + otherwise returns <c>false</c>.</p> + </desc> + </func> + + <func> <name name="splitwith" arity="2"/> <fsummary>Split a list into two lists based on a predicate.</fsummary> <desc> |