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

Use prettyprinter-compat-ansi-wl-pprint as an implementation #32

Merged
merged 1 commit into from
May 18, 2023

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented May 16, 2023

Resolves #26, as with this patch you'll end up using prettyprinter.


Before:

Screenshot from 2023-05-16 18-01-29

After:

Screenshot from 2023-05-16 18-00-14

The green text is done with

    -- ...but going via a string will only preserve formatting information information on Unix
    putStr $ show $ green (text "I will be green on Unix but uncolored on Windows") <> linebreak

and that doesn't work with Prettyprinter's Doc (which doesn't use annotations in Show instance).

Otherwise compat shim seems to be quite complete, as none of imports needed to be removed.

This will finally make ansi-wl-pprint obsolete.

@phadej
Copy link
Collaborator Author

phadej commented May 16, 2023

@RyanGlScott, do you have an opinion on this?

Copy link

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@@ -1,7 +1,6 @@
cabal-version: >= 1.10
name: ansi-wl-pprint
version: 0.6.9
x-revision: 4
version: 1.0.2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pick version 1.0.2 instead of, say, 1.0.0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text/PrettyPrint/ANSI/Leijen.hs Show resolved Hide resolved
Changelog.md Outdated Show resolved Hide resolved
Changelog.md Outdated Show resolved Hide resolved
Changelog.md Outdated Show resolved Hide resolved
@phadej phadej force-pushed the prettyprinter branch 2 times, most recently from 315bab5 to 16e620b Compare May 17, 2023 06:08
Changelog.md Outdated Show resolved Hide resolved
@georgefst
Copy link

Note that there are other incompatibilities: quchen/prettyprinter#246. These ideally ought to have been mentioned in the release notes, but at least this package was given a major version bump when switching over.

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

Successfully merging this pull request may close these issues.

This package is deprecated. Use prettyprinter.
3 participants