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 Code Formatters
OrmoluConsistent formatting using the GHC parser
TiliaOpinionated formatter for Haskell source code
FourmoluConfigurable fork of Ormolu
stylish-haskellCustomizable source code prettification
hindentExtensible pretty printer with consistent indentation
FloskellFlexible Haskell source code pretty printer

Read our verdict in the software roundup.


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

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted