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