Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettyprinter has very long module names #110

Closed
sjakobi opened this issue Jan 19, 2020 · 5 comments
Closed

prettyprinter has very long module names #110

sjakobi opened this issue Jan 19, 2020 · 5 comments

Comments

@sjakobi
Copy link
Collaborator

sjakobi commented Jan 19, 2020

I remember being frustrated by the long module names when working on dhall, especially when I had to reformat qualified imports after adding an import like

import qualified Data.Text.Prettyprint.Doc.Render.Terminal as Pretty

The basic idea would be to replace the Data.Text.Prettyprint.Doc prefix with just Prettyprinter.

The change would probably happen in multiple phases:

  1. Move all the code into the corresponding shorter Prettyprinter modules, but re-export everything from the old modules.
  2. Wait a few versions in case there are any problems.
  3. Deprecate the old modules.
  4. Remove the old modules after waiting a bit longer.

Thoughts?

@sjakobi
Copy link
Collaborator Author

sjakobi commented May 22, 2020

I still like this idea. @quchen, what do you think?

@quchen
Copy link
Owner

quchen commented Jun 17, 2020

I totally agree the module names are too long. This was brought up to me shortly after the initial release of the library already, but I did not think it was a good time to do something about it. If there is a non-breaking way to go about this, go ahead! I would hate to have maintainers to have to hack around this using lots of #ifdefs just to save some import code – the maintenance effort for others should really be minimal. But given a long enough transitional period and deprecated reexports, I don’t see why not.

sjakobi added a commit that referenced this issue Jun 30, 2020
sjakobi added a commit that referenced this issue Jun 30, 2020
sjakobi added a commit that referenced this issue Jun 30, 2020
sjakobi added a commit that referenced this issue Jul 11, 2020
This removes -Werror from CI, since the import of
Prettyprinter.Render.Tutorials.StackMachineTutorial
results in a deprecation warning that turned out to
be very tricky to disable.

Context: #110.
@sjakobi
Copy link
Collaborator Author

sjakobi commented Jul 31, 2020

This is the deprecation plan that I have included in the changelog for v1.7.0 and the associated releases for pp-ansi-terminal and pp-convert-ansi-wl-pprint:

  • Start deprecation in early 2021.
  • Remove the modules after a deprecation period of at least one year.

@sjakobi
Copy link
Collaborator Author

sjakobi commented Aug 3, 2020

@istathar has a nice recommendation for de-cluttering the module overview, that we should consider using when we properly deprecate the old module hierarchy.

If you use

{-# OPTIONS_HADDOCK hide #-}
in a module header alongside the language pragmas it'll suppress that module from appearing in generated Haddock output. I use it to hide internal modules without making it impossible to access them. Works really well for deprecated modules, too.

@quchen
Copy link
Owner

quchen commented Dec 3, 2021

Resolved in #203

@quchen quchen closed this as completed Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants