Weeder 2.7 released, with type class instances and more

Hello! @ocharles put me in charge of making this release :slight_smile:

Weeder 2.7.0 has just been released on Github and on Hackage. Weeder is a utility to find unused declarations over an entire Haskell project.

This release contains the vast majority of my work on Weeder for Summer of Haskell 2023 (Teaching Weeder About Type Class Instances). Apart from some non-critical edge cases on the level of HIE files, just implementing support for uses of type class instances turned out to be relatively straightforward. There was therefore a lot of extra time left for implementing additional features, such as support for unused types and parallelism.

The full list of user-facing changes in this release is as follows:

Added

  • Weeder now supports type class instances. Type class instances can be marked as roots with the root-instances configuration option.
  • Weeder now optionally detects uses of types, excluding type family instances. This can be enabled with the unused-types configuration option.
  • Weeder’s analysis now runs in parallel. This can almost halve execution time when given enough cores. Enabled by calling Weeder with -j X or -N.
  • --write-default-config flag to write and read a default configuration, if no configuration file is found.

Changed

  • All configuration options now have default values. This can be disabled with the --no-default-fields flag.
  • Weeder will now use distinct exit codes for certain failures. See README.md for more details.

Happy weeding!

19 Likes

I would just like to take a moment to publically thank @ryndubei for all of their hardwork. It’s been an absolute pleasure working together, and I can’t believe how much we’ve achieved over the last few months. Vasily hit the ground running from the start, contributing a PR that improved the asymptotic performance of weeder before we even started SoH, and continued by adding a test suite and then getting straight to work on detecting unused type class instances. Remarkably he had the majority of this ready in just a few weeks (along with identifying some unexpected edge cases and starting work on a GHC MR to fix this going forward). As mentioned, this gave us a bunch of free time to consider more improvements, culminating in dramatic performance improvements (due to increased concurrency and parallelism), along with the ability to detect unused data types. These are major features, and Vasily still managed to get various errands done, such as improving the README, tweaking our configuration format to accomodate the most users, and finally getting familiar with the release process. I think this SoH project has been a huge success, and I hope everyone enjoys all the hard work that’s gone into this over the last few months.

Thanks Vasily, and I hope we get a chance to work together again in the future!

16 Likes

SoH = summer of haskell I suppose.