Text.PrettyPrint.HughesPJ fixities

Simon Peyton-Jones simonpj at microsoft.com
Fri Mar 5 09:26:37 EST 2004


To be honest I have totally paged that code out.  I cvs log doesn't show
the "massive perf bug" entry for either of the modules we specify,
though I do vaguely remember something.

My memory is that it shouldn't matter which way round you associate <>
and <+>, but I could well be wrong about that.

If anyone wants to dive in, please go ahead!  (I don't think I'm likely
to.)

I do have somewhere a half-written paper about the internals of the
HughesPJ library.  Adding the 'empty' document and <+> were entirely
non-trivial, and made my head hurt badly.  Alas, I never finished the
paper, but I'll hunt if someone wants it.

Simon

| -----Original Message-----
| From: libraries-bounces at haskell.org
[mailto:libraries-bounces at haskell.org] On Behalf Of Ian Lynagh
| Sent: 04 March 2004 00:46
| To: libraries at haskell.org
| Subject: Text.PrettyPrint.HughesPJ fixities
| 
| 
| Hi,
| 
| Text.PrettyPrint.HughesPJ (the same applies to
| ghc/compiler/utils/Pretty.lhs) contains
| 
| infixl 6 <>
| infixl 6 <+>
| infixl 5 $$, $+$
| 
| whereas my intuition says that infixr will give more efficient
| implementation. Is my intuition wrong? It seems to be supported by the
| definitions of hcat, hsep, vcat being defined in terms of foldr.
| 
| 
| We on #haskell are also confused by the changelog entry starting
| "Cured massive performance bug." and ending
| "I'm not satisfied that I've done the best possible job.  I'll send
you
|  the code if you are interested.".
| It looks to me like the change was made and the original mail about
the
| problem appended without being reread?
| 
| 
| Thanks
| Ian
| 
| _______________________________________________
| Libraries mailing list
| Libraries at haskell.org
| http://www.haskell.org/mailman/listinfo/libraries


More information about the Libraries mailing list