Floskell – flexible Haskell source code pretty printer

Floskell is a Haskell source code formatter offering extensive control over how expressions, declarations and other language constructs are laid out. It began as a fork of version 4 of hindent, preserving the spirit of its formatting styles while developing a more flexible approach.

The application allows developers to choose between predefined formatting styles or create their own. Configuration options control indentation, alignment, line breaks and whitespace around operators and punctuation.

Floskell evaluates different layout possibilities to find an appropriate arrangement of source code. It considers factors such as line length, indentation and the number of lines required, helping produce consistent formatting without enforcing a single rigid style.

The formatter can process files directly or read source code from standard input. It also provides integration with Emacs and Vim. Conditional compilation directives are supported with some restrictions, and formatting can be disabled for selected sections of code.

This is free and open source software.

Key Features

  • Formats Haskell source code using predefined or custom formatting styles.
  • Supports flexible and vertical layouts for different language constructs.
  • Controls indentation, alignment, line breaks and whitespace through configuration files.
  • Uses a penalty-based approach to select layouts based on line length and indentation.
  • Supports configurable alignment of declarations, expressions and other code structures.
  • Processes files in place or operates as a standard input and output filter.
  • Supports conditional compilation directives, subject to parser limitations.
  • Allows selected sections of code to retain their original formatting.
  • Provides editor integration for Emacs and Vim.

Website: github.com/ennocramer/floskell
Support:
Developer: Chris Done, Enno Cramer
License: BSD 3-Clause License

Floskell 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