Parsing and Monads

My next compiler series post will cover error reporting in the parser. For good error reporting in the parser we need to at least report the line and column number of the error. This implies more communication between the parser and the lexer. In particular we have to tell Happy to use a threaded lexer. This implies the usage of monads. I’ve gotten up to this point in Haskell with no real understanding of monads.

I have to split off my compiler series and read about and more importantly understand what monads are and what they do.

My first step is to read the chapter 14 of Real World Haskell on monads. I promise I’ll be back after my excursion. It might be a while since I’m not too bright and it takes me a while to grok abstractions. I’ll do my best and report back.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s