hlint
tool for suggesting improvements to Haskell source code
TLDR
SYNOPSIS
hlint [options] [files]
DESCRIPTION
hlint is a tool for suggesting improvements to Haskell source code. It analyzes code and provides suggestions for simplification, redundancy removal, and style improvements based on common Haskell idioms.Suggestions include simplifying expressions, removing unnecessary extensions, applying standard library functions, and following best practices. The tool can automatically apply many of its suggestions through the refactor mode.Configuration files (.hlint.yaml) allow customizing which hints to apply or ignore on a per-project basis.
PARAMETERS
-r, --report[=FILE]
Generate an HTML report of suggestions (default: report.html)--refactor
Automatically apply suggestions, using the `refactor` tool from apply-refact--refactor-options OPTIONS
Pass extra options to the `refactor` executable-d, --default
Print a default .hlint.yaml, ignoring all hints currently triggered, to stdout-h, --hint FILE
Use hints from the specified file-i, --ignore HINT
Ignore a specific hint-s, --show
Show all hints, including those normally skipped-j[N], --threads[=N]
Run on N processors (default: 1; -j alone uses all physical cores)-c, --colour, --color[=always|never|auto]
Control colored output--json
Output hint data as JSON--sarif
Output hint data as SARIF-f, --find FILE
Search a Haskell file for patterns to turn into new hints-X EXTENSION, --language EXTENSION
Enable or disable a GHC language extension (e.g. -XNoCPP)--cpp-define NAME[=VALUE], --cpp-include DIR
Configure the cpphs C preprocessor run over input files
INSTALL
CAVEATS
Not all suggestions are appropriate for every codebase. Some hints may conflict with specific coding standards or performance requirements. Always review automated refactoring changes before committing.
HISTORY
hlint was created by Neil Mitchell and first released around 2006. It has become a standard tool in the Haskell ecosystem for maintaining code quality and is commonly integrated into CI pipelines and editor plugins.