What is being passed in?

Posted by Delirium tremens on Stack Overflow See other posts from Stack Overflow or by Delirium tremens
Published on 2010-06-04T21:37:36Z Indexed on 2010/06/05 14:22 UTC
Read the original article Hit count: 254

Filed under:

In the code:

oneChar :: Char -> Doc
oneChar c = case lookup c simpleEscapes of
              Just r -> text r
              Nothing | mustEscape c -> hexEscape c
                       | otherwise   -> char c
    where mustEscape c = c < ' ' || c == '\x7f' || c > '\xff'

simpleEscapes :: [(Char, String)]
simpleEscapes = zipWith ch "\b\n\f\r\t\\\"/" "bnfrt\\\"/"
    where ch a b = (a, ['\\',b])

r isn't being passed to oneChar. Where does r come from?

© Stack Overflow or respective owner

Related posts about haskell