GHC: Ticket #2106: parts of Language.Haskell.TH.Ppr in wrong package?
http://ghc.haskell.org/trac/ghc/ticket/2106
<p>
Hello, should the following functions (and possibly others) from 'template' be in the 'pretty' package instead?
</p>
<pre class="wiki">pprint :: Ppr a => a -> String
pprint x = render $ to_HPJ_Doc $ ppr x
class Ppr a where
ppr :: a -> Doc
ppr_list :: [a] -> Doc
ppr_list = vcat . map ppr
instance Ppr a => Ppr [a] where
ppr x = ppr_list x
</pre><p>
I guess they can't be moved exactly as they are because the Doc type is different between the packages, however, I was looking for a class of "pretty-printable" values and it is strange that the only such class seems to be Ppr in the 'template' package...
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/2106
Trac 1.0.1iglooFri, 14 Mar 2008 02:26:30 GMTstatus changed; difficulty, resolution set
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:1
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>difficulty</strong>
set to <em>Unknown</em>
</li>
<li><strong>resolution</strong>
set to <em>wontfix</em>
</li>
</ul>
<p>
Hi Frederik,
</p>
<p>
If you'd like to propose an addition to the pretty library, then can you please make a proposal as described in the library submissions policy?:
<a class="ext-link" href="http://www.haskell.org/haskellwiki/Library_submissions"><span class="icon"></span>http://www.haskell.org/haskellwiki/Library_submissions</a>
</p>
<p>
Thanks!
</p>
TicketFrederikFri, 14 Mar 2008 07:24:00 GMT
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:2
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:2
<p>
Hi Igloo,
</p>
<p>
I don't have time to fix the bug, I was under the impression that submitting it might be helpful, sorry if it is too minor... Here is what I have for personal use, if that is worth anything:
</p>
<pre class="wiki">module Fu.PrettyPrint (Pretty(..), pshow, ppr, ppr_) where
import Text.PrettyPrint
class Pretty a where
toDoc :: a -> Doc
myStyle = Style {mode=PageMode,lineLength=100,ribbonsPerLine=0.1}
pshow :: Pretty a => a -> String
pshow x = renderStyle myStyle $ toDoc x
ppr :: Pretty a => a -> IO ()
ppr x = putStrLn $ renderStyle myStyle $ toDoc x
</pre>
TicketFrederikFri, 14 Mar 2008 07:25:01 GMT
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:3
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:3
<p>
(without the ", ppr_" in the first line, sorry)
</p>
TicketsimonmarTue, 30 Sep 2008 15:40:31 GMTarchitecture changed
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:4
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:4
<ul>
<li><strong>architecture</strong>
changed from <em>Unknown</em> to <em>Unknown/Multiple</em>
</li>
</ul>
TicketsimonmarTue, 30 Sep 2008 15:51:42 GMTos changed
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:5
http://ghc.haskell.org/trac/ghc/ticket/2106#comment:5
<ul>
<li><strong>os</strong>
changed from <em>Unknown</em> to <em>Unknown/Multiple</em>
</li>
</ul>
Ticket