I've been trying to get my head around the Wadler-Leijen pretty
printing combinators for a while now and having some trouble.
Specifically, I have trouble getting them to pick optimal line breaks.
The existing combinators like 'sep' (and everything built from it)
merge all elements with <$> and t
A quick suggestion - does setting the ribbon_frac to something like
0.8 improve things?
The Show instance for wl-pprint's Doc uses 0.4 which I've found too low.
This means you'll have to write your own display function using
`renderPretty`...
___
Haske
On 20 March 2012 20:24, Stephen Tetley wrote:
> A quick suggestion - does setting the ribbon_frac to something like
> 0.8 improve things?
>
> The Show instance for wl-pprint's Doc uses 0.4 which I've found too low.
>
> This means you'll have to write your own display function using
> `renderPretty
Hi Ivan
I haven't found any bugs in WL, however I do find the API somewhat
confusing regarding line breaking (I would need to consult the manual
to tell you the difference between linebreak, softline etc.). This is
likely my failing rather than WL as usually I want formatting - "I
know the layout"
Ahem - there was a severe typo in my last message. Usually I wouldn't
spam the list to repair my failings but edit distance on the error in
that message was so large it made no sense at all.
> printing that cannot be undone by `group`, or the combinators that use
> group are given more long-winde
On Tue, Mar 20, 2012 at 2:24 AM, Stephen Tetley
wrote:
> A quick suggestion - does setting the ribbon_frac to something like
> 0.8 improve things?
Nope. The ribbon (IMO both an undescriptive name and underdocumented)
only constraints the number of non-indent characters per line. So it
makes the
On Tue, Mar 20, 2012 at 6:52 AM, Stephen Tetley
wrote:
> Hi Ivan
>
> I haven't found any bugs in WL, however I do find the API somewhat
> confusing regarding line breaking (I would need to consult the manual
> to tell you the difference between linebreak, softline etc.). This is
> likely my failin