aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library
diff options
context:
space:
mode:
authorDimitrii Dulgher <d1alogw0w@gmail.com>2024-04-13 00:04:06 +0300
committerLouis Pilfold <louis@lpil.uk>2024-04-15 13:08:02 +0100
commita1c22e954299de5c823ec47cd2f633355764e3b2 (patch)
tree6db2d8e2d349d3078bb30190fae2271797cbc18a /src/content/chapter4_standard_library
parent421cbe75fa1bfbd4bc271bf233ede15836de760d (diff)
downloadtour-a1c22e954299de5c823ec47cd2f633355764e3b2.tar.gz
tour-a1c22e954299de5c823ec47cd2f633355764e3b2.zip
Add hrefs to code keywords
Diffstat (limited to 'src/content/chapter4_standard_library')
-rw-r--r--src/content/chapter4_standard_library/lesson00_standard_library_package/en.html7
-rw-r--r--src/content/chapter4_standard_library/lesson01_list_module/en.html30
-rw-r--r--src/content/chapter4_standard_library/lesson02_result_module/en.html24
-rw-r--r--src/content/chapter4_standard_library/lesson03_dict_module/en.html24
-rw-r--r--src/content/chapter4_standard_library/lesson04_option_module/en.html13
5 files changed, 52 insertions, 46 deletions
diff --git a/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html b/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html
index e921652..4014136 100644
--- a/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html
+++ b/src/content/chapter4_standard_library/lesson00_standard_library_package/en.html
@@ -4,8 +4,11 @@
not use it if you wish, though almost all Gleam projects depend on it.
</p>
<p>
- All of the modules imported so far in this guide, such as
- <code>gleam/io</code>, are from the standard library.
+ All of the modules imported so far in this guide, such as
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/io.html" target="_blank">
+ <code>gleam/io</code>
+ </a>,
+ are from the standard library.
</p>
<p>
All of the documentation for the standard library is available on
diff --git a/src/content/chapter4_standard_library/lesson01_list_module/en.html b/src/content/chapter4_standard_library/lesson01_list_module/en.html
index 7451b10..9c6b953 100644
--- a/src/content/chapter4_standard_library/lesson01_list_module/en.html
+++ b/src/content/chapter4_standard_library/lesson01_list_module/en.html
@@ -1,38 +1,38 @@
<p>
The
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html"
- ><code>gleam/list</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html" target="_blank">
+ <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, the various functions
serving as different types of loops over lists.
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#map"
- ><code>map</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#map" target="_blank">
+ <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
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#filter" target="_blank">
+ <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
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#fold" target="_blank">
+ <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>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#find"
- ><code>find</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/list.html#find" target="_blank">
+ <code>find</code>
+ </a>
returns the first element in a list for which a function returns
<code>True</code>.
</p>
diff --git a/src/content/chapter4_standard_library/lesson02_result_module/en.html b/src/content/chapter4_standard_library/lesson02_result_module/en.html
index 4901afd..0760145 100644
--- a/src/content/chapter4_standard_library/lesson02_result_module/en.html
+++ b/src/content/chapter4_standard_library/lesson02_result_module/en.html
@@ -1,25 +1,25 @@
<p>
The
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html"
- ><code>gleam/result</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html" target="_blank">
+ <code>gleam/result</code>
+ </a>
standard library module contains functions for working with results. Gleam
programs will make heavy use of this module to avoid excessive nested case
expressions when calling multiple functions that can fail.
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#map"
- ><code>map</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#map" target="_blank">
+ <code>map</code>
+ </a>
updates a value held within the Ok of a result by calling a given function on
it. If the result is an error then the function is not called.
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#try"
- ><code>try</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#try" target="_blank">
+ <code>try</code>
+ </a>
runs a result returning function on the value held within an Ok of a result.
If the result is an error then the function is not called. This is useful for
chaining together multiple function calls that can fail, one after the other,
@@ -27,9 +27,9 @@
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#unwrap"
- ><code>unwrap</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/result.html#unwrap" target="_blank">
+ <code>unwrap</code>
+ </a>
extracts the success value from a result, or returning a default value if the
result is an error.
</p>
diff --git a/src/content/chapter4_standard_library/lesson03_dict_module/en.html b/src/content/chapter4_standard_library/lesson03_dict_module/en.html
index f7eb879..4037085 100644
--- a/src/content/chapter4_standard_library/lesson03_dict_module/en.html
+++ b/src/content/chapter4_standard_library/lesson03_dict_module/en.html
@@ -9,24 +9,24 @@
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#new"
- ><code>new</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#new" target="_blank">
+ <code>new</code>
+ </a>
and
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#from_list"
- ><code>from_list</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#from_list" target="_blank">
+ <code>from_list</code>
+ </a>
can be used to create new dicts.
</p>
<p>
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#insert"
- ><code>insert</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#insert" target="_blank">
+ <code>insert</code>
+ </a>
and
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#delete"
- ><code>delete</code></a
- >
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/dict.html#delete" target="_blank">
+ <code>delete</code>
+ </a>
are used to add and remove items from a dict.
</p>
<p>
diff --git a/src/content/chapter4_standard_library/lesson04_option_module/en.html b/src/content/chapter4_standard_library/lesson04_option_module/en.html
index 0c66b25..699b5bd 100644
--- a/src/content/chapter4_standard_library/lesson04_option_module/en.html
+++ b/src/content/chapter4_standard_library/lesson04_option_module/en.html
@@ -1,10 +1,13 @@
<p>
Values in Gleam are not nullable, so the
- <a href="https://hexdocs.pm/gleam_stdlib/gleam/option.html"
- ><code>gleam/option</code></a
- >
- standard library module defines Gleam's <code>Option</code> type, which can be
- used to represent a value that is either present or absent.
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/option.html" target="_blank">
+ <code>gleam/option</code>
+ </a>
+ standard library module defines Gleam's
+ <a href="https://hexdocs.pm/gleam_stdlib/gleam/option.html#Option" target="_blank">
+ <code>Option</code>
+ </a>
+ type, which can be used to represent a value that is either present or absent.
</p>
<p>