Contents

Indenting Haskell Mechanically

indent(1) is a tool to format C program source. At the time of writing
we have no such tool for Haskell in common use -- although this would be
fairly easy to write, given the existing parsing and pretty printing
libraries.

Here are some other solutions

Emacs

Emacs has an indent mode. Though it is often considered poor at laying
out Haskell code.

Use GHC

GHC provides a --ddump-parsed flag. It can be used as
follows. Note that it will strip comments -- so take care!
It will also normalise values -- so 0xdeadbeef becomes a large decimal.