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

v0.18: text no longer exported from Options.Applicative.Help.Pretty #481

Closed
andreasabel opened this issue Jun 9, 2023 · 4 comments
Closed

Comments

@andreasabel
Copy link
Contributor

andreasabel commented Jun 9, 2023

v0.18 broke two of my projects because text is no longer exported from Options.Applicative.Help.Pretty.
Here is one fix (the other is very similar): andreasabel/cabal-clean@9b433c0 (#4)

Was this anticipated? I would guess more packages will break because of that: https://hackage-search.serokell.io/?q=+Options.Applicative.Help.Pretty

If this was intended, maybe a migration guide would help.

@HuwCampbell
Copy link
Collaborator

It's a major version bump which changes the pretty printer library used. I don't think prettyprinter has that function.

I was aware it might cause breakages if people used Doc functions directly, which is why I was hesitant to make the change, but ansi-wl-pprint was fully deprecated and starting to have bounds issues.

The solution is to use 'pretty' instead. prettyprinter doesn't appear to export specific functions for lifting to Doc.

Hopefully the change will start yielding tangible benefits though, as we can start annotating the Doc and having opt in colouring.

I would also strongly suggest using 0.18.1, as the prettyprinter function used in 0.18.0 appears to have an unfortunate time complexity (which the equivalent in ansi-wl-pprint did not).

@andreasabel
Copy link
Contributor Author

@HuwCampbell :

I would also strongly suggest using 0.18.1, as the prettyprinter function used in 0.18.0 appears to have an unfortunate time complexity

You can make this suggestion more formal by deprecating 0.18.0.0 here: https://hackage.haskell.org/package/optparse-applicative/preferred/edit
This won't make 0.18.0.0 unusable, but cabal will only choose it when explicitly requested (afaik).

@andreasabel
Copy link
Contributor Author

If this was intended, maybe a migration guide would help.

Here are some resources of interest:

@HuwCampbell
Copy link
Collaborator

Not much to action on here. I'll close, but feel free to continue the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants