Skip to content

Instantly share code, notes, and snippets.

@hhqwerty
Last active September 16, 2021 18:21
Show Gist options
  • Save hhqwerty/5c929f1599c31639c350a592e5baef1a to your computer and use it in GitHub Desktop.
Save hhqwerty/5c929f1599c31639c350a592e5baef1a to your computer and use it in GitHub Desktop.
Speller Haskell
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