-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Wadler's original paper includes support for a "ribbon" width, which is additional width given to the document to allow extra space for indented lines. For example, with a width: 40 for the document, and a tab size of 4 spaces, then a function which is indented 5 levels (20 spaces) will have only 20 remaining characters of width to play with.
https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf
The point of the ribbon is to give additional spacing to lines proportional to their indentation level; with a ribbon fraction of 0.5, for example, the 20-space-indented function line can have up to a width: 50 (40 + (0.5 * 20)).
I'd like to make use of this in a code formatter I'm writing, but alas haven't seen where I could hook into widths on a line-by-line basis. Is ribbon support something you are interested in providing as part of the library?