A package for encoding and decoding Morse code in Gleam.
import gleam/io import morsey let text = "Hello world!" case morsey.encode(text) { Ok(symbols) -> io.println("Morse code for " <> text <> " is " <> morsey.to_string(symbols)) Error(morsey.InvalidCharacter(char)) -> io.println_error("Invalid character: " <> char) }import gleam/io import morsey ".... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.--" |> morsey.from_string |> morsey.decode |> io.printlngleam run # Run the project gleam test # Run the tests