-
-
Notifications
You must be signed in to change notification settings - Fork 8
Some infelicities #69
Comments
Hi @jrp2014, thanks for using our package and providing your feedback! We appreciate you find it useful 😊 I'm going to provide comment for each of your concerns separately:
|
Hi, I've had a go at rewriting smuggler https://github.com/jrp2014/smuggler using the approach that I mentioned in another exchange, namely getting ghc to do the hard work and grafting back the result. It runs on ghcs 8.10.1, 8.8.3 and 8.6.5 (and perhaps earlier, but I haven't tested). The results for the tests are different for 8.6.5 because newer versions of ghc do not need to import The limitations of the approach are that it doesn't preserve comments or extra newlines (eg, to separate project from library imports. It may be possible to try to do a bit better, but it will be hard to do so robustly. Since it relies on ghc, I'm fairly confident that it largely works, but it needs more testing and I'd be grateful for any other thoughts you might have. The trickiest part for me was figuring out how best to use exactPrint and I suspect that some of the less used IE constructors are not handled (mainly because I haven't had time to find examples and discover what the correct annotations should be). Anyway, thanks for providing the basic infrastructure to get me going. |
This is just the plugin I was looking for, and I have been giving it a whirl.
I used ghc 8.8.3 (by adjusting the cabal bounds).
This doesn't compile, so I also have to
Perhaps the answer is to use
ghc-lib
.The tests now don't pass
I tried running the plugin on a large project with a lot of redundant imports,
https://github.com/agda/agda
. There were several issues:smuggler
reads files usingByteString
it mangles Unicode characters in the code. Eg:import
keyword missing). I am not sure how close the result is to the minimal imports that GHC sees with-ddump-minimal-imports
Monad.Fail
andData.Monoid
andData.Semigroup
.To make this app even more useful, it would be helpful to have it generate a minimal exports list (based on what is used elsewhere in the project)!
Thanks for all the hard work that has clearly gone into all this.
The text was updated successfully, but these errors were encountered: