haskell / pretty

Haskell Pretty-printer library
Other
69 stars 30 forks source link

`fsep` and `fcat` are confusing as well. Does anyone know what "Paragraph fill" mean in this context? #60

Open jwaldmann opened 2 years ago

jwaldmann commented 2 years ago

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

jwaldmann commented 2 years ago

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

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.