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 with the `–write-default-config` flag.
- 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.
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 |
| stylish-haskell | Simple Haskell code prettifier |
| hindent | Extensible Haskell pretty printer |
| Floskell | Flexible Haskell source code pretty printer |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

