aboutsummaryrefslogtreecommitdiff
path: root/lessons/src/lesson026_list_recursion/text.html
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-12-21 14:03:41 +0000
committerLouis Pilfold <louis@lpil.uk>2023-12-21 14:03:41 +0000
commit4efb34bd728732101432843ed0bfbeb971272287 (patch)
tree71b3b767c417809d92280cec64424c31c9a475be /lessons/src/lesson026_list_recursion/text.html
parent2a6ae1fa5408247c95bf4a7d59e5038342a2a125 (diff)
downloadtour-4efb34bd728732101432843ed0bfbeb971272287.tar.gz
tour-4efb34bd728732101432843ed0bfbeb971272287.zip
Add chapters
Diffstat (limited to 'lessons/src/lesson026_list_recursion/text.html')
-rw-r--r--lessons/src/lesson026_list_recursion/text.html22
1 files changed, 0 insertions, 22 deletions
diff --git a/lessons/src/lesson026_list_recursion/text.html b/lessons/src/lesson026_list_recursion/text.html
deleted file mode 100644
index 7f2351d..0000000
--- a/lessons/src/lesson026_list_recursion/text.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<p>
- Most commonly functions in the
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html"><code>gleam/list</code></a>
- module are used to iterate across a list, but at times you may prefer
- to work with the list directly.
-</p>
-<p>
- Gleam doesn't have a looping syntax, instead iteration is done through
- recursion and pattern matching.
-</p>
-<p>
- The <code>[first, ..rest]</code> pattern matches on a list with at least one
- element, assigning the first element to the variable <code>first</code> and
- the rest of the list to the variable <code>rest</code>.
- By using this pattern and a pattern for the empty list <code>[]</code> a
- function can run code on each element of a list until the end is reached.
-</p>
-<p>
- This code sums a list by recursing over the list and adding each int to a
- <code>total</code> argument, returning it when the end is reached.
-</p>
-