summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/lib/PrettyPrint/pp1.hs
blob: 55cfba9d274a5913d52ec7ffa58c601e0a55dfde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- 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.


module Main where

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