Parser Combinators: a Walkthrough
This article provides a walkthrough of implementing a JSON parser using parser combinators. It begins by defining the type representation for parsers and writing elementary parsers. The sequencing of parsers is then covered, followed by introducing monads to simplify the code. Combinators such as choice, errors, backtracking, and repetition are also discussed. Finally, a JSON parser is built using these concepts, demonstrating how they can be combined to create more complex parsers. The article emphasizes the beauty of parser combinators and their practical applications in various scenarios.
Company
Hasura
Date published
Dec. 4, 2020
Author(s)
Antoine Leblanc
Word count
3692
Language
English
Hacker News points
2