on master help sign in
Various fixes, thanks to Facundo
50fd9c7Mark Karpov
README.md+9−10
@@ -11,11 +11,11 @@ the following features in mind:
11 it means that the project follows the path of [`hindent`][hindent] and is
11 it means that the project follows the path of [`hindent`][hindent] and is
12 very much about printing AST in a particular way.
12 very much about printing AST in a particular way.
13* Implementing one “true” formatting style which admits no configuration.
13* Implementing one “true” formatting style which admits no configuration.
14−* Let layout of input source code control layout choices in output. This
14+* Let the layout of the input influence the layout choices in the output.
15− means that the choices between single-line/multi-line layouts in each
15+ This means that the choices between single-line/multi-line layouts in each
16− particular situation are made by user, not by an algorithm. This makes the
16+ particular situation are made by the user, not by an algorithm. This makes
17− implementation simpler and leaves just enough control to the user while
17+ the implementation simpler and leaves some control to the user while still
18− still guaranteeing that the formatted code is stylistically consistent.
18+ guaranteeing that the formatted code is stylistically consistent.
19* Idempotency: formatting already formatted code doesn't change it.
19* Idempotency: formatting already formatted code doesn't change it.
20* Be well-tested and robust to the point that it can be used in large
20* Be well-tested and robust to the point that it can be used in large
21 projects without exposing unfortunate, disappointing bugs here and there.
21 projects without exposing unfortunate, disappointing bugs here and there.
@@ -45,16 +45,15 @@ Right now there are two options for people who want to contribute:
45The `Ormolu.Printer.Combinators` module provides a DSL for rendering of GHC
45The `Ormolu.Printer.Combinators` module provides a DSL for rendering of GHC
46AST. You'll probably only need this one module for writing new rendering
46AST. You'll probably only need this one module for writing new rendering
47functions. The module documents how to use the printing combinators it
47functions. The module documents how to use the printing combinators it
48−provides, consult the Haddocks to learn more about that.
48+provides. Consult the Haddocks to learn more about them.
49
49
50Create new modules corresponding to the things you want to render under
50Create new modules corresponding to the things you want to render under
51`Ormolu.Printer.Meat`. For example, there are `Ormolu.Printer.Meat.Type` and
51`Ormolu.Printer.Meat`. For example, there are `Ormolu.Printer.Meat.Type` and
52`Ormolu.Printer.Meat.Declaration.Data`.
52`Ormolu.Printer.Meat.Declaration.Data`.
53
53
54−Concrete rendering functions get their names by appending `p_` to record
54+Concrete rendering functions get their names by appending `p_` to the name
55−field name which contains the part of AST of interest. For example, types
55+of the type which describes a particular part of AST. For example, the
56−are often found in fields named `hsType`, so the function for rendering
57−types is correspondingly:
56+function for rendering types is correspondingly:
58
57
59```haskell
58```haskell
60p_hsType :: HsType GhcPs -> R ()
59p_hsType :: HsType GhcPs -> R ()