RE: Ppr instance for Dec.

"Simon Peyton-Jones" <[email protected]> Mon, 4 Apr 2005 11:23:35 +0100
Newsgroups gmane.comp.lang.haskell.template
Message-ID <036EAC76E7F5EC4996A3B3C3657D41160212D95F@EUR-MSG-21.europe.corp.microsoft.com>
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: [email protected]
[mailto:[email protected]] On
| Behalf Of Lemmih
| Sent: 01 April 2005 14:19
| To: [email protected]
| 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
| [email protected]
| http://www.haskell.org/mailman/listinfo/template-haskell