r/functionalprogramming • • 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

11 comments sorted by

View all comments

Show parent comment

4

u/TarMil Dec 24 '22

Fun fact, parsing is the use case for which Applicative was invented in the first place.