![[Mr Happy]](Happy.gif)
Happy is a parser generator system for Haskell, similar to the tool `yacc' for C. Like `yacc', it takes a file containing an annotated BNF specification of a grammar and produces a Haskell module containing a parser for the grammar.
Happy is flexible: you can have several Happy parsers in the same program, and several entry points to a single grammar. Happy can work in conjunction with a lexical analyser supplied by the user (either hand-written or generated by another program), or it can parse a stream of characters directly (but this isn't practical in most cases).
As of version 1.5, Happy is capable of parsing full Haskell. We have a Haskell parser that uses Happy, which will shortly be part of the library collection distributed with GHC.
The current public version of Happy is 1.17, which was released on 22 October 2007. However, more recent snapshots of the Happy source code can be obtained from the darcs repository:
darcs get http://darcs.haskell.org/happy/
Feel free to hack on Happy and darcs send me your patches.
To compile Happy from source, you'll need GHC version 5.04 or later.
We also have binary distributions for various platforms:
The following binaries are for older versions of Happy:
Happy versions up to 0.9 were written by Andy Gill and Simon Marlow.
All improvements since 0.9 are by Simon Marlow (and various other contributors).
A big thanks to Ben Jones for loaning out his copy of the Roger Hargreaves Mr Happy book.