From aeb5041aaf0ce2a546d6f1d2aabf18523abd7c80 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Wed, 11 Dec 2024 16:56:19 +0100 Subject: [PATCH] Add imports to the readme example --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18d87d1..b7cc833 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ A package for encoding and decoding Morse code in Gleam. ## Usage ```gleam +import gleam/io +import morse + let text = "Hello world!" -case encode(text) { +case morse.encode(text) { Ok(symbols) -> io.println("The Morse code for " <> text <> " is " <> to_string(symbols)) - Error(UnknownCharacter(char)) -> + Error(morse.UnknownCharacter(char)) -> io.println_error("Invalid character: " <> char) } ```