Last active
September 16, 2021 18:21
-
-
Save hhqwerty/5c929f1599c31639c350a592e5baef1a to your computer and use it in GitHub Desktop.
Speller Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
speller ::[String] -> String | |
speller [] = "" | |
speller (x:xs) | xs==[] = "and " ++ helper x | |
| otherwise = (helper x) ++", " ++ speller xs | |
helper :: String -> String | |
helper word = (head word) : (" " ++ "is for " ++ word) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment