Skip to content

Fix missing space in ppr_cmd for HsCmdArrForm

Vladislav Zavialov requested to merge wip/ppr-cmd-space into master

Compare the printing code for ArrForm in ppr_expr and ppr_cmd :

ppr_expr (HsArrForm _ op _ args)
  = hang (text "(|" <+> ppr_lexpr op)
         4 (sep (map (pprCmdArg.unLoc) args) <+> text "|)")
ppr_cmd (HsCmdArrForm _ op _ _ args)
  = hang (text "(|" <> ppr_lexpr op)
         4 (sep (map (pprCmdArg.unLoc) args) <> text "|)")

The use of <> instead of <+> results in suboptimal output, which I've noticed while replacing the uses of HsArrForm with HsCmdArrForm in the parser:

 arrowfail003.hs:9:7:
     Arrow command found where an expression was expected:
-      (| zeroArrow |)
+      (|zeroArrow |)

Merge request reports