Monadic Parsing - General

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Dmitri Priimak

Does anyone one know good article introducing monadic parsing preferably in context of Scala?

Pedro Minicz

My introduction was Stephen Diehl's Write you a Haskell. He introduces monadic parsers by implementing one. I believe that is the best way to go about it, whatever language you might do it in.

Pedro Minicz

Even though it is Haskell, the "NanoParsec" is pretty simple, so I believe it is a good starting point.

Pedro Minicz

After that, maybe reading the source code for an existing monadic parser library (at least I enjoy learning by reading code, your mileage may vary).

csaurus

This paper does a decent walkthrough as well, but you would also need to translate from the Haskell http://www.cs.nott.ac.uk/~pszgmh/pearl.pdf

Kim-Ee Yeoh

That “decent walkthrough” was the paper that launched monadic parsing 22 years ago!

Kim-Ee Yeoh

Actually if you look up the wikipedia, parser combinators have been around in different guises since 1989. Monadic parser combinators is what is innovatively at the heart of the “decent walkthrough.”

csaurus

I suppose I did understate it a bit, and I wasn't trying to downplay the achievements of Hutton/Meijer. I think it is a really good introduction which doesn't assume much on the part of the reader.

Kim-Ee Yeoh

Indeed. I desire that the haskell community, far from comprising mere programmers of said language, refer to a group of people which upholds the values—felicitous communication being at the core—that gave birth to the language.

Haskell was designed by a committee of divergently opinionated, nervy individuals that possessed the vanishing skills of disagreeing without being disagreeable and so converged on a result.

As for today?

A group spirals into a dissipation of wasted life force every second.

Torsten Schmits

that's pretty pessimistic

Kim-Ee Yeoh

I’m not saying every single group fails. I’m saying that I see more groups per capita per unit time failing today than in the past.

Kim-Ee Yeoh

Groups form and then they break up, not unlike divorce rates going up.

Kim-Ee Yeoh

csaurus said:

I suppose I did understate it a bit, and I wasn't trying to downplay the achievements of Hutton/Meijer. I think it is a really good introduction which doesn't assume much on the part of the reader.

I didn't think that you were downplaying the authors achievements. It felt more like describing the gospels as a "decent walkthrough" of christianity. I was tickled silly.

Dmitri Priimak

Thanks a lot. It would really be nice though to have something more recent (not there is anything special about it more recent) with accent on Scala.

Pedro Minicz

Kim-Ee Yeoh said:

[...] nervy individuals that possessed the vanishing skills of disagreeing without being disagreeable and so converged on a result.

That is a pretty good ideal for a community!