Functions for working with string in Haskell?

Working with encrypted text, I need to write 2 functions that does not work, one should take all the characters, except for letters, the second to return these characters in the new text. (Letters in one register only great) Example:
After the first function turns a string : ЯЕДУСКОРОБУДУЗДРАВСТВУЙМИРСПОКОЙНОЙНОЧИ
And after the second comes the original text. I think you need 3 functions, the first returns a list of pairs of String -> [(Char, Int)] Where the symbol and records the number in the string, ignoring the Letters. The second returns a string with no characters, only letters, well this feature is easy, it is not needed)) String -> String
Well, the third function is the list of pairs, and the resulting string is to put all the characters into place.
String -> [(Char, Int)] -> String
Please help, does not work(
March 23rd 20 at 18:56
1 answer
March 23rd 20 at 18:58
Don't know how the Russian, but the first function (after you called it the second) is the filter:
import Data.Char
f1 = filter isAlpha -- or isLetter

> f1 "a,b,c"
> "abc"
So the bottom line is that I later want to restore with the same signs, and not just to throw them away) - Easton_Sip commented on March 23rd 20 at 19:01
@Easton_Sip, a Curious question: what if the second function (the final) will just return the original string? - Wilfred.Hartmann89 commented on March 23rd 20 at 19:04
@Wilfred.Hartmann89, the symbols will change, but they will be the same I need to a new line appeared all the service... - Easton_Sip commented on March 23rd 20 at 19:07
What if it is?:
map (if isAlpha then f1 else id)
where f1 is the transformation function of the letters - Wilfred.Hartmann89 commented on March 23rd 20 at 19:10

Find more questions by tags Haskell