muesli4 / table-layout

Layout data in grids and pretty tables. Provides a lot of tools to get the cell formatting right (positional alignment, alignment on specific characters and limiting of cell width)..
BSD 3-Clause "New" or "Revised" License
37 stars 11 forks source link

Introduce functions for handling Formatted text #42

Closed Xitian9 closed 1 year ago

Xitian9 commented 1 year ago

This introduces reformat, which allows changing the formatting directives. It also introduces cataFormatted, the catamorphism for Formatted, which allows fully general transformations.

Xitian9 commented 1 year ago

I'm open to feedback on the naming and argument order for cataFormatted. I considered foldFormatted, but thought that would be confusing since it's already an instance of Foldable. The argument order was chosen based on what seemed most intuitive to me, but I'm open to rearranging if you think something else is better.