Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9294 closed feature request (fixed)

More exports and documentation for GHC API Parser Module

Reported by: agibiansky Owned by: agibiansky
Priority: normal Milestone: 7.10.1
Component: GHC API Version: 7.8.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D71
Wiki Page:


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

Parser: Lexer:

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.
  1. Add some Haddock documentation to the top of the Parser module describing how to use it, since the types themselves are pretty opaque here.
  1. Export a clean and self-contained parsing API from the GHC module.

See minor discussion here:

Change History (5)

comment:1 Changed 5 years ago by simonpj

That all sounds good to me. Please go ahead and send us a patch.

Simon Marlow is best acquainted with the parser and lexer, so it'd be worth checking significant changes with him.


comment:2 Changed 5 years ago by agibiansky

The changes are not at all significant, FYI.

It's implemented and I sent a patch (

This covers the first two points, and given the documentation I added, I think the third is not necessary, as it should be fairly straightforward to use the Parser module.

comment:3 Changed 5 years ago by simonpj

Differential Rev(s): Phab:D71
Status: newpatch

comment:4 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

This was merged - thanks!

comment:5 Changed 5 years ago by thoughtpolice

Milestone: 7.10.1
Note: See TracTickets for help on using tickets.