Revisiting 'Monadic Parsing in Haskell'
vaibhavsagar.com
vaibhavsagar.com
I had the same experience, Parsec is one of the best examples of the power of Haskell and what really sold me on the language.
It's also a great way to communicate the utility and effectiveness for using monads to solve programming problems (in this case as an alternative to messy Regex).
I'm really looking forward to Purescript [1], which has its own Parsec library in development [2] so I can use it with my frontend development... which is typically where I used Regex the most (in the DOM).
[1] http://www.purescript.org/
[2] https://github.com/purescript-contrib/purescript-parsing
So far I haven't been satisfied with any Parsec port to another language. This article helped me understand how a lot of the design of [Atto]parsec is just the natural result of using Haskell for what it's good for, and that aspect seems to translate badly when Haskell is replaced with another language. But maybe the Purescript port can do better.
Chapter 13 of (the second edition of) that book also revisits the original paper from a modern viewpoint and overlaps with the current article. For example, both the book and the article mention the similarity with the state transformer, introduce instances of 'functor' and 'applicative' before the 'monad' instance, and discuss the 'alternative' instance.
type Parser b t a = FreeT ((->) t) b a
I'd like to see someone make a rhyme out of that.https://hackage.haskell.org/package/parsers-0.12.8/docs/Text...
I only recently started learning Haskell seriously, and it was surprising to learn that “Applicative” is a more recent discovery.