aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/doc/src/lists.xml
diff options
context:
space:
mode:
authorJesper Louis Andersen <[email protected]>2016-04-09 17:17:59 +0200
committerJesper Louis Andersen <[email protected]>2016-04-09 17:22:37 +0200
commitc660e30a7dd781f71bed050b20c3e2d0b069e063 (patch)
treeaff243cd344c25e75787ece31d13599aef9e5195 /lib/stdlib/doc/src/lists.xml
parent9e3d98d67a9fbc62aa54b3035b953eb94486cdf7 (diff)
downloadotp-c660e30a7dd781f71bed050b20c3e2d0b069e063.tar.gz
otp-c660e30a7dd781f71bed050b20c3e2d0b069e063.tar.bz2
otp-c660e30a7dd781f71bed050b20c3e2d0b069e063.zip
Implement lists:join/2
Add a call which works much like string:join/2 but for arbitrary lists. Provide the function itself, lifted from Haskells Data.List standard library, provide documentation and provide tests for the function.
Diffstat (limited to 'lib/stdlib/doc/src/lists.xml')
-rw-r--r--lib/stdlib/doc/src/lists.xml15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml
index 89ba5238b5..84e9615e4f 100644
--- a/lib/stdlib/doc/src/lists.xml
+++ b/lib/stdlib/doc/src/lists.xml
@@ -262,6 +262,21 @@ flatmap(Fun, List1) ->
</desc>
</func>
<func>
+ <name name="join" arity="2"/>
+ <fsummary>Insert an element between elements in a list</fsummary>
+ <desc>
+ <p>Inserts <c><anno>Sep</anno></c> between each element in <c><anno>List1</anno></c>. Has no
+ effect on the empty list and on a singleton list. For example:</p>
+ <pre>
+> <input>lists:join(x, [a,b,c]).</input>
+[a,x,b,x,c]
+> <input>lists:join(x, [a]).</input>
+[a]
+> <input>lists:join(x, []).</input>
+[]</pre>
+ </desc>
+ </func>
+ <func>
<name name="foreach" arity="2"/>
<fsummary>Apply a function to each element of a list</fsummary>
<desc>