pcapriotti / optparse-applicative

Applicative option parser
BSD 3-Clause "New" or "Revised" License
910 stars 116 forks source link

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

Closed andreasabel closed 1 year ago

andreasabel commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

Here are some resources of interest:

HuwCampbell commented 1 year ago

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