I have to write a function which uppercase the FIRST letter of a string and also LOWERCASE the rest of the string (This string contains random uppercased or lowercased letters).
So far, I have managed to do this:
capitalised :: String->String
capitalised [] = []
capitalised x
| length x == 1 = map toUpper x
| otherwise = capitalised (init x): map toLower (last x)
and all other sort of weird functions, and I still could not figure it out.
Please help! Tx in advance!
Forgot to mention, the problem states that I need to write a recursive solution!