mirror of
https://github.com/google/ormolu.git
synced 2024-11-27 13:13:23 +03:00
8466d6e743
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.
6 lines
81 B
Haskell
6 lines
81 B
Haskell
module Main where
|
|
|
|
-- | Another datatype...
|
|
data D'
|
|
-- ^ ...with two docstrings.
|