Extra parse stage...

Simon Marlow simonmar at microsoft.com
Wed Aug 25 10:47:44 EDT 2004

On 25 August 2004 12:28, MR K P SCHUPKE wrote:

> I wish to add some extended syntax to type definitions,
> assuming I modify the parser files and associated datatypes
> to carry the extra information, is there a convenient place
> to insert a pre-parse (before type-checking) to convert the
> syntax extensions to regular haskell?

GHC's strategy is to not do any translation before typechecking, so that
we can generate good error messages.

Nevertheless, it's certainly possible to do what you're suggesting: just
insert an HsSyn->HsSyn pass after parsing (I imagine).  Various things
might complicate matters, such as needing to refer to fixed entities in
other modules in the translation.


More information about the Glasgow-haskell-users mailing list