Opened 7 years ago

Last modified 2 years ago

#1062 new bug

Bad output from Text.PrettyPrint.HughesPJ

Reported by: igloo Owned by:
Priority: normal Milestone:
Component: libraries/pretty Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: pp1 Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

This program:

import Text.PrettyPrint.HughesPJ

ncat x y = nest 4 $ cat [ x, y ]

d1 = foldl1 ncat $ take 50 $ repeat $ char 'a'
d2 = parens $  sep [ d1, text "+" , d1 ]

main = print d2

generates the output below. I haven't worked out what is expected, but this certainly doesn't look right to me (in particular, the space before the a on the third line of the output).

% runghc pp1.hs | tr ' ' _
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+___________________________________________________________________________________________________________________________________________________________________________________________________a
_a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a
a)

The pp1 test goes on to say:

This code used to print an infinite string, by calling 'spaces'
with a negative argument.  There's a patch in the library now,
which makes 'spaces' do somehthing sensible when called with a negative
argument, but it really should not happen at all.

This output is not what is expected, becuase the
test "works" now, by virtue of a hack in HughesPJ.spaces.
I'm leaving this strange output here to remind us to look
at the root cause of the problem.  Sometime.

Change History (6)

comment:1 Changed 7 years ago by igloo

  • Description modified (diff)

comment:2 Changed 7 years ago by thorkilnaur

  • Owner set to thorkilnaur

comment:3 Changed 7 years ago by thorkilnaur

  • Resolution set to duplicate
  • Status changed from new to closed

This is actually a duplicate of #669.

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:6 Changed 2 years ago by igloo

  • Component changed from libraries/base to libraries/pretty
  • Owner thorkilnaur deleted
  • Resolution duplicate deleted
  • Status changed from closed to new
  • Type of failure set to None/Unknown

Reopening, as this ticket is for the bad output of the pp1 test.

Note: See TracTickets for help on using tickets.