pretty
pretty copied to clipboard
`fsep` and `fcat` are confusing as well. Does anyone know what "Paragraph fill" mean in this context?
fsep and fcat are confusing as well. Does anyone know what "Paragraph fill" mean in this context?
"Paragraph fill" version of sep.
"Paragraph fill" version of cat.
Originally posted by @banacorn in https://github.com/haskell/pretty/issues/48#issuecomment-793432598
I agree this is under-documented. There is no mention of "paragraph fill" in the original paper? http://belle.sourceforge.net/doc/hughes95design.pdf
From experimentation, the semantics of fcat/fsep seems to be
- if each element is one-line: fill up current line (with
hcatorhsep) until ribbon width, then insert line break and repeat - else,
vcat
There's a specification in the code https://hackage.haskell.org/package/pretty-1.1.3.6/docs/src/Text.PrettyPrint.Annotated.HughesPJ.html#fsep
Perhaps something (from that spec, or from my comment here) could be lifted to API doc.