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