aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library/lesson02_result_module/en.html
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/lesson02_result_module/en.html
parent421cbe75fa1bfbd4bc271bf233ede15836de760d (diff)
downloadtour-a1c22e954299de5c823ec47cd2f633355764e3b2.tar.gz
tour-a1c22e954299de5c823ec47cd2f633355764e3b2.zip
Add hrefs to code keywords
Diffstat (limited to 'src/content/chapter4_standard_library/lesson02_result_module/en.html')
-rw-r--r--src/content/chapter4_standard_library/lesson02_result_module/en.html24
1 files changed, 12 insertions, 12 deletions
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>