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

Example code is broken #251

Open
BatiDyDx opened this issue Mar 5, 2024 · 3 comments
Open

Example code is broken #251

BatiDyDx opened this issue Mar 5, 2024 · 3 comments

Comments

@BatiDyDx
Copy link

BatiDyDx commented Mar 5, 2024

The example shown on the module main page, the prettyprintType function, is actually not type checking due to the String list of separators. It is rather expected a [Doc ann] type element.

@quchen
Copy link
Owner

quchen commented Apr 26, 2024

Did you enable OverloadedStrings? It’s what allows using String literals directly as Doc ann directly.

@georgefst
Copy link
Contributor

It might be nice if the example mentioned OverloadedStrings. Plus the imports needed: not just Prettyprinter, but also Prettyprinter.Util. These things won't be obvious to beginners.

Another thing I've just noticed, while adapting the example, is that the example only works in GHCI due to ExtendedDefaultRules, and thus doesn't work straight away when copied in to a source file.

@georgefst
Copy link
Contributor

It might be nice if the example mentioned OverloadedStrings. Plus the imports needed: not just Prettyprinter, but also Prettyprinter.Util. These things won't be obvious to beginners.

Ha, I'm not the first to say this: #209 (comment). Perhaps this issue should be closed in favour of that one.

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

3 participants