HLint
What it is
HLint is a free tool that suggests possible improvements to Haskell code, including alternative functions, simpler expressions and redundancies. Each hint identifies a file and line, describes its severity and issue, and shows the found code beside a possible replacement. Projects can configure a .hlint.yaml file to add custom hints or ignore suggestions. The --refactor flag can apply some suggestions, provided the refactor executable from the apply-refact package is on PATH; the --report flag creates an interactive HTML report. HLint works 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. Its scope is limited: it analyzes one module at a time and does not know types or which names are in scope. The project cautions that some transformations may change program behavior or cause different type defaults, so suggestions need review. For C preprocessor input, it checks one conditional branch at a time based on defined macros. Version 3.10 is shown as released February 2, 2024.
For and against
For
- Free to use under a BSD-style license.
- Can produce an interactive HTML report.
- Supports custom hints and ignored suggestions.
- Runs on Linux, macOS and Windows.
Against
- Analyzes one module at a time.
- Does not account for types or names in scope.
- Some transformations may change program behavior.
- Checks only one preprocessor branch at a time.
The verdict
HLint can surface potential Haskell code improvements and apply some suggested changes. Its limited analysis and possible semantic changes mean suggestions should be reviewed before use.
Who it suits
HLint suits Haskell developers looking for suggestions about code simplification or redundancy. Beginners can focus on warning hints, while larger projects can define custom hints or ignore rules.
Plans and prices
Free
Haskell source analysis and suggestions · install with Cabal or use a binary release
Read 7 Oct 2026 · github.com
On the record
- Audience
- The project suggests that beginners may focus on warning hints and that larger projects can add custom hints or rules.github.com · read 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 · read 7 Oct 2026
- Configuration
- Projects can configure HLint with a .hlint.yaml file, including custom hints and ignored suggestions.github.com · read 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 · read 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 · read 7 Oct 2026
- Latest release shown
- The GitHub releases page identifies version 3.10, released February 2, 2024.github.com · read 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 · read 7 Oct 2026
- Output
- Each hint identifies the file and line, its severity and description, the code found, and a possible replacement.github.com · read 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 · read 7 Oct 2026
- Purpose
- HLint suggests possible improvements to Haskell code, including alternative functions, simplifications, and redundancies.github.com · read 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 · read 7 Oct 2026
- Reports
- The --report flag generates an interactive HTML report of findings.github.com · read 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 · read 7 Oct 2026