hindent – extensible Haskell pretty printer

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
OrmoluFormatter for Haskell source code
HLintSuggests improvements to Haskell code
FourmoluFormatter for Haskell source code, fork of Ormolu
LiquidHaskellRefinement type checker for verifying properties of Haskell code
stylish-haskellSimple Haskell code prettifier
hindentExtensible Haskell pretty printer
StanHaskell STatic ANalyser
FloskellFlexible Haskell source code pretty printer
WeederPerform whole-program dead-code analysis

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted