r/functionalprogramming • u/ketalicious • Dec 23 '22
Python Functional Implementation of a parser?
How do i implement a parser in functional pattern?
For instance I want parse a simple math parser like this:
"1 * 2 + 3" -> ast
How do implement the parser for that in pure functional pattern?
23
Upvotes
View all comments
Show parent comment
7
u/LivewareIssue Dec 23 '22
+1 on the monad parsing pearl, highly recommend.
Here’s a gist with a literate Haskell implementation of the paper which you might also find helpful.