aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter4_standard_library/lesson02_result_module/code.gleam
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2024-05-29 20:25:52 +0100
committerLouis Pilfold <louis@lpil.uk>2024-05-29 20:25:52 +0100
commitc5190f1a5f1fe5ca42a3d89f06c5186cf87eca25 (patch)
treeb2d3f220594b2467300a2f1a4f21eb40454dcc85 /src/content/chapter4_standard_library/lesson02_result_module/code.gleam
parent6906edef11a2c034e5b1715933ec852609b1654e (diff)
downloadtour-c5190f1a5f1fe5ca42a3d89f06c5186cf87eca25.tar.gz
tour-c5190f1a5f1fe5ca42a3d89f06c5186cf87eca25.zip
Upgrade version
Diffstat (limited to 'src/content/chapter4_standard_library/lesson02_result_module/code.gleam')
-rw-r--r--src/content/chapter4_standard_library/lesson02_result_module/code.gleam10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/content/chapter4_standard_library/lesson02_result_module/code.gleam b/src/content/chapter4_standard_library/lesson02_result_module/code.gleam
index ec7039b..423938a 100644
--- a/src/content/chapter4_standard_library/lesson02_result_module/code.gleam
+++ b/src/content/chapter4_standard_library/lesson02_result_module/code.gleam
@@ -4,13 +4,13 @@ import gleam/result
pub fn main() {
io.println("=== map ===")
- io.debug(result.map(Ok(1), fn(x) { x * 2 }))
- io.debug(result.map(Error(1), fn(x) { x * 2 }))
+ let _ = io.debug(result.map(Ok(1), fn(x) { x * 2 }))
+ let _ = io.debug(result.map(Error(1), fn(x) { x * 2 }))
io.println("=== try ===")
- io.debug(result.try(Ok("1"), int.parse))
- io.debug(result.try(Ok("no"), int.parse))
- io.debug(result.try(Error(Nil), int.parse))
+ let _ = io.debug(result.try(Ok("1"), int.parse))
+ let _ = io.debug(result.try(Ok("no"), int.parse))
+ let _ = io.debug(result.try(Error(Nil), int.parse))
io.println("=== unwrap ===")
io.debug(result.unwrap(Ok("1234"), "default"))