hindent is a command-line pretty printer for Haskell source code. It reformats expressions and declarations to produce consistent layouts, with options for controlling indentation, line lengths and other formatting behaviour.
The formatter uses two spaces for indentation by default, although this can be changed. Developers can also configure maximum line lengths, sort imports and specify additional GHC language extensions needed to parse their source code.
Configuration is handled through command-line options or a .hindent.yaml file stored in the project directory or home directory. The formatter can also insert line breaks before selected operators, which is useful when working with complex type signatures.
hindent provides integration with Emacs and Vim, allowing code to be reformatted directly from the editor. It also supports a validation mode that checks formatting without modifying source files.
This is free and open source software.
Key Features
- Reformats Haskell source code with configurable indentation and maximum line lengths.
- Supports import sorting and configurable trailing-newline behaviour.
- Allows language extensions to be specified when parsing Haskell source code.
- Provides custom line-break rules for selected operators and tokens.
- Reads project-specific settings from .hindent.yaml configuration files.
- Offers a validation mode for checking formatting without changing files.
- Integrates with Emacs and Vim for formatting declarations, selected regions or complete files.
- Supports pipeline processing through standard input and output.
Website: github.com/mihaimaruseac/hindent
Support:
Developer: Chris Done, Mihai Maruseac, gibiansky, sighingnow
License: BSD 3-Clause License
hindent 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.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.