quchen / prettyprinter

A modern, extensible and well-documented prettyprinter.
BSD 2-Clause "Simplified" License
293 stars 34 forks source link

Use `Color`, `Intensity` etc. from `ansi-terminal` #233

Open georgefst opened 2 years ago

georgefst commented 2 years ago

Is there any particular reason why prettyprinter-ansi-terminal redefines its own versions of these types, isomorphic to the ones upstream? I often find myself needing to resolve conflicting imports due to this, especially since the ones from this package are re-exported through pretty-simple.

georgefst commented 2 years ago

Ah, I've just seen this has previously been asked by @sjakobi (no response): https://github.com/quchen/prettyprinter/issues/121#issuecomment-577254902.

sjakobi commented 2 years ago

Is there any particular reason why prettyprinter-ansi-terminal redefines its own versions of these types, isomorphic to the ones upstream?

I speculated about this in https://github.com/quchen/prettyprinter/pull/224#issuecomment-1109810937:

I'm not sure, but I suspect that the local types exist so the internals can be changed with less compatibility hassle. Re-exports also bring their own versioning problems.

Maybe @quchen can comment on the original motivation.

georgefst commented 2 years ago

I'm not sure, but I suspect that the local types exist so the internals can be changed with less compatibility hassle. Re-exports also bring their own versioning problems.

I can't really see either of those having much bearing in practice, particularly given how unlikely the ANSI standard is to change any time soon.