aboutsummaryrefslogtreecommitdiff
path: root/lessons/src/lesson021_list_functions/text.html
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-12-12 13:04:55 +0000
committerLouis Pilfold <louis@lpil.uk>2023-12-12 13:04:55 +0000
commit819cc743eba34cdd25e25f3c6ba5891a8cb6077d (patch)
treedd6454f3ec7ed3c878da0450475a209d2864e0f6 /lessons/src/lesson021_list_functions/text.html
parente660bc6a4eb2b7537e33617df9b411ef07a894d7 (diff)
downloadtour-819cc743eba34cdd25e25f3c6ba5891a8cb6077d.tar.gz
tour-819cc743eba34cdd25e25f3c6ba5891a8cb6077d.zip
List functions
Diffstat (limited to 'lessons/src/lesson021_list_functions/text.html')
-rw-r--r--lessons/src/lesson021_list_functions/text.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/lessons/src/lesson021_list_functions/text.html b/lessons/src/lesson021_list_functions/text.html
new file mode 100644
index 0000000..e143654
--- /dev/null
+++ b/lessons/src/lesson021_list_functions/text.html
@@ -0,0 +1,25 @@
+<p>
+ The <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html"><code>gleam/list</code></a>
+ standard library module contains functions for working with lists. A Gleam
+ program will likely make heavy use of this module.
+</p>
+
+<p>
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#map"><code>map</code></a>
+ makes a new list by running a function on each element in a list.
+</p>
+<p>
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#filter"><code>filter</code></a>
+ makes a new list containing only the elements for which a function returns
+ true.
+</p>
+<p>
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#fold"><code>fold</code></a>
+ combines all the elements in a list into a single value by running a function
+ left-to-right on each element, passing the result of the previous call to the
+ next call.
+</p>
+<p>
+ It's worth getting familiar with all the functions in this module when writing
+ Gleam code.
+</p>