aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam')
-rw-r--r--src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam b/src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam
deleted file mode 100644
index 2ba907a..0000000
--- a/src/content/chapter5_advanced_features/lesson04_let_assert/code.gleam
+++ /dev/null
@@ -1,16 +0,0 @@
-import gleam/io
-
-pub fn main() {
- let a = unsafely_get_first_element([123])
- io.debug(a)
-
- let b = unsafely_get_first_element([])
- io.debug(b)
-}
-
-pub fn unsafely_get_first_element(items: List(a)) -> a {
- // This will panic if the list is empty.
- // A regular `let` would not permit this partial pattern
- let assert [first, ..] = items
- first
-}