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

bug fix. add a space in promoted list/tuple of some promoted type #423

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pierric
Copy link

@pierric pierric commented Dec 15, 2018

Here is a bug. It happens when pretty print a promoted list or tuple of promoted type. For example:

Prelude Language.Haskell.Exts Language.Haskell.Exts.Syntax Language.Haskell.Exts.Pretty> a = TyPromoted () (PromotedList () True [TyPromoted () (PromotedTuple () [])])
Prelude Language.Haskell.Exts Language.Haskell.Exts.Syntax Language.Haskell.Exts.Pretty> prettyPrint a
"'['()]"

However GHC (8.4.4) does not accept '['()]

A.hs:4:10: error: parse error on input ‘'’
  |
4 | type X = '['()]
  |          ^

So I add one space after the bracket when pretty print. The above example will become "'[ '()]", which makes GHC very happy.

@pierric
Copy link
Author

pierric commented May 1, 2019

any idea about this PR?

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.

1 participant