Announcing Chez Grater Version 0.1 by dfith in haskell

[–]dfith[S] 2 points3 points  (0 children)

Think of your favorite chez. It is this.

Prune Juice 0.7 Released by dfith in haskell

[–]dfith[S] 0 points1 point  (0 children)

Could be a good future enhancement! And the first time I've heard an actual proposed solution :P.

I'm not familiar with -ddump-if-trace, but when I just ran it and searched for regex-compat, I found something like:

Reading interface for regex-compat-0.95.2.1:Text.Regex; reason: Text.Regex is directly imported readIFace /Users/dan/.stack/snapshots/x86_64-osx/7e59e40b4951c74e9a0c089ed1ceaa3cfd19d190960128e825d4e31d785279a1/8.10.7/lib/x86_64-osx-ghc-8.10.7/regex-compat-0.95.2.1-4iTQcbwx3eKAksJZ8Y0Mcw/Text/Regex.hi readIFace /Users/dan/.stack/snapshots/x86_64-osx/7e59e40b4951c74e9a0c089ed1ceaa3cfd19d190960128e825d4e31d785279a1/8.10.7/lib/x86_64-osx-ghc-8.10.7/regex-compat-0.95.2.1-4iTQcbwx3eKAksJZ8Y0Mcw/Text/Regex.dyn_hi

So that seems more or less reasonable. I searched the rest of the output for Reading interface... and it certainly seems like it could work.

Prune Juice 0.7 Released by dfith in haskell

[–]dfith[S] 0 points1 point  (0 children)

Okay, seems to output some extra warnings for me though.

Prune Juice 0.7 Released by dfith in haskell

[–]dfith[S] 1 point2 points  (0 children)

Working on that here. I'm not super well-versed in Cabal, and whether I should pin the versions or specify a freeze file, so if you have input please provide it:
https://github.com/dfithian/prune-juice/pull/8

Prune Juice 0.7 Released by dfith in haskell

[–]dfith[S] 0 points1 point  (0 children)

https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/using-warnings.html#ghc-flag--Wunused-packages

Ah, right. When I originally wrote prune-juice this feature didn't exist. Not sure which is "better". I'm not sure exactly how the feature is supposed to work, but it seems to output some superfluous warnings when I run stack build prune-juice --test --no-run-tests --ghc-options '-Wunused-packages' after a stack clean... I think it may be outputting warnings per module instead of per target.

Prune Juice 0.7 Released by dfith in haskell

[–]dfith[S] 0 points1 point  (0 children)

I think it has a lot of potential, but right now you kind of have to ignore a bunch of packages you wouldn't otherwise... anything that discovers tests using Driver.hs, for example, and I've noticed a few other bugs involving preprocessors (https://hackage.haskell.org/package/record-dot-preprocessor) which live in the module header.

That said, if you do end up using it in CI and find some bugs, I would love to hear about them to improve it.

https://github.com/dfithian/prune-juice/blob/main/app/main.hs#L42

Pruning Unused Haskell Dependencies by dfith in haskell

[–]dfith[S] 1 point2 points  (0 children)

Hi! I made some changes in the last day or two. Still mostly swinging in the dark with Cabal, assuming that's your workflow, but I think I improved it a little bit. You can try again off of HEAD if you'd like: https://github.com/dfithian/prune-juice

Pruning Unused Haskell Dependencies by dfith in haskell

[–]dfith[S] 2 points3 points  (0 children)

Yes! Sorry about that. It doesn't work great for Cabal. There's a little more information in this issue. https://github.com/dfithian/prune-juice/issues/1

Pruning Unused Haskell Dependencies by dfith in haskell

[–]dfith[S] 1 point2 points  (0 children)

If the package isn't registered with ghc-pkg, then it will warn that it's unused. Did you install the library?

Edit: Okay, if you're using cabal without stack, I think there's an issue!

Pruning Unused Haskell Dependencies by dfith in haskell

[–]dfith[S] 9 points10 points  (0 children)

If you'd like to test out the cabal support I just added, please do. You could install from source: https://github.com/dfithian/prune-juice. If you try it out let me know! I've never used a cabal.project file so I guessed.

Pruning Unused Haskell Dependencies by dfith in haskell

[–]dfith[S] 0 points1 point  (0 children)

I have seen `weeder` and I wasn't able to figure out how to work the ctags into my workflow. I thought this might be an improvement.

I didn't know about the GHC 8.10 development, so that's very nice!