3 ms·
"The most obvious question at this point (or much earlier) is what are monads good for? To illustrate this in a practical way, consider recursive descent parsin
by jimbokun 18y ago
"The most obvious question at this point (or much earlier) is what are monads good for? To illustrate this in a practical way, consider recursive descent parsing."
This was the most useful part to me. My question about monads is always "Why should I care?" Now I know at least one possible answer: "It makes it easier to implement recursive descent parsing." Cool.
- ionfish 18y agoGraham Hutton has written a couple of papers on monadic parser combinators: http://cs.nott.ac.uk/~gmh/bib.html#pearl http://cs.nott.ac.uk/~gmh/bib.html#pearl http://cs.nott.ac.uk/~gmh/bib.html#monparsing http://cs.nott.ac.uk/~gmh/bib.html#monparsing He also discusses them in chapter 8 of Programming in Haskell; the code is up on his site, you want the 'Functional parsing library' and 'Expression parser'. http://www.cs.nott.ac.uk/~gmh/book.html#code http://www.cs.nott.ac.uk/~gmh/book.html#code