An open API service indexing awesome lists of open source software.

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.

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!"
```