Weeder – perform whole-program dead-code analysis

Weeder is a command-line utility for Haskell that performs whole-program dead-code analysis.

It works with `.hie` files generated by GHC, builds a dependency graph of declarations, and traverses that graph from configurable roots to identify code that is no longer reachable. The tool is designed for real-world Haskell projects and can be used with Cabal, Stack, and Nix-based workflows to help developers locate and remove unused declarations across module boundaries.

This is free and open source software.

Key Features

  • Analyzes whole Haskell programs using GHC-generated `.hie` files.
  • Finds unreachable declarations across module boundaries, not just within a single module.
  • Uses a TOML configuration file with options such as `roots`, `root-instances`, `root-modules`, `type-class-roots`, and `unused-types`.
  • Can generate a default configuration automatically using the –write-default-config option.
  • Supports analysis of type class instances and optional detection of unused types.
  • Works with Cabal, Stack, and Nix-based development workflows.
  • Offers parallel analysis support and distinct exit codes for common success and failure cases.
  • Reports stale configuration entries, including roots, root-instances and root-modules patterns that no longer match declarations, instances or modules.

Website: github.com/ocharles/weeder
Support:
Developer: Ollie Charles
License: BSD 3-Clause “New” or “Revised” License

Weeder is written in Haskell. Learn Haskell with our recommended free books and free tutorials.


Related Software

Haskell Linters
OrmoluFormatter for Haskell source code
HLintSuggests improvements to Haskell code
FourmoluFormatter for Haskell source code, fork of Ormolu
LiquidHaskellRefinement type checker for verifying properties of Haskell code
stylish-haskellSimple Haskell code prettifier
hindentExtensible Haskell pretty printer
StanHaskell STatic ANalyser
FloskellFlexible Haskell source code pretty printer
WeederPerform whole-program dead-code analysis

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted