2011/8/25 Razvan Ranca <[email protected]>: > Hi David, > >> Most importantly though, is there a particular reason you used the GHC >> version of Pretty as opposed to the official version? >> >> >> http://hackage.haskell.org/packages/archive/pretty/1.1.0.0/doc/html/Text-PrettyPrint.html >> >> The proper package already includes the Style stuff you want and you >> are nesting your package under the same hierarchy as the Pretty >> package. More importantly I'm currently in the process of pulling the >> Pretty module out of GHC and having GHC use the Pretty package instead >> as its very ugly software engineering to have these two nearly >> identical modules. So in the next release of GHC I'm hoping to have >> GHC's Pretty module removed. >> >> Cheers, >> David > > I tried switching to the official version of Pretty, but I notice a > difference in the behaviour of "sep". > > The minimal definition of the difference would be something like this: > > test = [text "dddd", > nest 6 (text > "ppppppppppppppppppppppppppppppppppppppppppppppppppppp")] > > such that the string of "p"s is greater than the line length. > > Now, I get the following results > > Pretty.sep test: > dddd ppppppppppppppppppppppppppppppppppppppppppppppppppppp > > Text.PrettyPrint.HughesPJ.sep test: > dddd > ppppppppppppppppppppppppppppppppppppppppppppppppppppp > > This is a problem for me because it means an output that should be, say: > > Node (Node Leaf Leaf) > (Node (Node (Node Leaf > Leaf) > Leaf) > Leaf) > > now becomes instead: > > Node > (Node Leaf Leaf) > (Node > (Node > (Node > Leaf > Leaf) > Leaf) > Leaf) > > Is this intended behaviour? >
Hi Razvan, Yes I noticed this behaviour difference as well as I am trying to change GHC over to use the pretty module instead of its own copy and this difference caused a failure in a ghc testcase. I'm probably going to change to the ghc behaviour in the next release of pretty. It's hard to track down the reason for this difference. I've found the patch that makes the change and it seems to imply it's deliberate but the reasoning behind it isn't clear. I've sent the author of that patch an email so will hopefully have a better understanding. I'll keep you updated but I need GHC to follow the old behaviour as well so expect there to be some way in the next release of pretty to achieve this, just not sure what the best approach is yet. Cheers, David _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
