[Template-haskell] Ppr instance for Dec.

Simon Peyton-Jones simonpj at microsoft.com
Mon Apr 4 06:23:35 EDT 2005


It looks to me as if the where clause should be indented in all
contexts.  So I've added the 'nest nestDepth' in the defn of
where_clause. 

Others feel free to make it look neater!

Simon

| -----Original Message-----
| From: template-haskell-bounces at haskell.org
[mailto:template-haskell-bounces at haskell.org] On
| Behalf Of Lemmih
| Sent: 01 April 2005 14:19
| To: template-haskell at haskell.org
| Subject: [Template-haskell] Ppr instance for Dec.
| 
| Greetings,
| 
| I noticed this code in Language.Haskell.TH.Ppr:
| 
| >    ppr (ClassD ctxt c xs fds ds) = text "class" <+> pprCxt ctxt
| >                                <+> ppr c <+> hsep (map ppr xs) <+>
ppr fds
| >                                 $$ where_clause ds
| >    ppr (InstanceD ctxt i ds) = text "instance" <+> pprCxt ctxt <+>
ppr i
| >                             $$ where_clause ds
| 
| shouldn't it be:
| 
| >    ppr (ClassD ctxt c xs fds ds) = text "class" <+> pprCxt ctxt
| >                                <+> ppr c <+> hsep (map ppr xs) <+>
ppr fds
| >                                 $$ nest nestDepth (where_clause ds)
| >    ppr (InstanceD ctxt i ds) = text "instance" <+> pprCxt ctxt <+>
ppr i
| >                             $$ nest nestDepth (where_clause ds)
| 
| --
| Friendly,
|   Lemmih
| _______________________________________________
| template-haskell mailing list
| template-haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/template-haskell


More information about the template-haskell mailing list