-
Notifications
You must be signed in to change notification settings - Fork 7
Description
I've encountered an issue with sandwich when it attempts to process code that contains the ImportQualifiedPost syntax (e.g., import Data.List qualified as L). This causes parse errors because the underlying haskell-src-exts library doesn't support this GHC extension.
Workarounds
I've tried two approaches:
-
Replacing with ghc-lib-parser: I attempted to swap out
haskell-src-extswithghc-lib-parser, but this proved to be quite challenging due to significant API differences and integration complexities. -
Patching haskell-src-exts: I've submitted a PR to add
ImportQualifiedPostsupport tohaskell-src-exts. The fix was relatively simple to implement (added the extension and modified the parser to support the syntax). While there's no guarantee it will be accepted given the maintenance status, it might provide a temporary solution.
Discussion
I'd like to discuss options for moving forward:
- Should sandwich consider migrating away from
haskell-src-extstoghc-lib-parserin the long term? - If my PR is accepted, would you consider updating the dependency in sandwich?
- Are there any other workarounds you'd recommend in the meantime?
For context, the reason I'm using ImportQualifiedPost syntax is that it's part of the formatting standards enforced by fourmolu in my project.