In the Template Haskell pretty printer, don't call error
authorSimon Peyton Jones <simonpj@microsoft.com>
Tue, 18 Sep 2012 10:48:05 +0000 (11:48 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 18 Sep 2012 10:48:05 +0000 (11:48 +0100)
commitd7b864b7ddb0e8c2f58d08dfd50e843eb8966b90
treec36e156f78629a98d06bd06bddf77b28e0382cf3
parenta97ca3a18b359c6a4331c0f57dcfaba3b0e58225
In the Template Haskell pretty printer, don't call error

There were two cases in which we called error
  * An InfixE with an operator epxression other than VarE or ConE
  * A comprehension with empty Stmts, ie CompE []

Crashing doesn't help much.  Now the library puts in the pretty
printed output a textual signal about what went wrong.

This addresses the crash in Trac #7235, although doesn't fix
the underlying cause, which remains shrouded in obscurity.
Language/Haskell/TH/Ppr.hs