
Richard is spot on.
Meanwhile, do open a ticket on this. Maybe someone else will jump in to help.
Do give a step-by-step way to reproduce the problem.
Simon
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of
| Richard Eisenberg
| Sent: 09 May 2014 05:25
| To: George Roldugin
| Cc: ghc-devs@haskell.org
| Subject: Re: GHC not parsing TH pretty printed code
|
| Well, the problem isn't quite that the semicolon is expected before the
| second line -- it's that the semicolon is interpreted as separating let-
| definitions, not do-statements.
|
| For example, the following works:
|
| bar = do {let {x = 5};
| return x}
|
| Looking quickly through the TH's pretty-printer code, there seem to be
| several places where problems like this might arise, due to lack of
| braces or too many of them.
|
| What to do? If you're blocked by this issue, just edit the pretty-
| printer code. The code is actually quite straightforward. Get the
| sources
| (https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources),
| prep your machine
| (https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation), and build.
| Given that TH has changed since the 7.8 release, I recommend saying
| `sync-all checkout ghc-7.8` to get the 7.8 branch before building.
|
| After building, do some sanity checks to make sure your hand-built GHC
| is working.
|
| Then, just edit libraries/template-haskell/Language/Haskell/TH/Ppr.hs
| until things work. In particular, I bet adding a call to `braces` on
| line 150 will go a long way here.
|
| Even if we fixed the bug you reported, that bugfix would be in HEAD,
| where TH is different than in 7.8. It's possible it would be merged for
| 7.8.3, but my guess is that you don't want to wait that long.
|
| I hope this helps!
| Richard
|
| On May 9, 2014, at 12:08 AM, George Roldugin