aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library/lesson02_result_module
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/chapter4_standard_library/lesson02_result_module')
-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>