Improve pretty printing for Template Haskell operators

Fixes Trac #8187, #8188.

Thanks to Yoshikuni Jujo for pointing this out and doing the first draft.