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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

PAF01143@nifty.ne.jp
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 ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: thPprFunDOp.patch
Type: text/x-diff
Size: 1261 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130827/16d523b2/attachment.patch>

Reply | Threaded
Open this post in threaded view
|

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

Richard Eisenberg-2
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