isCtl :: Char -> Bool
isCtl c
| c < '\x1f' = True
- | c == '\x7f' = True
+ | c >= '\x7f' = True
| otherwise = False
quotedStr = do char '"'
xs <- many (qdtext <|> quotedPair)
char '"'
- return $ foldr (++) "" (["\""] ++ xs ++ ["\""])
+ return $ foldr (++) "" xs
where
- qdtext = char '"' >> fail ""
- <|>
- do c <- text
+ qdtext = do c <- satisfy (/= '"')
return [c]
quotedPair = do q <- char '\\'
c <- satisfy isChar
- return [q, c]
+ return [c]