Hello,

I would like to be able to use the GHC API for parsing. Right now this is in the Parser and Lexer modules:

Parser: http://www.haskell.org/ghc/docs/7.8.2/html/libraries/ghc-7.8.2/Parser.html
Lexer: http://www.haskell.org/ghc/docs/7.8.2/html/libraries/ghc-7.8.2/Lexer.html

GHC currently exposes only a few parsers here. I'd like to make a few modifications:

1. Expose a few more parsers than currently are exposed in the Parser module. In particular, I'd like import statements, type signatures, declarations, and expressions, at least, in addition to what's already there.

2. Re-export some things from Lexer from Parser, since they're reused. This would include unP, PState, and the 2-3 other core things you have to use in order to use the GHC Parser. 

3. Add some Haddock documentation to the top of the Parser module describing how to use it, since the types themselves are pretty opaque here.

I think (1) and (3) are definitely a good idea, not so sure about (2) though IMHO it would be convenient for using the Parser.

Would this make for an acceptable patch? Thoughts?

-- Andrew Gibiansky