ormolu/data/examples
mrkkrp 8466d6e743 Change the style of type signatures
The commit changes how type signatures are printed. The new style looks like
this:

  foo ::
    Int ->
    Char ->
    String

This works better with foralls and other features of the type system that
will be added in the near future, like linear arrows.

In order to print Haddocks nicely (this seems to be the only acceptable
placement):

  foo ::
    -- | First argument
    Int ->
    -- | Second argument
    Char ->
    -- | Result
    String

It is often necessary to re-arrange them completely and use the “pipe style”
instead of “caret style”. It proved to be a very hard task with our older
comment-handling system, if not impossible.

Here we start parsing Haddocks so that they are treated as components of AST
and we now render them as part of rendering of those components. The
existing framework for handling comments only prints non-Haddock comments
now.

The change caused a fair number of new problems and failures which I added
new tests for.
2019-10-02 16:52:42 +02:00
..
declaration Change the style of type signatures 2019-10-02 16:52:42 +02:00
import Change the style of type signatures 2019-10-02 16:52:42 +02:00
module-header Change the style of type signatures 2019-10-02 16:52:42 +02:00
other Change the style of type signatures 2019-10-02 16:52:42 +02:00