From 819cc743eba34cdd25e25f3c6ba5891a8cb6077d Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 12 Dec 2023 13:04:55 +0000 Subject: List functions --- lessons/src/lesson021_list_functions/text.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lessons/src/lesson021_list_functions/text.html (limited to 'lessons/src/lesson021_list_functions/text.html') 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 @@ +

+ The gleam/list + standard library module contains functions for working with lists. A Gleam + program will likely make heavy use of this module. +

+ +

+ map + makes a new list by running a function on each element in a list. +

+

+ filter + makes a new list containing only the elements for which a function returns + true. +

+

+ fold + 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. +

+

+ It's worth getting familiar with all the functions in this module when writing + Gleam code. +

-- cgit v1.2.3