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

Use default instances for separators #41

Closed muesli4 closed 1 year ago

muesli4 commented 1 year ago

I wrote this a while ago to lift the restriction on the separator type for fullH and titlesH.

muesli4 commented 1 year ago

@Xitian9 if you have any concerns, please let me know.

Do you by any chance remember why it is specialized to LineStyle? I remember there was something about type inference. But at the moment I cannot see why we need this. (And sorry if we discussed this already.)

Xitian9 commented 1 year ago

It was to avoid the compiler complaining if it can't fully infer the type of the separator. By specialising to LineStyle we guarantee that all old code will continue to work. With the new code, there are some instances in which one may need to supply a manual type declaration.

However, this probably doesn't occur much in practice, if at all, since the TableStyle used will almost always make the separator type concrete. I think this is fine.