1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-27 13:13:23 +03:00
ormolu/data/examples/other
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
..
argument-comment-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
argument-comment.hs Fix mis-formatting of per-argument comments in certain cases 2019-08-13 20:59:22 +02:00
ascii-out.hs Only drop indentation present for every line in multiline comments 2019-07-01 00:07:54 +02:00
ascii.hs Only drop indentation present for every line in multiline comments 2019-07-01 00:07:54 +02:00
comment-alignment-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
comment-alignment.hs Recognize gaps between comment blocks 2019-06-30 22:59:21 +02:00
comment-following-preceding-gap-out.hs Enable checking the ‘tls’ package on CI 2019-09-09 11:13:58 +02:00
comment-following-preceding-gap.hs Enable checking the ‘tls’ package on CI 2019-09-09 11:13:58 +02:00
comment-inside-construct-out.hs Align opening/closing parentheses and other similar punctuation 2019-09-17 11:58:22 +02:00
comment-inside-construct.hs Try to contain comments inside enclosing constructs 2019-08-16 16:11:33 +02:00
comment-multiline-after-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
comment-multiline-after.hs Better handle multi-line following comments 2019-09-09 11:54:18 +02:00
comment-style-transform-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
comment-style-transform.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
comment-two-blocks-out.hs Align opening/closing parentheses and other similar punctuation 2019-09-17 11:58:22 +02:00
comment-two-blocks.hs Refactor the comment rendering code and ‘newline’ 2019-09-05 16:56:43 +02:00
consequetive-pipe-comments-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
consequetive-pipe-comments.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
empty-haddock-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
empty-haddock.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-0-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-0.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-1-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-1.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-2-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-2.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-3-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
following-comment-last-3.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
merging-comments-out.hs Align opening/closing parentheses and other similar punctuation 2019-09-17 11:58:22 +02:00
merging-comments.hs Refactor the comment rendering code and ‘newline’ 2019-09-05 16:56:43 +02:00
multiline-comments-reindent-out.hs Only drop indentation present for every line in multiline comments 2019-07-01 00:07:54 +02:00
multiline-comments-reindent.hs Implement more precise comment placement without ‘ghc-exactprint’ 2019-05-08 22:03:21 +02:00
overly-indented-out.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
overly-indented.hs Change the style of type signatures 2019-10-02 16:52:42 +02:00
pragma-no-header-out.hs Handle OPTIONS_GHC and OPTIONS_HADDOCK pragmas 2019-08-11 16:04:42 +02:00
pragma-no-header.hs Handle OPTIONS_GHC and OPTIONS_HADDOCK pragmas 2019-08-11 16:04:42 +02:00
pragma-out.hs Handle OPTIONS_GHC and OPTIONS_HADDOCK pragmas 2019-08-11 16:04:42 +02:00
pragma.hs Handle OPTIONS_GHC and OPTIONS_HADDOCK pragmas 2019-08-11 16:04:42 +02:00
trailing-whitespace-out.hs Implement dropping of trailing whitespace in comments 2019-07-05 21:01:45 +02:00
trailing-whitespace.hs Implement dropping of trailing whitespace in comments 2019-07-05 21:01:45 +02:00