Q:

how to use Special(reserved) characters in haskell?

I am newbie to haskell.am trying to implement encryption for a given plain text to cipher.here below is my sample code
encryptChar :: Int -> Char -> Char
encryptChar shift c
             | canEncrypt c = chr(ord c + wrapshift)
             | isUpper c = c
            where wrapshift = let shift' = shift `mod` 26 
                              in if (wraparound shift' c)
                                 then shift'-26
                                 else shift'
encryptChar _ '0' = '*'
encryptChar _ '1' = '\''
encryptChar _ '2' = '~'
encryptChar _ '3' = '!'
encryptChar _ '4' = '@'
encryptChar _ '5' = '#'
encryptChar _ '6' = '$'
encryptChar _ '7' = '%'
encryptChar _ '8' = '^'
encryptChar _ '9' = '&'
encryptChar _ '?' = ' '
encryptChar _ c = c

when my charecter contains a number it has to encrypt with special symbols for example in the above code when my character contains 1 it has to replace with \ which I found that it's reserved character in haskell.but how can I use these charecters to encrypt ?

A:

Short answer: use '\\'.
Most programming languages use escape sequences [wiki] to represent special characters, and use the backslash as the start of en escape sequence.
The backslash character is then represented as an escaped backslash, so '\\'.
Like the table in the Wikipedia article says:

Escape Sequence   Unicode   Literal Characters placed into string
\\                U+005C    backslash (\)

A:

Prelude> putStrLn $ "You can generate a backslash like this: \\ (escape sequence) or like this: \x5c (Unicode identifier sequence) or like this: " ++ [toEnum 92] ++ " (Unicode code point)."
You can generate a backslash like this: \ (escape sequence) or like this: \ (Unicode identifier sequence) or like this: \ (Unicode code point).

