jyp / prettiest

The Prettiest Printer
GNU General Public License v3.0
35 stars 6 forks source link

Known nat width #5

Closed phadej closed 7 years ago

phadej commented 7 years ago

Builds on my other PR. The drawback of this approach is that pretty-compact would work only with GHC>=7.8.

Another option is to change newtype Doc a = MkDoc (Reader Int [(M a, L a)]).

phadej commented 7 years ago

I'll check the Reader approach too when the #4 is merged. It's easier to check the performance affects when we have some benchmarks in place.

jyp commented 7 years ago

I'm wondering if using a "KnownNat" isn't overkill. We could be using a simple parameter to the render function, like every pretty printing library does.

phadej commented 7 years ago

I'll do a parameter version shortly.

phadej commented 7 years ago

@jyp check my other PR #6