https://github.com/vyorkin/ormolu.el
A formatter for Haskell source code
https://github.com/vyorkin/ormolu.el
emacs formatter haskell
Last synced: 10 months ago
JSON representation
A formatter for Haskell source code
- Host: GitHub
- URL: https://github.com/vyorkin/ormolu.el
- Owner: vyorkin
- Created: 2019-06-26T11:17:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-30T09:21:52.000Z (over 3 years ago)
- Last Synced: 2025-03-27T00:33:58.730Z (10 months ago)
- Topics: emacs, formatter, haskell
- Language: Emacs Lisp
- Size: 23.4 KB
- Stars: 37
- Watchers: 4
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ormolu.el
Format Haskell source code using [ormolu](https://github.com/tweag/ormolu). Requires [reformatter.el](https://github.com/purcell/reformatter.el).
# Usage
With [use-package](https://github.com/jwiegley/use-package/):
```elisp
(use-package ormolu
:hook (haskell-mode . ormolu-format-on-save-mode)
:bind
(:map haskell-mode-map
("C-c r" . ormolu-format-buffer)))
```
Without:
```elisp
(push "~/.elib/contrib/reformatter.el" load-path)
(push "~/.elib/contrib/ormolu.el" load-path)
(load-library "ormolu")
(add-hook 'haskell-mode-hook 'ormolu-format-on-save-mode)
```
## Additional configuration
The package can be configured via the usual `customize-group RET ormolu` mechanism. For example, to enable the `TypeApplications` extension by default, you can put `("--ghc-opt" "-XTypeApplications")` under the "Ormolu Extra Args" option (`ormolu-extra-args` elisp var).
## Notes
This package is just a tiny wrapper on top of the `reformatter.el`, I mean **really tiny**, just a few lines of code.