Skip to content

Instantly share code, notes, and snippets.

@codeguru42
Created December 18, 2013 13:29
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 codeguru42/8022335 to your computer and use it in GitHub Desktop.
Save codeguru42/8022335 to your computer and use it in GitHub Desktop.
List parser
set = do
char '{'
result <- list
char '}'
return result
list = sepBy1 cell (char ',')
cell = many (noneOf ",}")
parseSet :: String -> Either ParseError [String]
parseSet = parse set "(unknown)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment