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

AST parse generating wrong code #141

Open
Chaitanya-nair opened this issue Apr 12, 2023 · 3 comments
Open

AST parse generating wrong code #141

Chaitanya-nair opened this issue Apr 12, 2023 · 3 comments

Comments

@Chaitanya-nair
Copy link

Hi, with normal stack build, the plugin works good
But, when i do a parseModule, typeCheck and load the module with ghc, the generated code looks like this
uncons = \case [] -> Nothing a : b -> Just (Data.Record.Anon.Simple.applyPending Data.Record.Anon.Simple.insert #head a Data.Record.Anon.Simple.insert #tail b Data.Record.Anon.Simple.empty)

whereas , it should be this
uncons = \case [] -> Nothing a : b -> Just (Data.Record.Anon.Simple.applyPending $ Data.Record.Anon.Simple.insert #head a $ Data.Record.Anon.Simple.insert #tail b Data.Record.Anon.Simple.empty)

@edsko
Copy link
Collaborator

edsko commented Apr 12, 2023

Looks like it's just the pretty-printer omitting some brackets?

@edsko
Copy link
Collaborator

edsko commented Apr 12, 2023

If you need the pretty-printed output to be parseable, then it's quite possible the plugin would need to be modified to insert some HsPar nodes in various places.

@Chaitanya-nair
Copy link
Author

okay, will check this

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