on 4955cdc help sign in

A formatter for Haskell source code

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

Ormolu

CircleCI

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

Building

The easiest way to build the project is with Nix:

$ nix-build

Or with cabal-install from the Nix shell:

$ nix-shell --run "cabal new-build"

Alternatively, stack could be used with a stack.yaml file as follows.

$ cat stack.yaml
resolver: lts-13.19
packages:
- '.'

$ stack build

Usage

The following will print the formatted output to the standard output.

$ ormolu Module.hs

Add --mode inplace to replace the contents of the input file with the formatted output.

$ ormolu --mode inplace Module.hs

A configuration file can specify the language extensions to use by default.

$ cat ormolu.yaml
ghc-opts:
  - -XLambdaCase
unsafe: False
debug: False

$ ormolu -c ormolu.yaml Module.hs

Contributing

See CONTRIBUTING.md.

License

See LICENSE.md.

Copyright © 2018–2019 Tweag I/O