lawbreakers in Text.PrettyPrint.HughesPJ

Conal Elliott conal at conal.net
Thu Nov 24 12:28:04 EST 2005


Or the combinators (<>, $$, etc) might take care to build their results
in reduced form, which seems to be the strategy that "nest" takes.

BTW, there's an invariant comment (about Doc, I think) that says "An
empty document is always represented by @Empty at ."  If the combinators
aren't going to ensure that's true, then probably the comment should be
removed or fixed.

- Conal

-----Original Message-----
From: Christian Maeder [mailto:maeder at tzi.de] 
Sent: Thursday, November 24, 2005 8:56 AM
To: Conal Elliott
Cc: libraries at haskell.org
Subject: Re: lawbreakers in Text.PrettyPrint.HughesPJ

Conal Elliott wrote:
>> Can you construct an example [...]
> 
>     Prelude Text.PrettyPrint> isEmpty (empty<>empty)
>     False

Indeed, isEmpty seems to be the problem that needs a fix:

   isEmpty d     = case reduceDoc d of
                 Empty -> True
                 _ -> False

Christian



More information about the Libraries mailing list