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 | |
|---|---|
| Ormolu | Formatter for Haskell source code |
| HLint | Suggests improvements to Haskell code |
| Fourmolu | Formatter for Haskell source code, fork of Ormolu |
| LiquidHaskell | Refinement type checker for verifying properties of Haskell code |
| stylish-haskell | Simple Haskell code prettifier |
| hindent | Extensible Haskell pretty printer |
| Stan | Haskell STatic ANalyser |
| Floskell | Flexible Haskell source code pretty printer |
| Weeder | Perform whole-program dead-code analysis |
Read our verdict in the software roundup.
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. |


Please read our Comment Policy before commenting.