Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
5313-Move-maps-groups_from_list-docs-to-correct...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5313-Move-maps-groups_from_list-docs-to-correct-place.patch of Package erlang
From 16c988f00b692b80b7167e5beb6266cfa3e97c7c Mon Sep 17 00:00:00 2001 From: gustaw-lippa <gustaw.lippa@erlang-solutions.com> Date: Thu, 7 Jul 2022 16:26:15 +0200 Subject: [PATCH] Move maps:groups_from_list docs to correct place --- lib/stdlib/doc/src/maps.xml | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml index b6869c5cb9..98b764ab70 100644 --- a/lib/stdlib/doc/src/maps.xml +++ b/lib/stdlib/doc/src/maps.xml @@ -230,6 +230,39 @@ val1 </desc> </func> + <func> + <name name="groups_from_list" arity="2" since="OTP 25.0"/> + <fsummary>Splits the list into groups using a function as discriminator.</fsummary> + <desc> + <p>The result is a map where each key is given by <anno>Fun</anno> + and each value is a list of elements. The order of elements within + each list is preserved from the list.</p> + <p><em>Examples:</em></p> + <pre> +> <input>maps:groups_from_list(fun(X) -> X rem 2 end, [1,2,3]).</input> +#{0 => [2], 1 => [1, 3]} +> <input>maps:groups_from_list(fun erlang:length/1, ["ant", "buffalo", "cat", "dingo"]).</input> +#{3 => ["ant", "cat"], 5 => ["dingo"], 7 => ["buffalo"]}</pre> + </desc> + </func> + + <func> + <name name="groups_from_list" arity="3" since="OTP 25.0"/> + <fsummary>Splits the list into groups using a function as discriminator.</fsummary> + <desc> + <p>The result is a map where each key is given by + <anno>Fun</anno> and each value is a list of elements given by + the <anno>ValueFun</anno>. The order of elements within each + list is preserved from the list.</p> + <p><em>Examples:</em></p> + <pre> +> <input>maps:groups_from_list(fun(X) -> X rem 2 end, fun(X) -> X*X end, [1,2,3]).</input> +#{0 => [4], 1 => [1, 9]} +> <input>maps:groups_from_list(fun erlang:length/1, fun lists:reverse/1, ["ant", "buffalo", "cat", "dingo"]).</input> +#{3 => ["tna","tac"],5 => ["ognid"],7 => ["olaffub"]}</pre> + </desc> + </func> + <func> <name name="intersect" arity="2" since="OTP 24.0"/> <fsummary></fsummary> @@ -658,38 +691,5 @@ error</code> </desc> </func> - <func> - <name name="groups_from_list" arity="2" since="OTP 25.0"/> - <fsummary>Splits the list into groups using a function as discriminator.</fsummary> - <desc> - <p>The result is a map where each key is given by <anno>Fun</anno> - and each value is a list of elements. The order of elements within - each list is preserved from the list.</p> - <p><em>Examples:</em></p> - <pre> -> <input>maps:groups_from_list(fun(X) -> X rem 2 end, [1,2,3]).</input> -#{0 => [2], 1 => [1, 3]} -> <input>maps:groups_from_list(fun erlang:length/1, ["ant", "buffalo", "cat", "dingo"]).</input> -#{3 => ["ant", "cat"], 5 => ["dingo"], 7 => ["buffalo"]}</pre> - </desc> - </func> - - <func> - <name name="groups_from_list" arity="3" since="OTP 25.0"/> - <fsummary>Splits the list into groups using a function as discriminator.</fsummary> - <desc> - <p>The result is a map where each key is given by - <anno>Fun</anno> and each value is a list of elements given by - the <anno>ValueFun</anno>. The order of elements within each - list is preserved from the list.</p> - <p><em>Examples:</em></p> - <pre> -> <input>maps:groups_from_list(fun(X) -> X rem 2 end, fun(X) -> X*X end, [1,2,3]).</input> -#{0 => [4], 1 => [1, 9]} -> <input>maps:groups_from_list(fun erlang:length/1, fun lists:reverse/1, ["ant", "buffalo", "cat", "dingo"]).</input> -#{3 => ["tna","tac"],5 => ["ognid"],7 => ["olaffub"]}</pre> - </desc> - </func> - </funcs> </erlref> -- 2.35.3
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