stylish-haskell – simple Haskell code prettifier

stylish-haskell is a simple Haskell code prettifier. The goal is not to format all of the code in a file, since I find those kind of tools often “get in the way”. However, manually cleaning up import statements etc. gets tedious very quickly.

This tool tries to help where necessary without getting in the way.

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

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
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 comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted