Skip to content

Instantly share code, notes, and snippets.

@shangaslammi
Created March 3, 2012 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shangaslammi/1968185 to your computer and use it in GitHub Desktop.
Save shangaslammi/1968185 to your computer and use it in GitHub Desktop.
Example: parsing quoted strings with an applicative parser
quotedString :: Parser String
quotedString = char '"' *> many (escaped <|> nonQuote) <* char '"' where
escaped = char '\\' *> anyChar
nonQuote = charIf (/= '"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment