GHC not parsing TH pretty printed code

George Roldugin groldugin at cse.unsw.edu.au
Fri May 9 04:08:30 UTC 2014


Hi all,

I've hit a problem with GHC 7.8 where the code pretty printed by Template Haskell fails to parse.

The problem is with the placement of explicit semicolons in place of indentation.

The following code pretty printed by TH won't parse:

bar = do {let x = 5;
          return x}


GHC expects the following placement of semicolons:

bar = do {let x = 5
         ; return x}


I reported this bug and included sample TH code to reproduce the problem here:
https://ghc.haskell.org/trac/ghc/ticket/9022

I rely on compiling code constructed with TH for my thesis project.

Is there a work around I could use besides going back to GHC 7.6?

Cheers,
George 


More information about the ghc-devs mailing list