-
Notifications
You must be signed in to change notification settings - Fork 32
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 ghc-lib for GHC >= 8.8 #103
Conversation
Ping @xich, @lspitzner , @rayshih any comments? |
I have reservations about this approach, primarily because I want to be able to use ghc-exactprint to drive refactorings based on compiler analysis of names, types, and so on. As I understand it, using ghc-lib removes this, as it only does parsing. |
ghc-lib provides for phases up-to and including generation of core so that includes renaming & type-checking. |
@shayne-fletcher Can you elaborate on this limitation in the README?
I think this is the limitation that scares me. I want to be able to rename a module and get all the exact |
ah, ok. yes, i see what you mean. sadly, i think this is where we're we hit the limits of what is possible with ghc-lib 😞 . |
So there's no non-painful way to use ghc-lib to rename/typecheck a module that imports anything third-party, even Something worth considering is that not supporting ghc-lib makes depending on ghc-exactprint or its downstream packages (e.g. apply-refact) as libraries less convenient (e.g., this comment). So instead of adding more features, I'd suggest considering the option of putting new features in a separate package or even reducing features. For example, if we remove CPP support from ghc-exactprint, we would no longer need to call |
I would be happy to accept a PR splitting ghc-exactprint into pieces, if it enables a simpler reuse/installation story. |
Sounds good! Another issue with this approach is that it lets ghc-lib read the package database of a potentially different ghc version (since |
#93
GHC 9.0: supporting both ghc and ghc-lib
GHC 8.8, 8.10: supporting ghc-lib only
GHC <= 8.6: supporting ghc only
Removed
src-ghc88
andsrc-ghc810
.src-ghc90
is renamed tosrc-ghc88-810-90
.tests/examples/pre-ghc90
andtests/examples/pre-ghc810
are combined intotests/examples/pre-ghc88
.The compat code in
Utils.hs
used to implementghcWrapper
is borrowed (with modification) from here, originally written by @arybczak. Thanks @shayne-fletcher for the pointer.