Tilia is a formatter for Haskell source code. It uses ghc-lib-parser for parsing and takes an opinionated approach to formatting, deliberately avoiding configuration options. The formatter lets the existing source influence whether constructs use single-line or multiline layouts rather than imposing the same layout in every situation.
Tilia works with Cabal projects and treats Cabal components as its unit of formatting. This allows it to take account of settings such as default language extensions and dependencies when processing source files. It discovers projects through cabal.project and .cabal files and can handle libraries, executables, test suites and benchmarks. Project files can be excluded from formatting with a .tiliaignore file.
The program provides two principal commands. tilia inplace reformats source files in place, while tilia check checks whether files are already formatted. Tilia also provides optional checks for AST equivalence and idempotence. CPP is treated as a first-class part of the source, and the formatter is designed to preserve and format Haskell appearing inside conditional branches.
This is free and open source software.
Key Features
- Formats Haskell source code using ghc-lib-parser.
- Works with Cabal projects, packages and individual Cabal components.
- Provides first-class support for CPP and careful formatting of comments.
- Infers operator fixities from project dependencies and source modules.
- Offers AST-equivalence and idempotence checks, plus support for excluding paths with .tiliaignore.
Website: github.com/mrkkrp/tilia
Support:
Developer: Mark Karpov
License: BSD 3-Clause “New” or “Revised” License
Tilia is written in Haskell. Learn Haskell with our recommended free books and free tutorials.
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.