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


Please read our Comment Policy before commenting.