[commit: ghc] master: Print infix type constructors in back-ticks (79dae93)

Simon Peyton Jones simonpj at microsoft.com
Tue Jan 29 13:50:21 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/79dae93f36301e1f0ee796d5c9f7967b588cb601

>---------------------------------------------------------------

commit 79dae93f36301e1f0ee796d5c9f7967b588cb601
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Jan 24 13:49:32 2013 +0000

    Print infix type constructors in back-ticks
    
    Fixes Trac #7609

>---------------------------------------------------------------

 compiler/hsSyn/HsTypes.lhs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/hsSyn/HsTypes.lhs b/compiler/hsSyn/HsTypes.lhs
index 93d91b1..74aa477 100644
--- a/compiler/hsSyn/HsTypes.lhs
+++ b/compiler/hsSyn/HsTypes.lhs
@@ -652,9 +652,12 @@ ppr_mono_ty ctxt_prec (HsAppTy fun_ty arg_ty)
   = maybeParen ctxt_prec pREC_CON $
     hsep [ppr_mono_lty pREC_FUN fun_ty, ppr_mono_lty pREC_CON arg_ty]
 
-ppr_mono_ty ctxt_prec (HsOpTy ty1 (wrapper, op) ty2)
+ppr_mono_ty ctxt_prec (HsOpTy ty1 (_wrapper, L _ op) ty2)
   = maybeParen ctxt_prec pREC_OP $
-    ppr_mono_lty pREC_OP ty1 <+> ppr_mono_ty pREC_CON (HsWrapTy wrapper (HsTyVar (unLoc op))) <+> ppr_mono_lty pREC_OP ty2
+    sep [ ppr_mono_lty pREC_OP ty1
+        , sep [pprInfixOcc op, ppr_mono_lty pREC_OP ty2 ] ]
+    -- Don't print the wrapper (= kind applications)
+    -- c.f. HsWrapTy
 
 ppr_mono_ty _         (HsParTy ty)
   = parens (ppr_mono_lty pREC_TOP ty)





More information about the ghc-commits mailing list