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 | |
|---|---|
| Ormolu | Formatter for Haskell source code |
| HLint | Suggests improvements to Haskell code |
| Fourmolu | Formatter for Haskell source code, fork of Ormolu |
| 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.