stylish-haskell – simple Haskell code prettifier

stylish-haskell is a Haskell code formatter that focuses on tidying up common formatting issues without trying to reformat every expression in a source file. It is particularly useful for keeping imports, language pragmas and record declarations consistent.

Rather than enforcing a complete coding style, the application makes targeted changes that improve readability while leaving most of the original layout alone. Its behaviour can be customised through a YAML configuration file.

This is free and open source software.

Key Features

  • Aligns and sorts import statements.
  • Groups and wraps {-# LANGUAGE #-} pragmas, can remove (some) redundant pragmas.
  • Removes trailing whitespace.
  • Aligns branches in case and fields in records.
  • Converts line endings (customizable).
  • Replaces tabs by four spaces (turned off by default).
  • Replaces some ASCII sequences by their Unicode equivalents (turned off by default).
  • Format data constructors and fields in records.
  • Integrates with Haskell Language Server for formatting within compatible editors.

Website: github.com/haskell/stylish-haskell
Support:
Developer: Jasper Van der Jeugt
License: 3-clause BSD License

stylish-haskell 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 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