abount template haskell's pretty print: ($$$) x y = ...

Richard Eisenberg eir at cis.upenn.edu
Tue Aug 27 15:01:49 CEST 2013


Hello Yoshikuni,

Thanks for submitting a patch!

The best way to get your patch accepted is to use the GHC Trac system accessible here: http://ghc.haskell.org/trac/ghc/wiki/ReportABug

Create a bug report for the problem that you have, and then post your patch to it. The Trac system makes it much easier to track improvements to GHC than email.

Thanks,
Richard

On Aug 26, 2013, at 8:27 PM, PAF01143 at nifty.ne.jp wrote:

> Hello. I'm Yoshikuni Jujo.
> I want to correct ppr_dec of Language.Haskell.TH.Ppr.
> 
> Now:
> 
> ppr $ FunD (mkName "$$") [Clause [] (NormalB $ VarE $ mkName "x") []]
> 	=> $$ = x
> 
> but I want:
> 
> ppr $ FunD (mkName "$$") [Clause [] (NormalB $ VarE $ mkName "x") []]
> 	=> ($$) = x
> 
> I'll send patch.
> 
> --
> 
> module Language.Haskell.TH.Ppr
> 
> ...
> 
> isOp :: String -> Bool
> isOp = all (`elem` "!#$%&*+./<=>?@\\^|-~:")
> 
> ppr_dec _ (FunD f cs)
> 	| isOp $ nameBase f = vcat $ map (\c -> parens (ppr f) <+> ppr c) cs
> 	| otherwise = vcat ...
> ...
> ppr_dec _ (SigD f t)
> 	| isOp $ nameBase f = parens (ppr f) <+> text "::" <+> ppr t
> 	| otherwise = ppr f ...
> <thPprFunDOp.patch>_______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs





More information about the ghc-devs mailing list