diff options
author | Louis Pilfold <louis@lpil.uk> | 2024-03-26 13:57:31 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-03-26 13:57:31 +0000 |
commit | c2dcbe0f25a3e8bd60a4ccf377bbdd47f4794871 (patch) | |
tree | 18862644ee2dada0a926392b11e606bb0d2262f7 /src/content/chapter5_advanced_features/lesson05_let_assert/en.html | |
parent | ccf75d2c362ac8e4dcd12c781f6e1eafd0064813 (diff) | |
download | tour-c2dcbe0f25a3e8bd60a4ccf377bbdd47f4794871.tar.gz tour-c2dcbe0f25a3e8bd60a4ccf377bbdd47f4794871.zip |
Document opaque types
Closes https://github.com/gleam-lang/language-tour/issues/63
Diffstat (limited to 'src/content/chapter5_advanced_features/lesson05_let_assert/en.html')
-rw-r--r-- | src/content/chapter5_advanced_features/lesson05_let_assert/en.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/content/chapter5_advanced_features/lesson05_let_assert/en.html b/src/content/chapter5_advanced_features/lesson05_let_assert/en.html new file mode 100644 index 0000000..29fd06c --- /dev/null +++ b/src/content/chapter5_advanced_features/lesson05_let_assert/en.html @@ -0,0 +1,15 @@ +<p> + <code>let assert</code> is the final way to intentionally crash your Gleam + program. It is similar to the <code>panic</code> keyword in that it crashes + when the program has reached a point that should never be reached. +</p> +<p> + <code>let assert</code> is similar to <code>let</code> in that it is a way to + assign values to variables, but it is different in that the pattern can be + <i>partial</i>. The pattern does not need to match every possible value of the + type being assigned. +</p> +<p> + Like <code>panic</code> this feature should be used sparingly, and likely not + at all in libraries. +</p> |