Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
1240-Clarify-the-Pred-function-in-lists-must-re...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 1240-Clarify-the-Pred-function-in-lists-must-return-boole.patch of Package erlang
From dd4f76152077ade499a51c02b8b56403d90264b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= <jose.valim@dashbit.co> Date: Sat, 19 Jun 2021 17:00:39 +0200 Subject: [PATCH] Clarify the Pred function in lists must return booleans Closes #4985. --- lib/stdlib/doc/src/lists.xml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml index 9261ade998..5477f13d1e 100644 --- a/lib/stdlib/doc/src/lists.xml +++ b/lib/stdlib/doc/src/lists.xml @@ -69,7 +69,8 @@ <desc> <p>Returns <c>true</c> if <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c> for all elements <c><anno>Elem</anno></c> in - <c><anno>List</anno></c>, otherwise <c>false</c>.</p> + <c><anno>List</anno></c>, otherwise <c>false</c>. The <c>Pred</c> + function must return a boolean.</p> </desc> </func> @@ -80,7 +81,8 @@ <desc> <p>Returns <c>true</c> if <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c> for at least one element <c><anno>Elem</anno></c> - in <c><anno>List</anno></c>.</p> + in <c><anno>List</anno></c>. The <c>Pred</c> function must return a + boolean.</p> </desc> </func> @@ -154,7 +156,8 @@ <p>Drops elements <c><anno>Elem</anno></c> from <c><anno>List1</anno></c> while <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c> and - returns the remaining list.</p> + returns the remaining list. The <c>Pred</c> function must return a + boolean.</p> </desc> </func> @@ -177,7 +180,8 @@ <desc> <p><c><anno>List2</anno></c> is a list of all elements <c><anno>Elem</anno></c> in <c><anno>List1</anno></c> for which - <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c>.</p> + <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c>. + The <c>Pred</c> function must return a boolean.</p> </desc> </func> @@ -798,7 +803,8 @@ splitwith(Pred, List) -> {[1],[2,3,4,5,6,7]} > <input>lists:splitwith(fun(A) -> is_atom(A) end, [a,b,1,c,d,2,3,4,e]).</input> {[a,b],[1,c,d,2,3,4,e]}</pre> - <p>For a different way to partition a list, see + <p>The <c>Pred</c> function must return a + boolean. For a different way to partition a list, see <seealso marker="#partition/2"><c>partition/2</c></seealso>.</p> </desc> </func> @@ -879,7 +885,8 @@ splitwith(Pred, List) -> <c><anno>List1</anno></c> while <c><anno>Pred</anno>(<anno>Elem</anno>)</c> returns <c>true</c>, that is, the function returns the longest prefix of the list for which - all elements satisfy the predicate.</p> + all elements satisfy the predicate. The <c>Pred</c> function must + return a boolean.</p> </desc> </func> -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor