Pretty Printing Libraray Question

Simon Peyton-Jones simonpj@microsoft.com
Mon, 15 Jul 2002 08:56:25 +0100


I'm afraid the transformation from 8-spaces to tab is hard
wired into the library.  You can get the source and recompile
it, but there's nothing you can do from 'outside'.

It should probably be part of the rendering options.

Simon

| -----Original Message-----
| From: Jens Petersen [mailto:juhp@01.246.ne.jp]=20
| Sent: 15 July 2002 04:33
| To: Yu Di
| Cc: libraries@haskell.org
| Subject: Re: Pretty Printing Libraray Question
|=20
|=20
| Yu Di <diyu60607@yahoo.com> writes:
|=20
| > Hi, I am using the ghc-5.04 module
| > Text.Pretty.HughesPJ (originally "Pretty" in the
| > "text" package) to do some formatting. It works great,
| > but has one small problem: the output always uses tab
| > for 8 spaces. For example:
| >=20
| > d =3D text "abc" $+$ nest 8 (text "bcd") $+$ text "cde"
| > s =3D render d
| >=20
| > will have a tab before "bcd", not 8 spaces. I have
| > tested this on both Solaris 2.8 and Linux.
| >=20
| > Is there a way to change this behavior and make it use
| > spaces always? I looked at the code but cannot find
| > related information.
|=20
| Btw what's wrong with the tab?  I guess you can always
| convert the tabs ('\t') to spaces after pretty printting...
|=20
| The tab seems to come from:
|=20
| indent n | n >=3D 8 =3D '\t' : indent (n - 8)
|          | otherwise      =3D spaces n
|=20
| Hth, Jens
| _______________________________________________
| Libraries mailing list
| Libraries@haskell.org=20
| http://www.haskell.org/mailman/listinfo/libraries
|=20