Hint 1
These two functions from Data.Char
will be helpful:
ord :: Char -> Int
chr :: Int -> Char
The first one converts a character to its numerical representation (e.g. 'a' → 97, 'b' → 98) while the other does the reverse conversion (97 → 'a', 98 → 'b').
Using these function in a reasonable way will allow you to implement siguienteLetra
.
Hint 2
You will need a third function, besides ord
and chr
, what should it do? This third function is in Prelude
, but it might be difficult to guess its name (depending on your background). Fortunately, the function is very simple and you will easily write it yourself.
Hint 3
What should be the signature of siguienteLetra
? Look at the signatures of your three functions (ord
, chr
and the third one) and think of the order in which they should be combined.