HLint is a static analysis tool that suggests improvements to Haskell source code. It identifies expressions that can be simplified, redundant constructs, alternative functions and other opportunities to make code clearer and more idiomatic.
Unlike a compiler, HLint does not need a program to type-check before examining it. It analyses individual modules, which makes it useful for checking code during development and reviewing projects with incomplete or experimental functionality. This approach also means that some recommendations require developer judgement, as HLint does not have complete type information.
Each finding identifies the relevant source location and suggests a possible improvement. Developers can review recommendations individually, ignore those that do not suit their coding style and establish consistent rules for a project. HLint is suitable for individual programmers and development teams wanting to improve maintainability without imposing a rigid formatting convention.
This is free and open source software.
Key Features
- Identifies redundant expressions, unnecessary brackets and opportunities to simplify code.
- Suggests alternative functions and more idiomatic Haskell constructs.
- Classifies findings by severity, including errors, warnings and suggestions.
- Displays source locations, existing expressions and proposed replacements.
- Automatically applies supported suggestions using the –refactor option and apply-refact.
- Generates interactive HTML reports for reviewing findings.
- Supports custom hints and project-specific rewriting rules.
- Configuration through .hlint.yaml files.
- Allows individual hints to be disabled or restricted to selected modules and declarations.
- Supports additional hint groups for teaching, generalisation and other coding conventions.
- Processes multiple source files in parallel.
- Supports C preprocessor directives and configurable Haskell language extensions.
- Integrates with Haskell Language Server and compatible editors.
- Supports automated code quality checks in continuous integration workflows.
- Provides GHC plugin integration through related tools.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: github.com/ndmitchell/hlint
Support:
Developer: Neil Mitchell
License: BSD 3-Clause ‘New’ or ‘Revised’ License
HLint 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.