Text.PrettyPrint.HughesPJ bug (return of the dead?)

Simon Peyton-Jones simonpj@microsoft.com
Thu, 24 Jul 2003 08:51:06 +0100


Thanks.  I'm not sure I ever actually fixed it, because I wanted to fix
the "real" bug.
But I havn't gotten around to doing so, so I'm now compromising by
making 'spaces'
behave sensibly on a negative argument.

Nevertheless, 'spaces' should never be called with a negative argument,
so this "fix" is
a hack.  If anyone wants to find the Real Bug, I'd be happy.  Meanwhile,
at least it
no longer loops.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-admin@haskell.org
[mailto:glasgow-haskell-users-admin@haskell.org]
| On Behalf Of Johannes Waldmann
| Sent: 20 July 2003 14:06
| To: glasgow-haskell-users@haskell.org
| Subject: Text.PrettyPrint.HughesPJ bug (return of the dead?)
|=20
| There once was a bug in Text.PrettyPrint.HughesPJ
| causing it to print infinitely many spaces.
|
http://haskell.org/pipermail/glasgow-haskell-users/2001-November/002584.
html
|=20
| It seems this code has re-appeared in the ghc-6.0 libraries:
|=20
| > spaces 0 =3D ""
| > spaces n       =3D ' ' : spaces (n - 1)
|=20
| this should be  replicate n ' '  or something
| that behaves nicely for negative arguments.
| (that shouldn't of course be there in the first place
| but this seems harder to fix. somehow related to nesting, etc.)
|=20
| Best regards,
| --
| -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/
--
| -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/209
--
|=20
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users