aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library/lesson04_option_module/en.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/chapter4_standard_library/lesson04_option_module/en.html')
-rw-r--r--src/content/chapter4_standard_library/lesson04_option_module/en.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/content/chapter4_standard_library/lesson04_option_module/en.html b/src/content/chapter4_standard_library/lesson04_option_module/en.html
new file mode 100644
index 0000000..0c66b25
--- /dev/null
+++ b/src/content/chapter4_standard_library/lesson04_option_module/en.html
@@ -0,0 +1,16 @@
+<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.
+</p>
+
+<p>
+ The option type is very similar to the result type, but it does not have an
+ error value. Some languages have functions return an option when there is no
+ extra error detail to give, but Gleam always uses result. This makes all
+ fallible functions consistent and removes any boilerplate that would be
+ required when mixing functions that use each type.
+</p>