I use wl-pprint package, because the standard PrettyPrinter lacks functionality. All is good, except an empty doc in a vcat
function (the same thing with <$>
combinator).
Correct behavior:
import Text.PrettyPrint
> vcat[text "a", empty, text "b"]
a
b
wl-pprint shows an extra blank line:
import Text.PrettyPrint.Leijen
> vcat[text "a", empty, text "b"]
a
b
So what can I do? It is imposible to filter vcat list, because there is no Eq
instance for Doc
.
isEmpty
function, or somesuch thing. Contact the package author, and possibly send him a patch that will work for you. – Fayola