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)
commit7f7c9edda28a1f4e7c90f3c34998e3b0dda968db
treef14f6102faa9d0bdad0e8bfcd0b8b7e364cff187
parent935a043abcfccace613d808eca546cadf5caa321
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.
libraries/template-haskell/Language/Haskell/TH/Ppr.hs