Hi,

Can anyone give a good explanation of what ribbonsPerLine means?

Maybe it would be better to simply ask for the meaning of ribbon in
this context. The documentation is totally meaningless to me:
"reibbonsPerLine: Ratio of ribbon length to line length".

I asked at #haskell and frankly, I was surprised by the answer:

fons: can anyone tell me what the heck does ribbonsPerLine mean in
Text.PrettyPrint.HughesPJ?
fons: > renderStyle style{lineLength=10, ribbonsPerLine=1} $ sep [text
"foo" ,text "bar"]
lambdabot:  "foo bar"
fons: > renderStyle style{lineLength=10, ribbonsPerLine=2} $ sep [text
"foo" ,text "bar"]
lambdabot:  "foo\nbar"
fons: ok, somehow it affects the line width ...
byorgey: fons: I can't explain it, all I know is that you must set it
to 1 or else it does bizarre things
fons: hahah, ok
fons: byorgey: that's funny considering its default value is 1.5
byorgey: if you set it to 1 then lineLength means what you think it should
byorgey: fons: EXACTLY

Cheers,

Fons
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to