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

Infix operators can cause "Ambiguous infix expression" errors #58

Open
jgrosso opened this issue Sep 17, 2019 · 1 comment
Open

Infix operators can cause "Ambiguous infix expression" errors #58

jgrosso opened this issue Sep 17, 2019 · 1 comment
Assignees
Labels
bug A bona fide implementation mistake. converter Anything related to the Haskell->Axel converter.

Comments

@jgrosso
Copy link
Collaborator

jgrosso commented Sep 17, 2019

Being fixed by #63.

We shouldn't directly use haskell-src-exts, since it has no way of determining fixities that haven't been hardwired in.

Maybe we should use hlint's Language.Haskell.HLint4.parseModuleEx (http://hackage.haskell.org/package/hlint-2.2.2/docs/Language-Haskell-HLint4.html#v:parseModuleEx). Note that HLint tries to use GHC's parser in parseModuleEx, rather than haskell-src-exts, although it sometimes falls back to HSE. However, piggybacking on that would definitely be better than our current strategy of only using HSE. Furthermore, HLint is actively migrating away from HSE (ndmitchell/hlint#645), so we can also benefit from those further improvements. HLint's usage of ghc-lib-parser also relies on hardwired fixities (https://raw.githubusercontent.com/ndmitchell/hlint/master/src/GHC/Util/Refact/Fixity.hs).

Is there a way to hook into GHC's parser (probably with the precondion that the file or project typechecks, which is a totally valid requirement to be able to convert a file)?

This issue is pretty high-priority, since the converter isn't very useful otherwise.

@jgrosso jgrosso added converter Anything related to the Haskell->Axel converter. bug A bona fide implementation mistake. labels Sep 17, 2019
@jgrosso jgrosso self-assigned this Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bona fide implementation mistake. converter Anything related to the Haskell->Axel converter.
Projects
None yet
Development

No branches or pull requests

1 participant