aboutsummaryrefslogtreecommitdiff
path: root/lessons/src/lesson021_list_functions/text.html
blob: e1436547d6db862a8807eaae4af40f5374c455f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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>