on 09afebb help sign in

A formatter for Haskell source code

git clone ssh://git.iko.soy/ormolu

Ormolu

CircleCI

Ormolu is a formatter for Haskell source code. The projects was created with the following features in mind:

Contribution

Issues (bugs, feature requests or otherwise feedback) may be reported in the GitHub issue tracker for this project. Pull requests are also welcome.

What to hack on?

Right now there are two options for people who want to contribute:

Implementing rendering of AST

The Ormolu.Printer.Combinators module provides a DSL for rendering of GHC AST. You'll probably only need this one module for writing new rendering functions. The module documents how to use the printing combinators it provides. Consult the Haddocks to learn more about them.

Create new modules corresponding to the things you want to render under Ormolu.Printer.Meat. For example, there are Ormolu.Printer.Meat.Type and Ormolu.Printer.Meat.Declaration.Data.

Concrete rendering functions get their names by appending p_ to the name of the type which describes a particular part of AST. For example, the function for rendering types is correspondingly:

p_hsType :: HsType GhcPs -> R ()

In general rendering functions like this take 1 or more arguments and produce R () which is a rendering action.

Testing

Testing has been taken good care of and now it amounts to just adding examples under data/examples. Each example is a pair of files: <example-name>.hs for input and <example-name>-out.hs for corresponding expected output.

Testing is performed as following:

Examples can be organized in sub-directories, see the existing ones for inspiration.

License

Copyright © 2018–2019 Tweag I/O