https://github.com/talhaahussain/morse-translator
A Morse code translation tool, written in Haskell.
https://github.com/talhaahussain/morse-translator
haskell morse morse-code morse-code-converter morse-code-translator morse-translator morsecode morsecode-encoder-decoder morsecode-translator morsecodetranslator
Last synced: 2 months ago
JSON representation
A Morse code translation tool, written in Haskell.
- Host: GitHub
- URL: https://github.com/talhaahussain/morse-translator
- Owner: talhaahussain
- License: mit
- Created: 2024-06-16T03:41:51.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-06-30T20:05:04.000Z (11 months ago)
- Last Synced: 2025-03-09T01:41:57.673Z (2 months ago)
- Topics: haskell, morse, morse-code, morse-code-converter, morse-code-translator, morse-translator, morsecode, morsecode-encoder-decoder, morsecode-translator, morsecodetranslator
- Language: Haskell
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Morse-translator
A Morse code translation tool, written in Haskell.### Usage (with GHCi)
#### GHCi and Loading Modules
First, run `ghci` to enter The Glasgow Haskell Compiler interactive interface. Load the source files with
```
Prelude> :l morse_to_text.hs
```
and
```
Prelude> :l text_to_morse.hs
```#### Translating Morse to Text
Translating Morse code to plaintext can be done either with a single Morse string or an array of Morse strings. To translate a single Morse string, use
```
Prelude> morseToChar ".-"
```To translate a sequence of Morse strings, use
```
Prelude> morseToString ["....", ".", ".-..", ".-..", "---", " ", ".--", "---", ".-.", ".-..", "-..", "-.-.--"]
```#### Translating Text to Morse
Translating plaintext to Morse code can be done either character-wise or string-wise. To translate a single character, use
```
Prelude> charToMorse 'A'
```To translate a string, use
```
Prelude> stringToMorse "Hello World!"
```