Open mathiasverraes opened 4 years ago
Yes! as far as i understood from the "real" libraries like parsec et al, the monad instances they made for this are (almost) like this, but with some bells and whistles.
For the meetup I wanted to keep it as simple as possible, but I guess that would've been the more Haskelly way to do it indeed!
https://github.com/turanct/parser-combinators-from-scratch/blob/cd2087d61a7efd7ed4afbba3dffd554faea67d00/src/Parser.hs#L3
... at least this worked in my own attempt: