HLint

What HLint is
HLint suggests possible improvements to Haskell code, including alternative functions, simpler expressions, and redundant code. Each hint identifies a file and line, gives a severity and description, and shows the code found with a possible replacement. Projects can configure a .hlint.yaml file with custom hints and ignored suggestions. The --refactor flag applies some suggestions, but requires the refactor executable from the apply-refact package on PATH. The --report flag creates an interactive HTML report. HLint runs on Linux, macOS, and Windows, and the project lists editor plugins, Haskell Language Server, ghc-mod, Intero, a GHC source plugin, Code Climate, and GitHub Actions among its integrations. CI use is documented for Travis CI, AppVeyor, and Azure Pipelines. The tool analyzes one module at a time and does not account for types or which names are in scope. The project cautions that some transformations may change program behavior or type defaults. For C preprocessor input, it checks one conditional branch at a time according to defined macros. HLint is free and distributed under a BSD-style license.
Who it suits
HLint suits Haskell developers who want suggestions they can review, including beginners who may focus on warning hints. Larger projects can configure custom hints or ignore suggestions.
What it does well
- Free on Linux, macOS, and Windows.
- Custom hints and ignored suggestions are configurable.
- Can apply some suggestions with --refactor.
- Provides an interactive HTML report.
- Integrations include editors and CI tools.
What to know first
- Analyzes only one module at a time.
- Does not know types or names in scope.
- Some transformations may change behavior or type defaults.
- C preprocessor checks cover one branch at a time.
Limits
HLint analyzes one module at a time and does not know types or which names are in scope. Its `--refactor` flag applies only some suggestions and requires the `refactor` executable from the `apply-refact` package on PATH.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Free | Haskell source analysis and suggestions · install with Cabal or use a binary release | Free |
As github.com lists them, read 7 Oct 2026. The maker's own page has the final word.
Getting started
- Visit the HLint project website.
- Install HLint with Cabal or use a binary release.
- Run it on a Haskell module to receive suggestions.
- Add a `.hlint.yaml` file to configure custom hints or ignored suggestions.
- Use `--report` for an interactive HTML report, or `--refactor` to apply some suggestions if the required executable is on PATH.
Verdict
HLint offers configurable Haskell suggestions, reports, and integrations across major desktop platforms. Review suggested changes carefully because the project warns that some transformations can affect behavior or type defaults.
Questions
Is HLint free?
Yes. The listed Free plan costs nothing.
Which platforms does HLint support?
Linux, macOS, and Windows.
Can HLint apply suggestions automatically?
The `--refactor` flag can apply some suggestions. It requires the `refactor` executable from the `apply-refact` package on PATH.
Can projects customize HLint?
Yes. A `.hlint.yaml` file can contain custom hints and ignored suggestions.
What integrations does HLint list?
The project lists editor plugins, Haskell Language Server, ghc-mod, Intero, a GHC source plugin, Code Climate, and GitHub Actions.
What license does HLint use?
The repository provides HLint under a BSD-style license that permits redistribution and use in source and binary forms subject to listed conditions.
Facts from HLint's own pages
- Audience
- The project suggests that beginners may focus on warning hints and that larger projects can add custom hints or rules. · github.com, 7 Oct 2026
- CI
- The project documents use with Travis CI, AppVeyor, and Azure Pipelines, and says its supplied command works on Windows, Mac, and Linux. · github.com, 7 Oct 2026
- Configuration
- Projects can configure HLint with a .hlint.yaml file, including custom hints and ignored suggestions. · github.com, 7 Oct 2026
- Integrations
- The project lists editor plugins, Haskell Language Server, ghc-mod, Intero, a GHC source plugin, Code Climate, and GitHub Actions among its integrations. · github.com, 7 Oct 2026
- Known caveat
- The project warns that some transformations may change program semantics or cause values to default to different types. · github.com, 7 Oct 2026
- Latest release shown
- The GitHub releases page identifies version 3.10, released February 2, 2024. · github.com, 7 Oct 2026
- License
- The repository provides HLint under a BSD-style license that permits redistribution and use in source and binary forms subject to listed conditions. · github.com, 7 Oct 2026
- Output
- Each hint identifies the file and line, its severity and description, the code found, and a possible replacement. · github.com, 7 Oct 2026
- Preprocessor limit
- HLint checks only one conditional branch at a time for C preprocessor input, based on the defined macros. · github.com, 7 Oct 2026
- Purpose
- HLint suggests possible improvements to Haskell code, including alternative functions, simplifications, and redundancies. · github.com, 7 Oct 2026
- Refactoring
- The --refactor flag can apply some suggestions and requires the refactor executable from the apply-refact package on PATH. · github.com, 7 Oct 2026
- Reports
- The --report flag generates an interactive HTML report of findings. · github.com, 7 Oct 2026
- Scope limit
- HLint analyzes one module at a time and does not know types or which names are in scope. · github.com, 7 Oct 2026
Where HLint stands on Freedom251
- Linters#15 of 33